Show
Ignore:
Timestamp:
12/12/07 18:00:42 (1 year ago)
Author:
cneumann
Message:

added: generic interface
changed: factory functions return RefPtr?

The unittests don't pass right now, because of the change
to the factory functions, which leads to containers
being immediately destroyed as they are not assigned to
a RefPtr?.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/Carsten_PtrWork2/Source/System/FieldContainer/Fields/OSGSChildFCPointerField.inl

    r1017 r1032  
    102102        return; 
    103103 
    104     castPtrUp(child)->linkParent(_enclosingFC, _enclosingFCFieldId, _parentFieldId); 
     104    castPtrUp(child)->linkParent( 
     105        _pEnclosingFC, _pDesc->getFieldId(), _pDesc->getParentFieldId()); 
    105106} 
    106107 
     
    113114        return; 
    114115 
    115     castPtrUp(child)->unlinkParent(_enclosingFC, _enclosingFCFieldId, _parentFieldId); 
     116    castPtrUp(child)->unlinkParent( 
     117        _pEnclosingFC, _pDesc->getFieldId(), _pDesc->getParentFieldId()); 
    116118} 
    117119 
     
    192194template <class ObjectT, Int32 NamespaceI> 
    193195inline 
     196SChildFCPointerField<ObjectT, NamespaceI>::SChildFCPointerField(void) 
     197     
     198    : Inherited    (      ), 
     199      _pEnclosingFC(NullFC), 
     200      _pDesc       (NULL  ) 
     201{ 
     202} 
     203 
     204template <class ObjectT, Int32 NamespaceI> 
     205inline 
    194206SChildFCPointerField<ObjectT, NamespaceI>::SChildFCPointerField( 
    195     FieldContainer       *enclosingFC, 
    196     UInt16         const  enclosingFCFieldId, 
    197     UInt16         const  parentFieldId      ) 
    198      
    199     : Inherited          (                  ), 
    200       _enclosingFC       (enclosingFC       ), 
    201       _enclosingFCFieldId(enclosingFCFieldId), 
    202       _parentFieldId     (parentFieldId     ) 
    203 
     207    ValueType const  value) 
     208     
     209    : Inherited    (      ), 
     210      _pEnclosingFC(NullFC), 
     211      _pDesc       (NULL  ) 
     212
     213    this->setValue(value); 
    204214} 
    205215 
     
    207217inline 
    208218SChildFCPointerField<ObjectT, NamespaceI>::SChildFCPointerField( 
    209     FieldContainer       *enclosingFC, 
    210     UInt16         const  enclosingFCFieldId, 
    211     UInt16         const  parentFieldId, 
    212     ValueType      const  value              ) 
    213      
    214     : Inherited          (                  ), 
    215       _enclosingFC       (enclosingFC       ), 
    216       _enclosingFCFieldId(enclosingFCFieldId), 
    217       _parentFieldId     (parentFieldId     ) 
    218 
    219     this->setValue(value); 
    220 
    221  
    222 template <class ObjectT, Int32 NamespaceI> 
    223 inline 
    224 SChildFCPointerField<ObjectT, NamespaceI>::SChildFCPointerField( 
    225     FieldContainer       *enclosingFC, 
    226     UInt16         const  enclosingFCFieldId, 
    227     UInt16         const  parentFieldId, 
    228     Self           const &other              ) 
    229      
    230     : Inherited          (other             ), 
    231       _enclosingFC       (enclosingFC       ), 
    232       _enclosingFCFieldId(enclosingFCFieldId), 
    233       _parentFieldId     (parentFieldId     ) 
     219    Self const &other) 
     220     
     221    : Inherited    (other              ), 
     222      _pEnclosingFC(other._pEnclosingFC), 
     223      _pDesc       (other._pDesc       ) 
    234224{ 
    235225    incRefCount(this->_fieldValue); 
     
    343333} 
    344334 
     335/*-------------------------------------------------------------------------*/ 
     336/* Internal                                                                */ 
     337 
     338template <class ObjectT, Int32 NamespaceI> 
     339inline FieldContainer * 
     340SChildFCPointerField<ObjectT, NamespaceI>::getEnclosingFC(void) const 
     341{ 
     342    return _pEnclosingFC; 
     343} 
     344 
     345template <class ObjectT, Int32 NamespaceI> 
     346inline void 
     347SChildFCPointerField<ObjectT, NamespaceI>::setEnclosingFC( 
     348    FieldContainer *pEnclosingFC) 
     349{ 
     350    _pEnclosingFC = pEnclosingFC; 
     351} 
     352 
     353template <class ObjectT, Int32 NamespaceI> 
     354inline typename 
     355    SChildFCPointerField<ObjectT, NamespaceI>::Description const * 
     356SChildFCPointerField<ObjectT, NamespaceI>::getFieldDescription(void) const 
     357{ 
     358    return _pDesc; 
     359} 
     360 
     361template <class ObjectT, Int32 NamespaceI> 
     362inline void 
     363SChildFCPointerField<ObjectT, NamespaceI>::setFieldDescription( 
     364    Description const *pDesc) 
     365{ 
     366    _pDesc = pDesc; 
     367} 
     368 
    345369OSG_END_NAMESPACE