#include <OSGFieldContainerPtrImpl.h>

Public Types | |
| typedef UInt8 *FieldContainerPtrBase::* | unspecified_bool_type |
Public Member Functions | |
Constructors | |
| FieldContainerPtrBase (void) | |
| FieldContainerPtrBase (const NullFieldContainerPtr &) | |
| FieldContainerPtrBase (const FieldContainerPtrBase &source) | |
Destructor | |
| ~FieldContainerPtrBase (void) | |
Parent Field Pos | |
| void | setParentFieldPos (UInt16 uiParentEPos) |
| UInt16 | getParentFieldPos (void) const |
Get Container Information | |
| Int32 | getRefCount (void) const |
| UInt32 | getFieldContainerId (void) const |
| UInt16 | getContainerSize (void) const |
Get Container C++ Pointer | |
| FieldContainer * | getBaseCPtr (void) const |
| FieldContainer * | getAspectCPtr (UInt32 uiAspectId) const |
Assignment | |
| void | operator= (const NullFieldContainerPtr &) |
| void | operator= (const FieldContainerPtrBase &source) |
Comparison | |
| bool | operator< (const NullFieldContainerPtr &) const |
| bool | operator== (const NullFieldContainerPtr &other) const |
| bool | operator!= (const NullFieldContainerPtr &other) const |
| bool | operator< (const FieldContainerPtrBase &) const |
| bool | operator== (const FieldContainerPtrBase &other) const |
| bool | operator!= (const FieldContainerPtrBase &other) const |
| bool | operator! (void) const |
| operator unspecified_bool_type () const | |
Dump | |
| void | dump (UInt32 uiIndent=0, const BitVector bvFlags=0) const |
Static Public Attributes | |
| static const UInt16 | InvalidParentEPos = 0xFFFF |
Protected Member Functions | |
Constructors | |
| FieldContainerPtrBase (const FieldContainer &source) | |
| FieldContainerPtrBase (const FieldContainer *source) | |
| FieldContainerPtrBase (const FieldContainer *source, const UInt16 uiSize, const UInt16 uiParentEPos) | |
Sync | |
| void | executeSync (UInt32 uiFromAspect, UInt32 uiToAspect, BitVector whichField) |
Get Memory Locations | |
| Int32 * | getRefCountP (void) |
| Int32 * | getRefCountP (void) const |
| UInt32 * | getIdP (void) |
| UInt32 * | getIdP (void) const |
| UInt8 * | getFirstElemP (void) |
| UInt8 * | getFirstElemP (void) const |
| UInt8 * | getElemP (UInt32 uiElemNum) |
| UInt8 * | getElemP (UInt32 uiElemNum) const |
Get Memory Offsets | |
| Int32 | getRefCountOff (void) const |
| Int32 | getIdOff (void) const |
| Int32 | getFirstElemOff (void) const |
| Int32 | getElemOff (UInt32 uiElemNum) const |
Reference Counting | |
| void | addRef (void) const |
| void | subRef (void) const |
| void | deleteContainers (void) const |
Helper | |
| void | setNull (void) |
Static Protected Member Functions | |
Intialization / Termination | |
| static bool | initialize (void) |
| static bool | terminate (void) |
Protected Attributes | |
Member | |
| UInt16 | _containerSize |
| UInt16 | _uiParentEPos |
| UInt8 * | _storeP |
Static Private Attributes | |
| static LockPool * | _pRefCountLock = NULL |
Friends | |
| class | FieldContainer |
| class | FieldContainerFactory |
| class | ChangeList |
| void | addRefCP (const FieldContainerPtrBase &objectP) |
| void | subRefCP (const FieldContainerPtrBase &objectP) |
| void | setRefdCP (FieldContainerPtrBase &objectP, const FieldContainerPtrBase &newObjectP) |
| void | clearRefCP (FieldContainerPtrBase &objectP) |
Definition at line 92 of file OSGFieldContainerPtrImpl.h.
| typedef UInt8* FieldContainerPtrBase::* osg::FieldContainerPtrBase::unspecified_bool_type |
Definition at line 99 of file OSGFieldContainerPtrImpl.h.
| osg::FieldContainerPtrBase::FieldContainerPtrBase | ( | void | ) | [inline] |
Definition at line 145 of file OSGFieldContainerPtrImpl.inl.
References getFirstElemP().
00145 : 00146 _containerSize(0 ), 00147 _uiParentEPos(InvalidParentEPos), 00148 _storeP (NULL ) 00149 { 00150 #ifdef OSG_DEBUG_FCPTR 00151 _typedStoreP = reinterpret_cast<FieldContainer *>(getFirstElemP()); 00152 #endif 00153 }
| osg::FieldContainerPtrBase::FieldContainerPtrBase | ( | const NullFieldContainerPtr & | ) | [inline] |
Definition at line 156 of file OSGFieldContainerPtrImpl.inl.
References getFirstElemP().
00157 : 00158 00159 _containerSize(0 ), 00160 _uiParentEPos (InvalidParentEPos), 00161 _storeP (NULL ) 00162 { 00163 #ifdef OSG_DEBUG_FCPTR 00164 _typedStoreP = reinterpret_cast<FieldContainer *>(getFirstElemP()); 00165 #endif 00166 }
| osg::FieldContainerPtrBase::FieldContainerPtrBase | ( | const FieldContainerPtrBase & | source | ) | [inline] |
Definition at line 169 of file OSGFieldContainerPtrImpl.inl.
References getFirstElemP().
00170 : 00171 00172 _containerSize(source._containerSize), 00173 _uiParentEPos (source._uiParentEPos ), 00174 _storeP (source._storeP ) 00175 { 00176 #ifdef OSG_DEBUG_FCPTR 00177 _typedStoreP = reinterpret_cast<FieldContainer *>(getFirstElemP()); 00178 #endif 00179 }
| osg::FieldContainerPtrBase::~FieldContainerPtrBase | ( | void | ) | [inline] |
Definition at line 185 of file OSGFieldContainerPtrImpl.inl.
References _containerSize, _storeP, and _uiParentEPos.
00186 { 00187 #ifdef OSG_DEBUG 00188 _storeP = NULL; 00189 _containerSize = 65535; 00190 _uiParentEPos = 65535; 00191 #ifdef OSG_DEBUG_FCPTR 00192 _typedStoreP = NULL; 00193 #endif 00194 #endif 00195 }
| osg::FieldContainerPtrBase::FieldContainerPtrBase | ( | const FieldContainer & | source | ) | [inline, explicit, protected] |
Definition at line 371 of file OSGFieldContainerPtrImpl.inl.
References _containerSize, _storeP, _uiParentEPos, osg::PThreadBase::getAspect(), osg::FieldContainer::getContainerSize(), getElemOff(), getFirstElemP(), and InvalidParentEPos.
00372 { 00373 _containerSize = source.getContainerSize(); 00374 _uiParentEPos = InvalidParentEPos; 00375 _storeP = (UInt8 *) (const_cast<FieldContainer *>(&source)); 00376 #if !defined(OSG_DEBUG_NO_FCPTR_ARITHM) 00377 _storeP -= getElemOff(Thread::getAspect()); 00378 #endif 00379 00380 #ifdef OSG_DEBUG_FCPTR 00381 _typedStoreP = reinterpret_cast<FieldContainer *>(getFirstElemP()); 00382 #endif 00383 }
| osg::FieldContainerPtrBase::FieldContainerPtrBase | ( | const FieldContainer * | source | ) | [inline, explicit, protected] |
Definition at line 386 of file OSGFieldContainerPtrImpl.inl.
References _containerSize, _storeP, _uiParentEPos, osg::PThreadBase::getAspect(), osg::FieldContainer::getContainerSize(), getElemOff(), getFirstElemP(), and InvalidParentEPos.
00387 { 00388 _uiParentEPos = InvalidParentEPos; 00389 00390 if(source != NULL) 00391 { 00392 _containerSize = source->getContainerSize(); 00393 _storeP = (UInt8 *) (const_cast<FieldContainer *>(source)); 00394 #if !defined(OSG_DEBUG_NO_FCPTR_ARITHM) 00395 _storeP -= getElemOff(Thread::getAspect()); 00396 #endif 00397 } 00398 else 00399 { 00400 _containerSize = 0; 00401 _storeP = NULL; 00402 } 00403 00404 #ifdef OSG_DEBUG_FCPTR 00405 _typedStoreP = reinterpret_cast<FieldContainer *>(getFirstElemP()); 00406 #endif 00407 }
| osg::FieldContainerPtrBase::FieldContainerPtrBase | ( | const FieldContainer * | source, | |
| const UInt16 | uiSize, | |||
| const UInt16 | uiParentEPos | |||
| ) | [inline, protected] |
Definition at line 339 of file OSGFieldContainerPtrImpl.inl.
References _containerSize, _storeP, _uiParentEPos, osg::PThreadBase::getAspect(), getElemOff(), and getFirstElemP().
00342 { 00343 _uiParentEPos = uiParentEPos; 00344 _containerSize = uiSize; 00345 00346 if(source != NULL) 00347 { 00348 _storeP = (UInt8 *) (const_cast<FieldContainer *>(source)); 00349 #if !defined(OSG_DEBUG_NO_FCPTR_ARITHM) 00350 _storeP -= getElemOff(Thread::getAspect()); 00351 #endif 00352 } 00353 else 00354 { 00355 _storeP = NULL; 00356 } 00357 00358 #ifdef OSG_DEBUG_FCPTR 00359 _typedStoreP = reinterpret_cast<FieldContainer *>(getFirstElemP()); 00360 #endif 00361 }
| void osg::FieldContainerPtrBase::setParentFieldPos | ( | UInt16 | uiParentEPos | ) | [inline] |
Definition at line 201 of file OSGFieldContainerPtrImpl.inl.
References _uiParentEPos.
Referenced by osg::SharePtrGraphOp::addAttachmentParent(), osg::SharePtrGraphOp::clearAttachmentParent(), osg::SharePtrGraphOp::compareFCs(), osg::Particles::setColors(), osg::Geometry::setColors(), osg::Surface::setControlPoints(), osg::Node::setCore(), osg::Geometry::setIndices(), osg::Geometry::setLengths(), osg::Particles::setNormals(), osg::Geometry::setNormals(), osg::Particles::setPositions(), osg::Geometry::setPositions(), osg::Geometry::setSecondaryColors(), osg::Particles::setSecPositions(), osg::Geometry::setTexCoords(), osg::Geometry::setTexCoords1(), osg::Geometry::setTexCoords2(), osg::Geometry::setTexCoords3(), osg::Geometry::setTexCoords4(), osg::Geometry::setTexCoords5(), osg::Geometry::setTexCoords6(), osg::Geometry::setTexCoords7(), osg::Surface::setTextureControlPoints(), and osg::Geometry::setTypes().
00202 { 00203 _uiParentEPos = uiParentEPos; 00204 }
| UInt16 osg::FieldContainerPtrBase::getParentFieldPos | ( | void | ) | const [inline] |
Definition at line 207 of file OSGFieldContainerPtrImpl.inl.
References _uiParentEPos.
00208 { 00209 return _uiParentEPos; 00210 }
| Int32 osg::FieldContainerPtrBase::getRefCount | ( | void | ) | const [inline] |
Definition at line 216 of file OSGFieldContainerPtrImpl.inl.
References _storeP, and getRefCountP().
Referenced by osg::RemoteAspect::createCurrentStateChangeList().
00217 { 00218 if(_storeP == NULL) 00219 return 0; 00220 00221 return (*getRefCountP()); 00222 }
| UInt32 osg::FieldContainerPtrBase::getFieldContainerId | ( | void | ) | const [inline] |
Definition at line 225 of file OSGFieldContainerPtrImpl.inl.
References getIdP().
Referenced by osg::RemoteAspect::_defaultChangedFunction(), osg::RemoteAspect::_defaultCreatedFunction(), osg::RemoteAspect::_defaultDestroyedFunction(), osg::ChangeList::addAddRefd(), osg::ChangeList::addChanged(), osg::VRMLWriteAction::addContainerUse(), osg::VRMLWriteAction::addNodeUse(), osg::ChangeList::addSubRefd(), osg::BINWriter::addToIdMap(), osg::RemoteAspect::createCurrentStateChangeList(), osg::BINLoader::createFieldContainers(), osg::BINWriter::doIndexFC(), osg::NodeCore::dump(), osg::Node::dump(), osg::Geometry::dump(), osg::Attachment::dump(), osg::VRMLWriteAction::getInfo(), osg::ClusterWindow::getNetwork(), osg::RenderAction::getOcclusionQuery(), osg::RemoteAspect::receiveSync(), osg::RemoteAspect::sendSync(), osg::OSGWriter::FCInfoHelper::setName(), osg::RenderAction::setOcclusionQuery(), osg::RenderAction::stop(), osg::FieldContainerFactory::unregisterFieldContainer(), and osg::TileLoadBalancer::updateSubtree().
00226 { 00227 return (*getIdP()); 00228 }
| UInt16 osg::FieldContainerPtrBase::getContainerSize | ( | void | ) | const [inline] |
Definition at line 231 of file OSGFieldContainerPtrImpl.inl.
References _containerSize.
Referenced by executeSync().
00232 { 00233 return _containerSize; 00234 }
| FieldContainer * osg::FieldContainerPtrBase::getBaseCPtr | ( | void | ) | const [inline] |
Definition at line 237 of file OSGFieldContainerPtrImpl.inl.
References getFirstElemP().
00238 { 00239 return reinterpret_cast<FieldContainer *>(getFirstElemP()); 00240 }
| FieldContainer * osg::FieldContainerPtrBase::getAspectCPtr | ( | UInt32 | uiAspectId | ) | const [inline] |
Definition at line 243 of file OSGFieldContainerPtrImpl.inl.
References getElemP().
Referenced by osg::QFCItem::expand(), osg::QFieldViewBase::getFieldPtr(), osg::QFieldEditorBase::getFieldPtr(), osg::getParentsField(), and osg::QFCItem::setup().
00244 { 00245 return reinterpret_cast<FieldContainer *>(getElemP(uiAspectId)); 00246 }
| void osg::FieldContainerPtrBase::operator= | ( | const NullFieldContainerPtr & | ) | [inline] |
Reimplemented in osg::AttachmentContainerPtr, osg::AttachmentPtr, osg::CNodePtr, osg::FieldContainerPtr, osg::ConstFieldContainerPtr, osg::NodePtr, and osg::FCPtr< osg::MaterialDrawablePtr, osg::Geometry >.
Definition at line 251 of file OSGFieldContainerPtrImpl.inl.
References _containerSize, _storeP, _uiParentEPos, and InvalidParentEPos.
00252 { 00253 _containerSize = 0; 00254 _uiParentEPos = InvalidParentEPos; 00255 _storeP = NULL; 00256 00257 #ifdef OSG_DEBUG_FCPTR 00258 _typedStoreP = NULL; 00259 #endif 00260 }
| void osg::FieldContainerPtrBase::operator= | ( | const FieldContainerPtrBase & | source | ) | [inline] |
Definition at line 263 of file OSGFieldContainerPtrImpl.inl.
References _containerSize, _storeP, _uiParentEPos, and getFirstElemP().
00264 { 00265 if (this == &source) 00266 return; 00267 00268 _containerSize = source._containerSize; 00269 _uiParentEPos = source._uiParentEPos; 00270 _storeP = source._storeP; 00271 00272 #ifdef OSG_DEBUG_FCPTR 00273 _typedStoreP = reinterpret_cast<FieldContainer *>(getFirstElemP()); 00274 #endif 00275 }
| bool osg::FieldContainerPtrBase::operator< | ( | const NullFieldContainerPtr & | ) | const [inline] |
| bool osg::FieldContainerPtrBase::operator== | ( | const NullFieldContainerPtr & | other | ) | const [inline] |
Definition at line 288 of file OSGFieldContainerPtrImpl.inl.
References _storeP.
00290 { 00291 return _storeP == NULL; 00292 }
| bool osg::FieldContainerPtrBase::operator!= | ( | const NullFieldContainerPtr & | other | ) | const [inline] |
Definition at line 295 of file OSGFieldContainerPtrImpl.inl.
References _storeP.
00297 { 00298 return _storeP != NULL; 00299 }
| bool osg::FieldContainerPtrBase::operator< | ( | const FieldContainerPtrBase & | other | ) | const [inline] |
Definition at line 303 of file OSGFieldContainerPtrImpl.inl.
References _storeP.
00305 { 00306 return _storeP < other._storeP; 00307 }
| bool osg::FieldContainerPtrBase::operator== | ( | const FieldContainerPtrBase & | other | ) | const [inline] |
Definition at line 310 of file OSGFieldContainerPtrImpl.inl.
References _storeP.
00312 { 00313 return _storeP == other._storeP; 00314 }
| bool osg::FieldContainerPtrBase::operator!= | ( | const FieldContainerPtrBase & | other | ) | const [inline] |
| bool osg::FieldContainerPtrBase::operator! | ( | void | ) | const [inline] |
Definition at line 324 of file OSGFieldContainerPtrImpl.inl.
References _storeP.
00325 { 00326 return _storeP == NULL; 00327 }
| osg::FieldContainerPtrBase::operator FieldContainerPtrBase::unspecified_bool_type | ( | ) | const [inline] |
Definition at line 330 of file OSGFieldContainerPtrImpl.inl.
References _storeP.
00331 { 00332 return !*this ? 0 : &FieldContainerPtrBase::_storeP; 00333 }
Definition at line 82 of file OSGFieldContainerPtr.cpp.
References _storeP, getFirstElemP(), getIdP(), getRefCountP(), osg::indentLog(), PLOG, and osg::FCDumpFlags::RefCount.
Referenced by osg::blendImage(), osg::DVRVolumeTexture::changed(), osg::createComposedImage(), osg::SimpleMaterial::dump(), osg::Geometry::dump(), osg::DVRVolume::dump(), and osg::DVRLookupTable::dump().
00084 { 00085 if(this != NULL && _storeP != NULL) 00086 { 00087 indentLog(uiIndent, PLOG); 00088 PLOG << "FCPtr Dump :" << std::endl; 00089 00090 uiIndent += 4; 00091 00092 indentLog(uiIndent, PLOG); 00093 PLOG << "Id : " << std::dec << (*(getIdP())) << std::endl; 00094 00095 indentLog(uiIndent, PLOG); 00096 PLOG << "Storage : " 00097 << std::hex << (UInt32 *)getFirstElemP() 00098 << std::endl; 00099 00100 if(bvFlags & FCDumpFlags::RefCount) 00101 { 00102 indentLog(uiIndent, PLOG); 00103 PLOG << "RefCount : " << *(getRefCountP()) << std::endl; 00104 } 00105 00106 // dumpContent(); 00107 } 00108 else 00109 { 00110 PLOG << "FCPtr Dump : (NULL)" << std::endl; 00111 } 00112 }
| bool FieldContainerPtrBase::initialize | ( | void | ) | [static, protected] |
Definition at line 117 of file OSGFieldContainerPtr.cpp.
References _pRefCountLock, osg::addRefP(), osg::ThreadManager::getLockPool(), SINFO, and osg::ThreadManager::the().
Referenced by osg::DVRVolume::draw(), osg::FieldContainerFactory::FieldContainerFactory(), and osg::DVRVolume::initializeClipObjects().
00118 { 00119 bool returnValue = false; 00120 ThreadManager *pManager = ThreadManager::the(); 00121 00122 SINFO << "OSGFieldContainerPtrBase init" << std::endl; 00123 00124 if(pManager != NULL) 00125 { 00126 _pRefCountLock = pManager->getLockPool("DSPTRRefCountLockPool"); 00127 00128 addRefP(_pRefCountLock); 00129 00130 if(_pRefCountLock != NULL) 00131 returnValue = true; 00132 } 00133 00134 return returnValue; 00135 }
| bool FieldContainerPtrBase::terminate | ( | void | ) | [static, protected] |
Definition at line 137 of file OSGFieldContainerPtr.cpp.
References _pRefCountLock, SINFO, osg::subRefP(), and osg::ThreadManager::the().
Referenced by osg::FieldContainerFactory::FieldContainerFactory().
00138 { 00139 ThreadManager *pManager = ThreadManager::the(); 00140 00141 SINFO << "OSGFieldContainerPtrBase terminate" << std::endl; 00142 00143 if(pManager == NULL) 00144 return false; 00145 00146 subRefP(_pRefCountLock); 00147 00148 return true; 00149 }
| void osg::FieldContainerPtrBase::executeSync | ( | UInt32 | uiFromAspect, | |
| UInt32 | uiToAspect, | |||
| BitVector | whichField | |||
| ) | [inline, protected] |
Definition at line 1149 of file OSGFieldContainerPtrImpl.inl.
References osg::FieldContainer::changed(), osg::FieldContainer::executeSync(), getContainerSize(), getElemP(), osg::ChangedOrigin::Sync, osg::SyncInfo::syncMode, osg::SyncInfo::uiCopyOffset, and osg::SyncInfo::uiSyncInfo.
Referenced by osg::ChangeList::apply(), and osg::ChangeList::applyTo().
01152 { 01153 #if defined(OSG_FIXED_MFIELDSYNC) 01154 SyncInfo sInfo; 01155 01156 sInfo.syncMode = 0x0000; 01157 sInfo.uiSyncInfo = (uiFromAspect << 24) | (uiToAspect << 16); 01158 sInfo.uiCopyOffset = getContainerSize(); 01159 #endif 01160 01161 FieldContainer *pTo = ((FieldContainer *) getElemP(uiToAspect)); 01162 01163 #if !defined(OSG_FIXED_MFIELDSYNC) 01164 pTo->executeSync(*((FieldContainer *) getElemP(uiFromAspect)), 01165 whichField); 01166 #else 01167 pTo->executeSync(*((FieldContainer *) getElemP(uiFromAspect)), 01168 whichField, 01169 sInfo); 01170 #endif 01171 01172 pTo->changed(whichField, ChangedOrigin::Sync); 01173 }
| Int32 * osg::FieldContainerPtrBase::getRefCountP | ( | void | ) | [inline, protected] |
| Int32 * osg::FieldContainerPtrBase::getRefCountP | ( | void | ) | const [inline, protected] |
| UInt32 * osg::FieldContainerPtrBase::getIdP | ( | void | ) | [inline, protected] |
Definition at line 78 of file OSGFieldContainerPtrImpl.inl.
References _storeP.
Referenced by deleteContainers(), dump(), and getFieldContainerId().
| UInt32 * osg::FieldContainerPtrBase::getIdP | ( | void | ) | const [inline, protected] |
| UInt8 * osg::FieldContainerPtrBase::getFirstElemP | ( | void | ) | [inline, protected] |
Definition at line 102 of file OSGFieldContainerPtrImpl.inl.
References _storeP.
Referenced by deleteContainers(), dump(), FieldContainerPtrBase(), getBaseCPtr(), osg::ConstFieldContainerPtr::getCPtr(), osg::FieldContainerPtr::getCPtr(), osg::ConstFieldContainerPtr::operator*(), osg::FieldContainerPtr::operator*(), osg::ConstFieldContainerPtr::operator->(), osg::FieldContainerPtr::operator->(), operator=(), and setNull().
00103 { 00104 return _storeP; 00105 }
| UInt8 * osg::FieldContainerPtrBase::getFirstElemP | ( | void | ) | const [inline, protected] |
Definition at line 108 of file OSGFieldContainerPtrImpl.inl.
References _storeP.
00109 { 00110 return _storeP; 00111 }
Definition at line 90 of file OSGFieldContainerPtrImpl.inl.
References _containerSize, and _storeP.
Referenced by executeSync(), getAspectCPtr(), osg::NodePtr::getCore(), osg::NodePtr::getCPtr(), osg::ConstFieldContainerPtr::getCPtr(), osg::FieldContainerPtr::getCPtr(), osg::CNodePtr::getCPtr(), osg::AttachmentPtr::getCPtr(), osg::AttachmentContainerPtr::getCPtr(), osg::CNodePtr::getNode(), osg::NodePtr::operator*(), osg::ConstFieldContainerPtr::operator*(), osg::FieldContainerPtr::operator*(), osg::CNodePtr::operator*(), osg::AttachmentPtr::operator*(), osg::AttachmentContainerPtr::operator*(), osg::NodePtr::operator->(), osg::ConstFieldContainerPtr::operator->(), osg::FieldContainerPtr::operator->(), osg::CNodePtr::operator->(), osg::AttachmentPtr::operator->(), and osg::AttachmentContainerPtr::operator->().
00091 { 00092 return (_storeP + (_containerSize * uiElemNum)); 00093 }
Definition at line 96 of file OSGFieldContainerPtrImpl.inl.
References _containerSize, and _storeP.
00097 { 00098 return (_storeP + (_containerSize * uiElemNum)); 00099 }
| Int32 osg::FieldContainerPtrBase::getRefCountOff | ( | void | ) | const [inline, protected] |
| Int32 osg::FieldContainerPtrBase::getIdOff | ( | void | ) | const [inline, protected] |
| Int32 osg::FieldContainerPtrBase::getFirstElemOff | ( | void | ) | const [inline, protected] |
Definition at line 135 of file OSGFieldContainerPtrImpl.inl.
References _containerSize.
Referenced by FieldContainerPtrBase().
00136 { 00137 return (_containerSize * uiElemNum); 00138 }
| void osg::FieldContainerPtrBase::addRef | ( | void | ) | const [inline, protected] |
Definition at line 413 of file OSGFieldContainerPtrImpl.inl.
References _pRefCountLock, _storeP, osg::ChangeList::addAddRefd(), osg::LockPool::aquire(), osg::PThreadBase::getCurrentChangeList(), getRefCountP(), and osg::LockPool::release().
Referenced by osg::addRefCP(), and osg::setRefdCP().
00414 { 00415 _pRefCountLock->aquire(_storeP); 00416 00417 (*getRefCountP())++; 00418 00419 _pRefCountLock->release(_storeP); 00420 00421 Thread::getCurrentChangeList()->addAddRefd( 00422 *(static_cast<const FieldContainerPtr *>(this))); 00423 }
| void osg::FieldContainerPtrBase::subRef | ( | void | ) | const [inline, protected] |
Definition at line 124 of file OSGFieldContainerPtrDepImpl.inl.
References _pRefCountLock, _storeP, osg::ChangeList::addSubRefd(), osg::LockPool::aquire(), deleteContainers(), osg::PThreadBase::getCurrentChangeList(), getRefCountP(), and osg::LockPool::release().
Referenced by osg::clearRefCP(), osg::setRefdCP(), and osg::subRefCP().
00125 { 00126 #if !defined(OSG_FIXED_MFIELDSYNC) 00127 _pRefCountLock->aquire(_storeP); 00128 00129 (*getRefCountP())--; 00130 00131 if((*getRefCountP()) <= 0) 00132 { 00133 _pRefCountLock->release(_storeP); 00134 00135 deleteContainers(); 00136 00137 // Clean up a little. 00138 const_cast<FieldContainerPtrBase*>(this)->_storeP = NULL; 00139 } 00140 else 00141 { 00142 _pRefCountLock->release(_storeP); 00143 00144 Thread::getCurrentChangeList()->addSubRefd( 00145 *(static_cast<const FieldContainerPtr *>(this))); 00146 } 00147 #else 00148 Thread::getCurrentChangeList()->addSubRefd( 00149 *(static_cast<const FieldContainerPtr *>(this))); 00150 #endif 00151 }
| void osg::FieldContainerPtrBase::deleteContainers | ( | void | ) | const [inline, protected] |
Definition at line 78 of file OSGFieldContainerPtrDepImpl.inl.
References _containerSize, _storeP, osg::ChangeList::addDestroyed(), osg::PThreadBase::getAspect(), osg::PThreadBase::getCurrentChangeList(), getFirstElemP(), getIdP(), osg::ThreadManager::getNumAspects(), getRefCountOff(), and osg::FieldContainerFactory::the().
Referenced by subRef().
00079 { 00080 // dump(0, FCDumpFlags::RefCount); 00081 00082 Thread::getCurrentChangeList()->addDestroyed(*getIdP()); 00083 00084 if (FieldContainerFactory::the()->unregisterFieldContainer( 00085 *((const FieldContainerPtr *) this))) 00086 { 00087 return; 00088 } 00089 00090 UInt8 *pTmp = getFirstElemP(); 00091 00092 ((FieldContainer *) pTmp)->onDestroy(); 00093 00094 #if defined(OSG_GV_BETA) && defined(OSG_DBG_MEM) 00095 00096 fprintf(stderr, "GV_MEM_FC_DBG : (%u) d (%p|%u)\n", 00097 Thread::getAspect(), 00098 pTmp, 00099 // ((FieldContainer *) pTmp)->getType().getCName(), 00100 ((FieldContainer *) pTmp)->getType().getId()); 00101 #endif 00102 00103 #if defined(OSG_FIXED_MFIELDSYNC) 00104 ((FieldContainer *) pTmp)->~FieldContainer(); 00105 #endif 00106 00107 for(UInt32 i = 0; i < ThreadManager::getNumAspects(); i++) 00108 { 00109 #if defined(OSG_FIXED_MFIELDSYNC) 00110 ((FieldContainer *) pTmp)->onDestroyAspect(*(getIdP()), i); 00111 #endif 00112 00113 #if !defined(OSG_FIXED_MFIELDSYNC) 00114 ((FieldContainer *) pTmp)->~FieldContainer(); 00115 #endif 00116 00117 pTmp += _containerSize; 00118 } 00119 00120 operator delete(_storeP + getRefCountOff()); 00121 }
| void osg::FieldContainerPtrBase::setNull | ( | void | ) | [inline, protected] |
Definition at line 426 of file OSGFieldContainerPtrImpl.inl.
References _containerSize, _storeP, _uiParentEPos, getFirstElemP(), and InvalidParentEPos.
Referenced by osg::ConstFieldContainerPtr::operator=(), and osg::FieldContainerPtr::operator=().
00427 { 00428 _containerSize = 0; 00429 _uiParentEPos = InvalidParentEPos; 00430 _storeP = NULL; 00431 00432 #ifdef OSG_DEBUG_FCPTR 00433 _typedStoreP = reinterpret_cast<FieldContainer *>(getFirstElemP()); 00434 #endif 00435 }
friend class FieldContainer [friend] |
Reimplemented in osg::AttachmentContainerPtr, osg::AttachmentPtr, osg::CNodePtr, osg::FieldContainerPtr, osg::NodePtr, and osg::FCPtr< osg::MaterialDrawablePtr, osg::Geometry >.
Definition at line 276 of file OSGFieldContainerPtrImpl.h.
friend class FieldContainerFactory [friend] |
Definition at line 277 of file OSGFieldContainerPtrImpl.h.
friend class ChangeList [friend] |
Definition at line 278 of file OSGFieldContainerPtrImpl.h.
| void addRefCP | ( | const FieldContainerPtrBase & | objectP | ) | [friend] |
| void subRefCP | ( | const FieldContainerPtrBase & | objectP | ) | [friend] |
| void setRefdCP | ( | FieldContainerPtrBase & | objectP, | |
| const FieldContainerPtrBase & | newObjectP | |||
| ) | [friend] |
| void clearRefCP | ( | FieldContainerPtrBase & | objectP | ) | [friend] |
const UInt16 FieldContainerPtrBase::InvalidParentEPos = 0xFFFF [static] |
Definition at line 98 of file OSGFieldContainerPtrImpl.h.
Referenced by FieldContainerPtrBase(), operator=(), and setNull().
UInt16 osg::FieldContainerPtrBase::_containerSize [protected] |
Definition at line 195 of file OSGFieldContainerPtrImpl.h.
Referenced by deleteContainers(), FieldContainerPtrBase(), getContainerSize(), getElemOff(), getElemP(), operator=(), setNull(), and ~FieldContainerPtrBase().
UInt16 osg::FieldContainerPtrBase::_uiParentEPos [protected] |
Definition at line 196 of file OSGFieldContainerPtrImpl.h.
Referenced by FieldContainerPtrBase(), getParentFieldPos(), operator=(), setNull(), setParentFieldPos(), and ~FieldContainerPtrBase().
UInt8* osg::FieldContainerPtrBase::_storeP [protected] |
Definition at line 197 of file OSGFieldContainerPtrImpl.h.
Referenced by addRef(), deleteContainers(), dump(), FieldContainerPtrBase(), getElemP(), getFirstElemP(), getIdP(), getRefCount(), getRefCountP(), operator unspecified_bool_type(), operator!(), operator!=(), operator<(), operator=(), operator==(), setNull(), subRef(), and ~FieldContainerPtrBase().
LockPool * FieldContainerPtrBase::_pRefCountLock = NULL [static, private] |
Definition at line 313 of file OSGFieldContainerPtrImpl.h.
Referenced by addRef(), initialize(), subRef(), and terminate().
1.5.5