Ignore:
Timestamp:
03/31/06 17:29:32 (19 years ago)
Author:
igarcia
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/BBC/BBCEntityCluster.h

    r700 r721  
    1111namespace BBC { 
    1212 
    13 class _BBCExport EntityCluster { 
     13// Forward declarations 
     14class EntityCluster; 
     15 
     16 
     17namespace boost 
     18{ 
     19    void intrusive_ptr_add_ref(EntityCluster * p); 
     20    void intrusive_ptr_release(EntityCluster * p); 
     21}; 
     22 
     23class _BBCExport EntityCluster  
     24{ 
     25private: 
     26    long references; 
     27    friend void boost::intrusive_ptr_add_ref(EntityCluster * p); 
     28    friend void boost::intrusive_ptr_release(EntityCluster * p); 
     29 
    1430  public: 
    1531    EntityCluster(); 
    1632 
    17     ~EntityCluster(); 
     33    virtual ~EntityCluster(); 
    1834 
    19         EntityClusterData* getEntityClusterData(unsigned int value); 
     35        void removeEntityClusterData(unsigned int value); 
    2036 
    21         void addEntityClusterData(EntityClusterData *value); 
     37        EntityClusterDataPtr getEntityClusterData(unsigned int value); 
     38 
     39        void addEntityClusterData(EntityClusterDataPtr value); 
    2240 
    2341        void removeEntitClusterData(unsigned int value); 
    2442 
    25         EntityDistribution* getEntityDistribution(); 
     43        EntityDistributionPtr getEntityDistribution(); 
    2644 
    27         void setEntityDistribution(EntityDistribution *value); 
     45        void setEntityDistribution(EntityDistributionPtr value); 
    2846 
    2947  protected: 
    3048 
    31         EntityDistribution *mEntityDistribution; 
     49        EntityDistributionPtr mEntityDistribution; 
    3250         
    33         std::vector<EntityClusterData*> mEntityClusterDataList; 
     51        std::vector<EntityClusterDataPtr> mEntityClusterDataList; 
    3452     
    3553        std::vector<unsigned int> mBillboarHandle; 
    3654 
    37         Entity *mEntity; 
     55        EntityPtr mEntity; 
    3856 
    3957        unsigned int mBillboardHandle; 
     
    4159  public: 
    4260 
    43         Entity* getEntity(); 
     61        EntityPtr getEntity(); 
    4462 
    45         void setEntity(Entity* value); 
     63        void setEntity(EntityPtr value); 
    4664 
    4765        unsigned int getNumEntitiesClusterData(); 
     
    5573}; 
    5674 
     75// class specific addref/release implementation 
     76// the two function overloads must be in the boost namespace on most compilers: 
     77namespace 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 
     95typedef ::boost::intrusive_ptr<EntityCluster> EntityClusterPtr; 
     96 
     97 
    5798} 
    5899#endif 
Note: See TracChangeset for help on using the changeset viewer.