Show
Ignore:
Timestamp:
04/02/08 14:18:07 (8 months ago)
Author:
cneumann
Message:

replaced pointer field implementation
split FieldContainer/Fields? directory into Base and Handle subdir

Status: - ref counting seems to work (mt, cluster)

  • new OSB loader works (well, the unittest does)
  • VRML loader is deactivated
  • get/edit handle for dynamic (pointer) fields missing
  • need to remove some more old files - they get moved in this commit
  • generated (i.e. base) code in following commit
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/Carsten_PtrWork2/Source/System/FieldContainer/Base/OSGAspectStore.inl

    r1014 r1072  
    4444inline 
    4545AspectStore::AspectStore(void) : 
    46     _vAspects        ( ), 
    47     _refCount        (0), 
    48     _externalRefCount(0) 
     46    _vAspects( ), 
     47    _refCount(0) 
    4948{ 
    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         else 
    62         { 
    63             FFATAL(("AspectStore::AspectStore: " 
    64                     "Failed to get AspectStore::_externalRefCountLock\n")); 
    65         } 
    66     } 
    67      
    68     OSG::addRef(_externalRefCountLock); 
    6949} 
    7050 
    7151inline 
    7252AspectStore::AspectStore(const AspectStore &) : 
    73     _vAspects        ( ), 
    74     _refCount        (0), 
    75     _externalRefCount(0) 
     53    _vAspects( ), 
     54    _refCount(0) 
    7655{ 
    7756    FWARNING(("AspectStore::AspectStore(AspectStore const &) called.\n")); 
     
    156135} 
    157136 
    158  
    159 inline Int32 
    160 AspectStore::getExternalRefCount(void) const 
    161 { 
    162     return _externalRefCount; 
    163 } 
    164  
    165137inline 
    166138void AspectStore::dump(void) 
    167139{ 
    168     fprintf(stderr, "RC : %d ERC : %d\n", _refCount, _externalRefCount); 
     140    fprintf(stderr, "RC : %d\n", _refCount); 
    169141 
    170142    for(UInt32 i = 0; i < _vAspects.size(); ++i) 
     
    180152AspectStore::~AspectStore(void) 
    181153{ 
    182     OSG::subRef(_externalRefCountLock); 
    183154} 
    184155 
     
    203174} 
    204175 
    205 inline void 
    206 AspectStore::acquireExternalReferenceCountLock(void) 
    207 { 
    208     _externalRefCountLock->acquire(this); 
    209 } 
    210  
    211 inline void 
    212 AspectStore::releaseExternalReferenceCountLock(void) 
    213 { 
    214     _externalRefCountLock->release(this); 
    215 } 
    216  
    217 inline void 
    218 AspectStore::addExternalReference(void) 
    219 { 
    220     ++_externalRefCount; 
    221 } 
    222  
    223 inline void 
    224 AspectStore::subExternalReference(void) 
    225 { 
    226     --_externalRefCount; 
    227 } 
    228  
    229176/*-------------------------------------------------------------------------*/ 
    230177/* Reference Counting Free Functions                                       */ 
     
    243190        objectP->subReference(); 
    244191} 
    245   
     192 
    246193inline Int32 
    247194getRefCount(AspectStore * const objectP)