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/BBCSubEntity.h

    r700 r721  
    55 
    66namespace BBC { 
    7  
     7  
    88class _BBCExport UniqueVertex 
    99{ 
     
    2424typedef std::vector<UniqueVertex> UniqueVertexList; 
    2525 
    26 class _BBCExport SubEntity { 
    27   public: 
     26// Fordward declaration 
     27class SubEntity; 
     28 
     29namespace boost 
     30{ 
     31    void intrusive_ptr_add_ref(SubEntity * p); 
     32    void intrusive_ptr_release(SubEntity * p); 
     33}; 
     34 
     35class _BBCExport SubEntity 
     36{ 
     37  private: 
     38    long references; 
     39 
     40    friend void boost::intrusive_ptr_add_ref(SubEntity * p); 
     41 
     42    friend void boost::intrusive_ptr_release(SubEntity * p); 
     43 
     44  protected: 
    2845 
    2946        typedef std::vector<unsigned short int> TextureCoordSetsDimensions; 
     47 
    3048        typedef std::vector<Ogre::Vector3> Indices; 
    31  
    32   protected: 
    3349 
    3450        UniqueVertexList mUniqueVertexList; 
     
    5672    SubEntity(); 
    5773 
    58     ~SubEntity(); 
     74    virtual ~SubEntity(); 
    5975 
    6076        void enableTangents(bool value); 
     
    129145 
    130146        void generateAABBox(); 
     147 
     148        const char *GetClassName(void) const; 
     149 
    131150}; 
     151 
     152// class specific addref/release implementation 
     153// the two function overloads must be in the boost namespace on most compilers: 
     154namespace boost 
     155{ 
     156  inline void intrusive_ptr_add_ref(SubEntity * p) 
     157  { 
     158    // increment reference count of object *p 
     159    ++(p->references); 
     160  } 
     161 
     162 
     163 
     164  inline void intrusive_ptr_release(SubEntity * p) 
     165  { 
     166   // decrement reference count, and delete object when reference count reaches 0 
     167   if (--(p->references) == 0) 
     168     delete p; 
     169  }  
     170} // namespace boost 
     171 
     172typedef ::boost::intrusive_ptr<SubEntity> SubEntityPtr; 
    132173 
    133174} 
Note: See TracChangeset for help on using the changeset viewer.