Show
Ignore:
Timestamp:
04/22/08 04:54:20 (5 months ago)
Author:
vossg
Message:

renamed: FieldContainerAttachment? → Attachment

ContainerPool?ContainerAttachment?

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Source/System/FieldContainer/Misc/OSGContainerCollectionBase.cpp

    r1178 r1184  
    4646 **                                                                         ** 
    4747 **     Do not change this file, changes should be done in the derived      ** 
    48  **     class ContainerPool
     48 **     class ContainerCollection
    4949 **                                                                         ** 
    5050 ***************************************************************************** 
     
    5252 
    5353 
    54 #define OSG_COMPILECONTAINERPOOLINST 
     54#define OSG_COMPILECONTAINERCOLLECTIONINST 
    5555 
    5656#include <cstdlib> 
     
    6464#include <OSGFieldContainer.h> // Containers Class 
    6565 
    66 #include "OSGContainerPoolBase.h" 
    67 #include "OSGContainerPool.h" 
     66#include "OSGContainerCollectionBase.h" 
     67#include "OSGContainerCollection.h" 
    6868 
    6969#include "boost/bind.hpp" 
     
    7575\***************************************************************************/ 
    7676 
    77 /*! \class OSG::ContainerPool 
     77/*! \class OSG::ContainerCollection 
    7878     
    7979 */ 
     
    8383\***************************************************************************/ 
    8484 
    85 /*! \var std::string     ContainerPoolBase::_sfName 
    86     The name of the container pool.  Can be used to identify pools. 
     85/*! \var std::string     ContainerCollectionBase::_sfName 
     86    The name of the container collection.  Can be used to identify collections. 
    8787*/ 
    8888 
    89 /*! \var FieldContainerPtr ContainerPoolBase::_mfContainers 
    90     A list of containers held in the pool
     89/*! \var FieldContainerPtr ContainerCollectionBase::_mfContainers 
     90    A list of containers held in the collection
    9191*/ 
    9292 
    9393 
    94 void ContainerPoolBase::classDescInserter(TypeObject &oType) 
     94void ContainerCollectionBase::classDescInserter(TypeObject &oType) 
    9595{ 
    9696    FieldDescriptionBase *pDesc = NULL; 
     
    100100        SFString::getClassType(), 
    101101        "name", 
    102         "The name of the container pool.  Can be used to identify pools.\n", 
     102        "The name of the container collection.  Can be used to identify collections.\n", 
    103103        NameFieldId, NameFieldMask, 
    104104        false, 
    105105        Field::SFDefaultFlags, 
    106         static_cast<FieldEditMethodSig>(&ContainerPoolBase::editHandleName), 
    107         static_cast<FieldGetMethodSig >(&ContainerPoolBase::getHandleName)); 
     106        static_cast<FieldEditMethodSig>(&ContainerCollectionBase::editHandleName), 
     107        static_cast<FieldGetMethodSig >(&ContainerCollectionBase::getHandleName)); 
    108108 
    109109    oType.addInitialDesc(pDesc); 
     
    112112        MFUnrecFieldContainerPtr::getClassType(), 
    113113        "containers", 
    114         "A list of containers held in the pool.\n", 
     114        "A list of containers held in the collection.\n", 
    115115        ContainersFieldId, ContainersFieldMask, 
    116116        false, 
    117117        Field::MFDefaultFlags, 
    118         static_cast<FieldEditMethodSig>(&ContainerPoolBase::editHandleContainers), 
    119         static_cast<FieldGetMethodSig >(&ContainerPoolBase::getHandleContainers)); 
     118        static_cast<FieldEditMethodSig>(&ContainerCollectionBase::editHandleContainers), 
     119        static_cast<FieldGetMethodSig >(&ContainerCollectionBase::getHandleContainers)); 
    120120 
    121121    oType.addInitialDesc(pDesc); 
     
    123123 
    124124 
    125 ContainerPoolBase::TypeObject ContainerPoolBase::_type( 
    126     ContainerPoolBase::getClassname(), 
     125ContainerCollectionBase::TypeObject ContainerCollectionBase::_type( 
     126    ContainerCollectionBase::getClassname(), 
    127127    Inherited::getClassname(), 
    128     "ContainerPool", 
     128    "ContainerCollection", 
    129129    0, 
    130     (PrototypeCreateF) &ContainerPoolBase::createEmptyLocal, 
    131     ContainerPool::initMethod, 
    132     ContainerPool::exitMethod, 
    133     (InitalInsertDescFunc) &ContainerPoolBase::classDescInserter, 
     130    (PrototypeCreateF) &ContainerCollectionBase::createEmptyLocal, 
     131    ContainerCollection::initMethod, 
     132    ContainerCollection::exitMethod, 
     133    (InitalInsertDescFunc) &ContainerCollectionBase::classDescInserter, 
    134134    false, 
    135135    0, 
     
    137137    "\n" 
    138138    "<FieldContainer\n" 
    139     "\tname=\"ContainerPool\"\n" 
    140     "\tparent=\"FieldContainerAttachment\"\n" 
     139    "\tname=\"ContainerCollection\"\n" 
     140    "\tparent=\"Attachment\"\n" 
    141141    "\tlibrary=\"System\"\n" 
    142142    "\tstructure=\"concrete\"\n" 
     
    152152    "\t\taccess=\"public\"\n" 
    153153    "\t>\n" 
    154     "\tThe name of the container pool.  Can be used to identify pools.\n" 
     154    "\tThe name of the container collection.  Can be used to identify collections.\n" 
    155155    "\t</Field>\n" 
    156156    "\t<Field\n" 
     
    161161    "                access=\"public\"\n" 
    162162    "\t>\n" 
    163     "        A list of containers held in the pool.\n" 
     163    "        A list of containers held in the collection.\n" 
    164164    "\t</Field>\n" 
    165165    "</FieldContainer>\n", 
     
    169169/*------------------------------ get -----------------------------------*/ 
    170170 
    171 FieldContainerType &ContainerPoolBase::getType(void) 
     171FieldContainerType &ContainerCollectionBase::getType(void) 
    172172{ 
    173173    return _type; 
    174174} 
    175175 
    176 const FieldContainerType &ContainerPoolBase::getType(void) const 
     176const FieldContainerType &ContainerCollectionBase::getType(void) const 
    177177{ 
    178178    return _type; 
    179179} 
    180180 
    181 UInt32 ContainerPoolBase::getContainerSize(void) const 
    182 { 
    183     return sizeof(ContainerPool); 
     181UInt32 ContainerCollectionBase::getContainerSize(void) const 
     182{ 
     183    return sizeof(ContainerCollection); 
    184184} 
    185185 
     
    187187 
    188188 
    189 SFString *ContainerPoolBase::editSFName(void) 
     189SFString *ContainerCollectionBase::editSFName(void) 
    190190{ 
    191191    editSField(NameFieldMask); 
     
    194194} 
    195195 
    196 const SFString *ContainerPoolBase::getSFName(void) const 
     196const SFString *ContainerCollectionBase::getSFName(void) const 
    197197{ 
    198198    return &_sfName; 
     
    200200 
    201201#ifdef OSG_1_GET_COMPAT 
    202 SFString            *ContainerPoolBase::getSFName           (void) 
     202SFString            *ContainerCollectionBase::getSFName           (void) 
    203203{ 
    204204    return this->editSFName           (); 
     
    206206#endif 
    207207 
    208 //! Get the ContainerPool::_mfContainers field. 
    209 const MFUnrecFieldContainerPtr *ContainerPoolBase::getMFContainers(void) const 
     208//! Get the ContainerCollection::_mfContainers field. 
     209const MFUnrecFieldContainerPtr *ContainerCollectionBase::getMFContainers(void) const 
    210210{ 
    211211    return &_mfContainers; 
     
    214214 
    215215 
    216 void ContainerPoolBase::pushToContainers(const FieldContainerPtr value) 
     216void ContainerCollectionBase::pushToContainers(const FieldContainerPtr value) 
    217217{ 
    218218    if(value == NullFC) 
     
    226226} 
    227227 
    228 void ContainerPoolBase::assignContainers(const MFUnrecFieldContainerPtr &value) 
     228void ContainerCollectionBase::assignContainers(const MFUnrecFieldContainerPtr &value) 
    229229{ 
    230230    MFUnrecFieldContainerPtr::const_iterator elemIt  = 
     
    233233        value.end  (); 
    234234 
    235     static_cast<ContainerPool *>(this)->clearContainers(); 
     235    static_cast<ContainerCollection *>(this)->clearContainers(); 
    236236 
    237237    while(elemIt != elemEnd) 
     
    243243} 
    244244 
    245 void ContainerPoolBase::insertIntoContainers(      UInt32         uiIndex, 
     245void ContainerCollectionBase::insertIntoContainers(      UInt32         uiIndex, 
    246246                                                   const FieldContainerPtr value   ) 
    247247{ 
     
    260260} 
    261261 
    262 void ContainerPoolBase::replaceInContainers(      UInt32         uiIndex, 
     262void ContainerCollectionBase::replaceInContainers(      UInt32         uiIndex, 
    263263                                                       const FieldContainerPtr value   ) 
    264264{ 
     
    280280} 
    281281 
    282 void ContainerPoolBase::replaceInContainers(const FieldContainerPtr pOldElem, 
     282void ContainerCollectionBase::replaceInContainers(const FieldContainerPtr pOldElem, 
    283283                                                        const FieldContainerPtr pNewElem) 
    284284{ 
     
    303303} 
    304304 
    305 void ContainerPoolBase::removeFromContainers(UInt32 uiIndex) 
     305void ContainerCollectionBase::removeFromContainers(UInt32 uiIndex) 
    306306{ 
    307307    if(uiIndex < _mfContainers.size()) 
     
    319319} 
    320320 
    321 void ContainerPoolBase::removeFromContainers(const FieldContainerPtr value) 
     321void ContainerCollectionBase::removeFromContainers(const FieldContainerPtr value) 
    322322{ 
    323323    Int32 iElemIdx = _mfContainers.findIndex(value); 
     
    336336    } 
    337337} 
    338 void ContainerPoolBase::clearContainers(void) 
     338void ContainerCollectionBase::clearContainers(void) 
    339339{ 
    340340    editMField(ContainersFieldMask, _mfContainers); 
     
    348348/*------------------------------ access -----------------------------------*/ 
    349349 
    350 UInt32 ContainerPoolBase::getBinSize(ConstFieldMaskArg whichField) 
     350UInt32 ContainerCollectionBase::getBinSize(ConstFieldMaskArg whichField) 
    351351{ 
    352352    UInt32 returnValue = Inherited::getBinSize(whichField); 
     
    364364} 
    365365 
    366 void ContainerPoolBase::copyToBin(BinaryDataHandler &pMem, 
     366void ContainerCollectionBase::copyToBin(BinaryDataHandler &pMem, 
    367367                                  ConstFieldMaskArg  whichField) 
    368368{ 
     
    379379} 
    380380 
    381 void ContainerPoolBase::copyFromBin(BinaryDataHandler &pMem, 
     381void ContainerCollectionBase::copyFromBin(BinaryDataHandler &pMem, 
    382382                                    ConstFieldMaskArg  whichField) 
    383383{ 
     
    395395 
    396396//! create a new instance of the class 
    397 ContainerPoolTransitPtr ContainerPoolBase::create(void) 
    398 { 
    399     ContainerPoolTransitPtr fc; 
     397ContainerCollectionTransitPtr ContainerCollectionBase::create(void) 
     398{ 
     399    ContainerCollectionTransitPtr fc; 
    400400 
    401401    if(getClassType().getPrototype() != NullFC) 
     
    404404            getClassType().getPrototype()-> shallowCopy(); 
    405405 
    406         fc = dynamic_pointer_cast<ContainerPool>(tmpPtr); 
     406        fc = dynamic_pointer_cast<ContainerCollection>(tmpPtr); 
    407407    } 
    408408 
     
    411411 
    412412//! create a new instance of the class 
    413 ContainerPoolTransitPtr ContainerPoolBase::createLocal(BitVector bFlags) 
    414 { 
    415     ContainerPoolTransitPtr fc; 
     413ContainerCollectionTransitPtr ContainerCollectionBase::createLocal(BitVector bFlags) 
     414{ 
     415    ContainerCollectionTransitPtr fc; 
    416416 
    417417    if(getClassType().getPrototype() != NullFC) 
     
    420420            getClassType().getPrototype()-> shallowCopyLocal(bFlags); 
    421421 
    422         fc = dynamic_pointer_cast<ContainerPool>(tmpPtr); 
     422        fc = dynamic_pointer_cast<ContainerCollection>(tmpPtr); 
    423423    } 
    424424 
     
    427427 
    428428//! create an empty new instance of the class, do not copy the prototype 
    429 ContainerPoolPtr ContainerPoolBase::createEmpty(void) 
    430 { 
    431     ContainerPoolPtr returnValue; 
    432  
    433     newPtr<ContainerPool>(returnValue, Thread::getCurrentLocalFlags()); 
     429ContainerCollectionPtr ContainerCollectionBase::createEmpty(void) 
     430{ 
     431    ContainerCollectionPtr returnValue; 
     432 
     433    newPtr<ContainerCollection>(returnValue, Thread::getCurrentLocalFlags()); 
    434434 
    435435    returnValue->_pFieldFlags->_bNamespaceMask &=  
     
    439439} 
    440440 
    441 ContainerPoolPtr ContainerPoolBase::createEmptyLocal(BitVector bFlags) 
    442 { 
    443     ContainerPoolPtr returnValue; 
    444  
    445     newPtr<ContainerPool>(returnValue, bFlags); 
     441ContainerCollectionPtr ContainerCollectionBase::createEmptyLocal(BitVector bFlags) 
     442{ 
     443    ContainerCollectionPtr returnValue; 
     444 
     445    newPtr<ContainerCollection>(returnValue, bFlags); 
    446446 
    447447    returnValue->_pFieldFlags->_bNamespaceMask &= ~bFlags; 
     
    450450} 
    451451 
    452 FieldContainerTransitPtr ContainerPoolBase::shallowCopy(void) const 
    453 { 
    454     ContainerPoolPtr tmpPtr; 
     452FieldContainerTransitPtr ContainerCollectionBase::shallowCopy(void) const 
     453{ 
     454    ContainerCollectionPtr tmpPtr; 
    455455 
    456456    newPtr(tmpPtr,  
    457            dynamic_cast<const ContainerPool *>(this),  
     457           dynamic_cast<const ContainerCollection *>(this),  
    458458           Thread::getCurrentLocalFlags()); 
    459459 
     
    465465} 
    466466 
    467 FieldContainerTransitPtr ContainerPoolBase::shallowCopyLocal( 
     467FieldContainerTransitPtr ContainerCollectionBase::shallowCopyLocal( 
    468468    BitVector bFlags) const 
    469469{ 
    470     ContainerPoolPtr tmpPtr; 
    471  
    472     newPtr(tmpPtr, dynamic_cast<const ContainerPool *>(this), bFlags); 
     470    ContainerCollectionPtr tmpPtr; 
     471 
     472    newPtr(tmpPtr, dynamic_cast<const ContainerCollection *>(this), bFlags); 
    473473 
    474474    FieldContainerTransitPtr returnValue(tmpPtr); 
     
    483483/*------------------------- constructors ----------------------------------*/ 
    484484 
    485 ContainerPoolBase::ContainerPoolBase(void) : 
     485ContainerCollectionBase::ContainerCollectionBase(void) : 
    486486    Inherited(), 
    487487    _sfName                   (), 
     
    490490} 
    491491 
    492 ContainerPoolBase::ContainerPoolBase(const ContainerPoolBase &source) : 
     492ContainerCollectionBase::ContainerCollectionBase(const ContainerCollectionBase &source) : 
    493493    Inherited(source), 
    494494    _sfName                   (source._sfName                   ), 
     
    500500/*-------------------------- destructors ----------------------------------*/ 
    501501 
    502 ContainerPoolBase::~ContainerPoolBase(void) 
    503 { 
    504 } 
    505  
    506 void ContainerPoolBase::onCreate(const ContainerPool *source) 
     502ContainerCollectionBase::~ContainerCollectionBase(void) 
     503{ 
     504} 
     505 
     506void ContainerCollectionBase::onCreate(const ContainerCollection *source) 
    507507{ 
    508508    Inherited::onCreate(source); 
     
    525525} 
    526526 
    527 GetFieldHandlePtr ContainerPoolBase::getHandleName            (void) const 
     527GetFieldHandlePtr ContainerCollectionBase::getHandleName            (void) const 
    528528{ 
    529529    SFString::GetHandlePtr returnValue( 
     
    535535} 
    536536 
    537 EditFieldHandlePtr ContainerPoolBase::editHandleName           (void) 
     537EditFieldHandlePtr ContainerCollectionBase::editHandleName           (void) 
    538538{ 
    539539    SFString::EditHandlePtr returnValue( 
     
    547547} 
    548548 
    549 GetFieldHandlePtr ContainerPoolBase::getHandleContainers      (void) const 
     549GetFieldHandlePtr ContainerCollectionBase::getHandleContainers      (void) const 
    550550{ 
    551551    MFUnrecFieldContainerPtr::GetHandlePtr returnValue( 
     
    557557} 
    558558 
    559 EditFieldHandlePtr ContainerPoolBase::editHandleContainers     (void) 
     559EditFieldHandlePtr ContainerCollectionBase::editHandleContainers     (void) 
    560560{ 
    561561    MFUnrecFieldContainerPtr::EditHandlePtr returnValue( 
     
    564564             this->getType().getFieldDesc(ContainersFieldId))); 
    565565 
    566     returnValue->setAddMethod(boost::bind(&ContainerPool::pushToContainers,  
    567                               static_cast<ContainerPool *>(this), _1)); 
     566    returnValue->setAddMethod(boost::bind(&ContainerCollection::pushToContainers,  
     567                              static_cast<ContainerCollection *>(this), _1)); 
    568568 
    569569    editMField(ContainersFieldMask, _mfContainers); 
     
    574574 
    575575#ifdef OSG_MT_CPTR_ASPECT 
    576 void ContainerPoolBase::execSyncV(      FieldContainer    &oFrom, 
     576void ContainerCollectionBase::execSyncV(      FieldContainer    &oFrom, 
    577577                                        ConstFieldMaskArg  whichField, 
    578578                                        AspectOffsetStore &oOffsets, 
     
    580580                                  const UInt32             uiSyncInfo) 
    581581{ 
    582     this->execSync(static_cast<ContainerPoolBase *>(&oFrom), 
     582    this->execSync(static_cast<ContainerCollectionBase *>(&oFrom), 
    583583                   whichField, 
    584584                   oOffsets, 
     
    590590 
    591591#ifdef OSG_MT_CPTR_ASPECT 
    592 FieldContainerPtr ContainerPoolBase::createAspectCopy(void) const 
    593 { 
    594     ContainerPoolPtr returnValue; 
     592FieldContainerPtr ContainerCollectionBase::createAspectCopy(void) const 
     593{ 
     594    ContainerCollectionPtr returnValue; 
    595595 
    596596    newAspectCopy(returnValue, 
    597                   dynamic_cast<const ContainerPool *>(this)); 
     597                  dynamic_cast<const ContainerCollection *>(this)); 
    598598 
    599599    return returnValue; 
     
    601601#endif 
    602602 
    603 void ContainerPoolBase::resolveLinks(void) 
     603void ContainerCollectionBase::resolveLinks(void) 
    604604{ 
    605605    Inherited::resolveLinks(); 
    606606 
    607607 
    608     static_cast<ContainerPool *>(this)->clearContainers(); 
     608    static_cast<ContainerCollection *>(this)->clearContainers(); 
    609609} 
    610610 
    611611 
    612612#if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV) 
    613 DataType FieldTraits<ContainerPoolPtr>::_type("ContainerPoolPtr", "FieldContainerAttachmentPtr"); 
     613DataType FieldTraits<ContainerCollectionPtr>::_type("ContainerCollectionPtr", "AttachmentPtr"); 
    614614#endif 
    615615 
    616 OSG_FIELDTRAITS_GETTYPE(ContainerPoolPtr) 
     616OSG_FIELDTRAITS_GETTYPE(ContainerCollectionPtr) 
    617617 
    618618OSG_EXPORT_PTR_SFIELD_FULL(PointerSField,  
    619                            ContainerPoolPtr,  
     619                           ContainerCollectionPtr,  
    620620                           0); 
    621621 
    622622OSG_EXPORT_PTR_MFIELD_FULL(PointerMField,  
    623                            ContainerPoolPtr,  
     623                           ContainerCollectionPtr,  
    624624                           0); 
    625625