VR-Forces 4.10 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
simpleListItem.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 1999 MaK Technologies, Inc.
3 ** All rights reserved.
4 *********************************************************************/
5 /*********************************************************************
6 ** $RCSfile: slLstItm.h,v $ $Revision: 1.5 $ $State: Exp $
7 *********************************************************************/
8 
9 #ifndef simpleListItem_H_
10 #define simpleListItem_H_
11 
12 #include "gdb/gdbDefines.h"
13 
14 // class DtSimpleListItem:
15 //
16 // Instances of DtSimpleListItem are used by the DtSimpleList, a singly-linked
17 // list implementation, to store the items.
18 // @note The class has no virtual functions on purpose to reduce the size
19 // of the items as DtGroups use DtSimpleLists to hold their children, which
20 // means at least one DtSimpleListItem for every polygon and other node in the
21 // scene, which adds up for large scenes.
22 //
24 {
25  friend class DtSimpleList;
26 
27 public:
28  // destructor
30 
31  // accessor
32  DtSimpleListItem* next();
33 
34  void* data();
35 
36 protected:
37  // constructor
38  DtSimpleListItem(void* d);
39 
40  // If a copy constructor is implemented, the assignment operator should
41  // also be implemented. Should generally implement both of them anyway to
42  // avoid memory problems due to inappropriate compiler provided defaults.
43  // Access varies so need to put proper access keyword above these
44  // declarations.
45  // copy constructor
47 
48  // assignment operator
50 
51 
52 protected:
54  void* myData;
55 };
56 
57 inline void* DtSimpleListItem::data()
58 {
59  return myData;
60 }
61 
63  myNext(0),
64  myData(d)
65 {
66 }
67 
68 // accessor
70 {
71  return myNext;
72 }
73 
74 #endif
DtSimpleListItem * myNext
Definition: simpleListItem.h:53
DtSimpleListItem(void *d)
Definition: simpleListItem.h:62
Definition: simpleListItem.h:23
void * data()
Definition: simpleListItem.h:57
#define DT_DLL_gdb
Definition: gdbDefines.h:25
DtSimpleList & operator=(const DtSimpleList &orig)
void * myData
Definition: simpleListItem.h:54
DtSimpleListItem * next()
Definition: simpleListItem.h:69
Definition: simpleList.h:29

Document ID: Generated on Tue Sep 21 17:42:52 EDT 2021 from SVN revision 234861
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)