#ifndef _BBCBILLBOARD_H #define _BBCBILLBOARD_H #include namespace BBC { // Forward declarations class Billboard; namespace boost { void intrusive_ptr_add_ref(Billboard * p); void intrusive_ptr_release(Billboard * p); }; class _BBCExport Billboard { private: long references; friend void boost::intrusive_ptr_add_ref(Billboard * p); friend void boost::intrusive_ptr_release(Billboard * p); public: Billboard(); virtual ~Billboard(); protected: unsigned int mBillboardHandle; public: unsigned int getBillboardHandle(); void setBillboardHandle(unsigned int value); protected: BillboardClusterDataPtr mBillboardClusterData; public: void setBillboardClusterData(BillboardClusterDataPtr value); BillboardClusterDataPtr getBillboardClusterData(); }; // class specific addref/release implementation // the two function overloads must be in the boost namespace on most compilers: namespace boost { inline void intrusive_ptr_add_ref(Billboard * p) { // increment reference count of object *p ++(p->references); } inline void intrusive_ptr_release(Billboard * p) { // decrement reference count, and delete object when reference count reaches 0 if (--(p->references) == 0) delete p; } } // namespace boost typedef ::boost::intrusive_ptr BillboardPtr; } #endif