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

Legend:

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

    r700 r721  
    66namespace BBC { 
    77 
    8 class _BBCExport EntityDistribution { 
     8// Forward declarations 
     9class EntityDistribution; 
     10 
     11 
     12namespace boost 
     13{ 
     14    void intrusive_ptr_add_ref(EntityDistribution * p); 
     15    void intrusive_ptr_release(EntityDistribution * p); 
     16}; 
     17 
     18class _BBCExport EntityDistribution  
     19{ 
     20private: 
     21    long references; 
     22    friend void boost::intrusive_ptr_add_ref(EntityDistribution * p); 
     23    friend void boost::intrusive_ptr_release(EntityDistribution * p); 
     24 
    925  protected: 
    10         std::vector<Entity*> mEntityList; 
     26        std::vector<EntityPtr> mEntityList; 
    1127 
    1228  public: 
    13         Entity* getEntity(unsigned int value); 
     29    EntityDistribution(); 
    1430 
    15         void addEntity(Entity *value); 
     31        virtual ~EntityDistribution(); 
     32 
     33        EntityPtr getEntity(unsigned int value); 
     34 
     35        void addEntity(EntityPtr value); 
    1636 
    1737        void removeEntity(unsigned int value); 
     
    2040}; 
    2141 
     42 
     43// class specific addref/release implementation 
     44// the two function overloads must be in the boost namespace on most compilers: 
     45namespace boost 
     46{ 
     47 inline void intrusive_ptr_add_ref(EntityDistribution * p) 
     48  { 
     49    // increment reference count of object *p 
     50    ++(p->references); 
     51  } 
     52 
     53 
     54 
     55 inline void intrusive_ptr_release(EntityDistribution * p) 
     56  { 
     57   // decrement reference count, and delete object when reference count reaches 0 
     58   if (--(p->references) == 0) 
     59     delete p; 
     60  }  
     61} // namespace boost 
     62 
     63typedef ::boost::intrusive_ptr<EntityDistribution> EntityDistributionPtr; 
     64 
    2265} 
    2366#endif 
Note: See TracChangeset for help on using the changeset viewer.