Show
Ignore:
Timestamp:
12/29/06 10:28:00 (2 years ago)
Author:
cneumann
Message:

- regenerated all base files to include the full set

of access functions for non-ptr mfields.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Source/System/FieldContainer/Attachments/OSGStringAttributeMapBase.cpp

    r437 r459  
    7373 
    7474/*! \class OSG::StringAttributeMap 
    75     An attachment that stores a string-to-string mapping of keys to 
    76     values. User code can store any key and value pair and interpret the 
    77     string value in whatever ways are appropriate. 
     75    An attachment that stores a string-to-string mapping of keys to values. 
     76    User code can store any key and value pair and interpret the string value in 
     77    whatever ways are appropriate. 
    7878 */ 
    7979 
     
    8585     
    8686*/ 
     87 
    8788/*! \var std::string     StringAttributeMapBase::_mfValues 
    8889     
    8990*/ 
     91 
    9092 
    9193void StringAttributeMapBase::classDescInserter(TypeObject &oType) 
     
    247249 
    248250 
     251/*********************************** Non-ptr code ********************************/ 
     252void StringAttributeMapBase::pushToKeys(const std::string& value) 
     253{ 
     254    editMField(KeysFieldMask, _mfKeys); 
     255    _mfKeys.push_back(value); 
     256} 
     257 
     258void StringAttributeMapBase::insertIntoKeys(UInt32                uiIndex, 
     259                                                   const std::string& value   ) 
     260{ 
     261    editMField(KeysFieldMask, _mfKeys); 
     262 
     263    MFString::iterator fieldIt = _mfKeys.begin(); 
     264 
     265    fieldIt += uiIndex; 
     266 
     267    _mfKeys.insert(fieldIt, value); 
     268} 
     269 
     270void StringAttributeMapBase::replaceInKeys(UInt32                uiIndex, 
     271                                                       const std::string& value   ) 
     272{ 
     273    if(uiIndex >= _mfKeys.size()) 
     274        return; 
     275 
     276    editMField(KeysFieldMask, _mfKeys); 
     277 
     278    _mfKeys[uiIndex] = value; 
     279} 
     280 
     281void StringAttributeMapBase::replaceInKeys(const std::string& pOldElem, 
     282                                                        const std::string& pNewElem) 
     283{ 
     284    Int32  elemIdx = _mfKeys.findIndex(pOldElem); 
     285 
     286    if(elemIdx != -1) 
     287    { 
     288        editMField(KeysFieldMask, _mfKeys); 
     289 
     290        MFString::iterator fieldIt = _mfKeys.begin(); 
     291 
     292        fieldIt += elemIdx; 
     293 
     294        (*fieldIt) = pNewElem; 
     295    } 
     296} 
     297 
     298void StringAttributeMapBase::removeFromKeys(UInt32 uiIndex) 
     299{ 
     300    if(uiIndex < _mfKeys.size()) 
     301    { 
     302        editMField(KeysFieldMask, _mfKeys); 
     303 
     304        MFString::iterator fieldIt = _mfKeys.begin(); 
     305 
     306        fieldIt += uiIndex; 
     307        _mfKeys.erase(fieldIt); 
     308    } 
     309} 
     310 
     311void StringAttributeMapBase::removeFromKeys(const std::string& value) 
     312{ 
     313    Int32 iElemIdx = _mfKeys.findIndex(value); 
     314 
     315    if(iElemIdx != -1) 
     316    { 
     317        editMField(KeysFieldMask, _mfKeys); 
     318 
     319        MFString::iterator fieldIt = _mfKeys.begin(); 
     320 
     321        fieldIt += iElemIdx; 
     322 
     323        _mfKeys.erase(fieldIt); 
     324    } 
     325} 
     326 
     327void StringAttributeMapBase::clearKeys(void) 
     328{ 
     329    editMField(KeysFieldMask, _mfKeys); 
     330 
     331    _mfKeys.clear(); 
     332} 
     333/*********************************** Non-ptr code ********************************/ 
     334void StringAttributeMapBase::pushToValues(const std::string& value) 
     335{ 
     336    editMField(ValuesFieldMask, _mfValues); 
     337    _mfValues.push_back(value); 
     338} 
     339 
     340void StringAttributeMapBase::insertIntoValues(UInt32                uiIndex, 
     341                                                   const std::string& value   ) 
     342{ 
     343    editMField(ValuesFieldMask, _mfValues); 
     344 
     345    MFString::iterator fieldIt = _mfValues.begin(); 
     346 
     347    fieldIt += uiIndex; 
     348 
     349    _mfValues.insert(fieldIt, value); 
     350} 
     351 
     352void StringAttributeMapBase::replaceInValues(UInt32                uiIndex, 
     353                                                       const std::string& value   ) 
     354{ 
     355    if(uiIndex >= _mfValues.size()) 
     356        return; 
     357 
     358    editMField(ValuesFieldMask, _mfValues); 
     359 
     360    _mfValues[uiIndex] = value; 
     361} 
     362 
     363void StringAttributeMapBase::replaceInValues(const std::string& pOldElem, 
     364                                                        const std::string& pNewElem) 
     365{ 
     366    Int32  elemIdx = _mfValues.findIndex(pOldElem); 
     367 
     368    if(elemIdx != -1) 
     369    { 
     370        editMField(ValuesFieldMask, _mfValues); 
     371 
     372        MFString::iterator fieldIt = _mfValues.begin(); 
     373 
     374        fieldIt += elemIdx; 
     375 
     376        (*fieldIt) = pNewElem; 
     377    } 
     378} 
     379 
     380void StringAttributeMapBase::removeFromValues(UInt32 uiIndex) 
     381{ 
     382    if(uiIndex < _mfValues.size()) 
     383    { 
     384        editMField(ValuesFieldMask, _mfValues); 
     385 
     386        MFString::iterator fieldIt = _mfValues.begin(); 
     387 
     388        fieldIt += uiIndex; 
     389        _mfValues.erase(fieldIt); 
     390    } 
     391} 
     392 
     393void StringAttributeMapBase::removeFromValues(const std::string& value) 
     394{ 
     395    Int32 iElemIdx = _mfValues.findIndex(value); 
     396 
     397    if(iElemIdx != -1) 
     398    { 
     399        editMField(ValuesFieldMask, _mfValues); 
     400 
     401        MFString::iterator fieldIt = _mfValues.begin(); 
     402 
     403        fieldIt += iElemIdx; 
     404 
     405        _mfValues.erase(fieldIt); 
     406    } 
     407} 
     408 
     409void StringAttributeMapBase::clearValues(void) 
     410{ 
     411    editMField(ValuesFieldMask, _mfValues); 
     412 
     413    _mfValues.clear(); 
     414} 
     415 
     416 
    249417/*------------------------------ access -----------------------------------*/ 
    250418