source: GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/BBC/BBCBillboard.h @ 745

Revision 745, 1.4 KB checked in by igarcia, 19 years ago (diff)
Line 
1#ifndef _BBCBILLBOARD_H
2#define _BBCBILLBOARD_H
3
4#include <BBCBillboardClusterData.h>
5
6namespace BBC {
7
8// Forward declarations
9class Billboard;
10
11namespace boost
12{
13    void intrusive_ptr_add_ref(Billboard * p);
14    void intrusive_ptr_release(Billboard * p);
15};
16
17
18class _BBCExport Billboard
19{
20private:
21    long references;
22    friend void boost::intrusive_ptr_add_ref(Billboard * p);
23    friend void boost::intrusive_ptr_release(Billboard * p);
24
25  public:
26    Billboard();
27
28    virtual ~Billboard();
29
30
31  protected:
32    unsigned int mBillboardHandle;
33
34  public:
35    unsigned int getBillboardHandle();
36
37    void setBillboardHandle(unsigned int value);
38
39
40  protected:
41
42        BillboardClusterDataPtr mBillboardClusterData;
43
44  public:
45
46        void setBillboardClusterData(BillboardClusterDataPtr value);
47
48        BillboardClusterDataPtr getBillboardClusterData();
49
50};
51
52// class specific addref/release implementation
53// the two function overloads must be in the boost namespace on most compilers:
54namespace boost
55{
56 inline void intrusive_ptr_add_ref(Billboard * p)
57  {
58    // increment reference count of object *p
59    ++(p->references);
60  }
61
62
63
64 inline void intrusive_ptr_release(Billboard * p)
65  {
66   // decrement reference count, and delete object when reference count reaches 0
67   if (--(p->references) == 0)
68     delete p;
69  }
70} // namespace boost
71
72typedef ::boost::intrusive_ptr<Billboard> BillboardPtr;
73
74}
75#endif
Note: See TracBrowser for help on using the repository browser.