![]() |
VR-Forces 4.0.4 Class Documentation
|
00001 /********************************************************************* 00002 ** Copyright (c) 1999 MaK Technologies, Inc. 00003 ** All rights reserved. 00004 *********************************************************************/ 00005 /********************************************************************* 00006 ** $RCSfile: slLstItm.h,v $ $Revision: 1.5 $ $State: Exp $ 00007 *********************************************************************/ 00008 00009 #ifndef slLstItm_H_ 00010 #define slLstItm_H_ 00011 00012 #include "gdb/gdbDefines.h" 00013 00014 // class DtSimpleListItem: 00015 // 00016 // Instances of DtSimpleListItem are used by the DtSimpleList, a singly-linked 00017 // list implementation, to store the items. 00018 // @note The class has no virtual functions on purpose to reduce the size 00019 // of the items as DtGroups use DtSimpleLists to hold their children, which 00020 // means at least one DtSimpleListItem for every polygon and other node in the 00021 // scene, which adds up for large scenes. 00022 // 00023 class DT_DLL_gdb DtSimpleListItem 00024 { 00025 friend class DtSimpleList; 00026 00027 public: 00028 // destructor 00029 ~DtSimpleListItem(); 00030 00031 // accessor 00032 DtSimpleListItem* next(); 00033 00034 void* data(); 00035 00036 protected: 00037 // constructor 00038 DtSimpleListItem(void* d); 00039 00040 // If a copy constructor is implemented, the assignment operator should 00041 // also be implemented. Should generally implement both of them anyway to 00042 // avoid memory problems due to inappropriate compiler provided defaults. 00043 // Access varies so need to put proper access keyword above these 00044 // declarations. 00045 // copy constructor 00046 DtSimpleListItem(const DtSimpleListItem& orig); 00047 00048 // assignment operator 00049 DtSimpleListItem& operator=(const DtSimpleListItem& orig); 00050 00051 00052 protected: 00053 DtSimpleListItem* myNext; 00054 void* myData; 00055 }; 00056 00057 inline void* DtSimpleListItem::data() 00058 { 00059 return myData; 00060 } 00061 00062 inline DtSimpleListItem::DtSimpleListItem(void* d): 00063 myNext(0), 00064 myData(d) 00065 { 00066 } 00067 00068 // accessor 00069 inline DtSimpleListItem* DtSimpleListItem::next() 00070 { 00071 return myNext; 00072 } 00073 00074 #endif