Changeset 721 for GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/BBC/BBCBillboardClusterData.h
- Timestamp:
- 03/31/06 17:29:32 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/BBC/BBCBillboardClusterData.h
r700 r721 6 6 namespace BBC { 7 7 8 class _BBCExport BillboardClusterData { 8 // Fordward declaration... 9 class BillboardClusterData; 10 11 namespace boost 12 { 13 void intrusive_ptr_add_ref(BillboardClusterData * p); 14 void intrusive_ptr_release(BillboardClusterData * p); 15 }; 16 17 class _BBCExport BillboardClusterData 18 { 19 private: 20 long references; 21 friend void boost::intrusive_ptr_add_ref(BillboardClusterData * p); 22 friend void boost::intrusive_ptr_release(BillboardClusterData * p); 23 9 24 public: 10 25 BillboardClusterData(); 11 26 12 ~BillboardClusterData();27 virtual ~BillboardClusterData(); 13 28 14 29 void setNormal(Ogre::Vector3 value); … … 20 35 float getD(); 21 36 22 EntityCluster *getEntityCluster();37 EntityClusterPtr getEntityCluster(); 23 38 24 void setEntityCluster(EntityCluster *value);39 void setEntityCluster(EntityClusterPtr value); 25 40 26 41 virtual void readBillboardClusterData(TiXmlNode *parentNode); … … 47 62 48 63 protected: 49 EntityCluster *mEntityCluster;64 EntityClusterPtr mEntityCluster; 50 65 51 66 Ogre::Vector3 mAxisX; … … 70 85 }; 71 86 87 // class specific addref/release implementation 88 // the two function overloads must be in the boost namespace on most compilers: 89 namespace boost 90 { 91 inline void intrusive_ptr_add_ref(BillboardClusterData * p) 92 { 93 // increment reference count of object *p 94 ++(p->references); 95 } 96 97 98 99 inline void intrusive_ptr_release(BillboardClusterData * p) 100 { 101 // decrement reference count, and delete object when reference count reaches 0 102 if (--(p->references) == 0) 103 delete p; 104 } 105 } // namespace boost 106 107 typedef ::boost::intrusive_ptr<BillboardClusterData> BillboardClusterDataPtr; 108 72 109 } 73 110 #endif
Note: See TracChangeset
for help on using the changeset viewer.