Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

DC_DataItem_inl.h

00001 // 00002 // Copyright 2004 P&P Software GmbH - All Rights Reserved 00003 // 00004 // DC_DataItem_inl.h 00005 // 00006 // Version 1.0 00007 // Date 11.10.03 (Version 1.1) 00008 // Author A. Pasetti (P&P Software), R. Totaro 00009 00010 #ifndef DC_DataItem_INL 00011 #define DC_DataItem_INL 00012 00013 #include "../GeneralInclude/CompilerSwitches.h" 00014 #include "../GeneralInclude/DebugSupport.h" 00015 00016 inline void DC_DataItem::initDataItem(void *data,TD_DataItemType type) { 00017 assert(data); 00018 pVar=data; 00019 00020 #ifndef NDEBUG 00021 varType=type; 00022 #endif 00023 } 00024 00025 inline DC_DataItem::DC_DataItem(TD_Float* d) { 00026 initDataItem(d,DI_FLOAT); 00027 } 00028 00029 inline DC_DataItem::DC_DataItem(TD_Integer* d) { 00030 initDataItem(d,DI_INT); 00031 } 00032 00033 inline TD_Float DC_DataItem::getFloatValue() const { 00034 assert(varType==DI_FLOAT); 00035 return *(TD_Float *)pVar; 00036 } 00037 00038 inline TD_Integer DC_DataItem::getIntegerValue() const { 00039 assert(varType==DI_INT); 00040 return *(TD_Integer *)pVar; 00041 } 00042 00043 inline void DC_DataItem::setValue(TD_Float newValue) { 00044 assert(varType==DI_FLOAT); 00045 *(TD_Float *)pVar=newValue; 00046 } 00047 00048 inline void DC_DataItem::setValue(TD_Integer newValue) { 00049 assert(varType==DI_INT); 00050 *(TD_Integer *)pVar=newValue; 00051 } 00052 00053 00054 #endif
Copyright 2003 P&P Software GmbH - All Rights Reserved