- Timestamp:
- 04/02/08 14:18:07 (8 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/Carsten_PtrWork2/Source/System/FieldContainer/Base/OSGAspectStore.inl
r1014 r1072 44 44 inline 45 45 AspectStore::AspectStore(void) : 46 _vAspects ( ), 47 _refCount (0), 48 _externalRefCount(0) 46 _vAspects( ), 47 _refCount(0) 49 48 { 50 if(_externalRefCountLock == NULL)51 {52 _externalRefCountLock =53 ThreadManager::the()->getLockPool(54 "AspectStore::_externalRefCountLock");55 56 if(_externalRefCountLock != NULL)57 {58 FINFO(("AspectStore::AspectStore: "59 "Got AspectStore::_externalRefCountLock\n"));60 }61 else62 {63 FFATAL(("AspectStore::AspectStore: "64 "Failed to get AspectStore::_externalRefCountLock\n"));65 }66 }67 68 OSG::addRef(_externalRefCountLock);69 49 } 70 50 71 51 inline 72 52 AspectStore::AspectStore(const AspectStore &) : 73 _vAspects ( ), 74 _refCount (0), 75 _externalRefCount(0) 53 _vAspects( ), 54 _refCount(0) 76 55 { 77 56 FWARNING(("AspectStore::AspectStore(AspectStore const &) called.\n")); … … 156 135 } 157 136 158 159 inline Int32160 AspectStore::getExternalRefCount(void) const161 {162 return _externalRefCount;163 }164 165 137 inline 166 138 void AspectStore::dump(void) 167 139 { 168 fprintf(stderr, "RC : %d ERC : %d\n", _refCount, _externalRefCount);140 fprintf(stderr, "RC : %d\n", _refCount); 169 141 170 142 for(UInt32 i = 0; i < _vAspects.size(); ++i) … … 180 152 AspectStore::~AspectStore(void) 181 153 { 182 OSG::subRef(_externalRefCountLock);183 154 } 184 155 … … 203 174 } 204 175 205 inline void206 AspectStore::acquireExternalReferenceCountLock(void)207 {208 _externalRefCountLock->acquire(this);209 }210 211 inline void212 AspectStore::releaseExternalReferenceCountLock(void)213 {214 _externalRefCountLock->release(this);215 }216 217 inline void218 AspectStore::addExternalReference(void)219 {220 ++_externalRefCount;221 }222 223 inline void224 AspectStore::subExternalReference(void)225 {226 --_externalRefCount;227 }228 229 176 /*-------------------------------------------------------------------------*/ 230 177 /* Reference Counting Free Functions */ … … 243 190 objectP->subReference(); 244 191 } 245 192 246 193 inline Int32 247 194 getRefCount(AspectStore * const objectP)
