- Timestamp:
- 03/31/06 17:29:32 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/BBC/BBCEntityCluster.h
r700 r721 11 11 namespace BBC { 12 12 13 class _BBCExport EntityCluster { 13 // Forward declarations 14 class EntityCluster; 15 16 17 namespace boost 18 { 19 void intrusive_ptr_add_ref(EntityCluster * p); 20 void intrusive_ptr_release(EntityCluster * p); 21 }; 22 23 class _BBCExport EntityCluster 24 { 25 private: 26 long references; 27 friend void boost::intrusive_ptr_add_ref(EntityCluster * p); 28 friend void boost::intrusive_ptr_release(EntityCluster * p); 29 14 30 public: 15 31 EntityCluster(); 16 32 17 ~EntityCluster();33 virtual ~EntityCluster(); 18 34 19 EntityClusterData* getEntityClusterData(unsigned int value);35 void removeEntityClusterData(unsigned int value); 20 36 21 void addEntityClusterData(EntityClusterData *value); 37 EntityClusterDataPtr getEntityClusterData(unsigned int value); 38 39 void addEntityClusterData(EntityClusterDataPtr value); 22 40 23 41 void removeEntitClusterData(unsigned int value); 24 42 25 EntityDistribution *getEntityDistribution();43 EntityDistributionPtr getEntityDistribution(); 26 44 27 void setEntityDistribution(EntityDistribution *value);45 void setEntityDistribution(EntityDistributionPtr value); 28 46 29 47 protected: 30 48 31 EntityDistribution *mEntityDistribution;49 EntityDistributionPtr mEntityDistribution; 32 50 33 std::vector<EntityClusterData *> mEntityClusterDataList;51 std::vector<EntityClusterDataPtr> mEntityClusterDataList; 34 52 35 53 std::vector<unsigned int> mBillboarHandle; 36 54 37 Entity *mEntity;55 EntityPtr mEntity; 38 56 39 57 unsigned int mBillboardHandle; … … 41 59 public: 42 60 43 Entity *getEntity();61 EntityPtr getEntity(); 44 62 45 void setEntity(Entity *value);63 void setEntity(EntityPtr value); 46 64 47 65 unsigned int getNumEntitiesClusterData(); … … 55 73 }; 56 74 75 // class specific addref/release implementation 76 // the two function overloads must be in the boost namespace on most compilers: 77 namespace boost 78 { 79 inline void intrusive_ptr_add_ref(EntityCluster * p) 80 { 81 // increment reference count of object *p 82 ++(p->references); 83 } 84 85 86 87 inline void intrusive_ptr_release(EntityCluster * p) 88 { 89 // decrement reference count, and delete object when reference count reaches 0 90 if (--(p->references) == 0) 91 delete p; 92 } 93 } // namespace boost 94 95 typedef ::boost::intrusive_ptr<EntityCluster> EntityClusterPtr; 96 97 57 98 } 58 99 #endif
Note: See TracChangeset
for help on using the changeset viewer.