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.h

    r1030 r1032  
    4545#include "OSGContainerForwards.h" 
    4646#include "OSGSFCPointerFieldBase.h" 
    47  
     47#include "OSGChildFCPointerFieldDescription.h" 
    4848#include "OSGEditSFCPointerFieldHandle.h" 
    4949#include "OSGGetSFCPointerFieldHandle.h" 
     
    8383     
    8484    typedef FieldTraits     <ValueType, 
    85                              NamespaceI       >          SFieldTraits; 
    86     typedef FieldDescription<SFieldTraits, 
    87                              SingleField
    88                              ChildPointerField>          Description; 
    89          
     85                             NamespaceI             >    SFieldTraits; 
     86    typedef ChildFCPointerFieldDescription< 
     87                             SFieldTraits
     88                             FieldType::SINGLE_FIELD>    Description; 
     89     
    9090    typedef          ValueType                          *pointer; 
    9191    typedef          ReferenceProxy                      reference; 
     
    9595    typedef EditSFCPointerFieldHandle<Self      >        EditHandle; 
    9696    typedef boost::shared_ptr        <EditHandle>        EditHandlePtr; 
    97     typedef GetSFCPointerFieldHandle <Self     >         GetHandle; 
    98     typedef boost::shared_ptr        <GetHandle>         GetHandlePtr; 
     97           
     98    typedef GetSFCPointerFieldHandle <Self      >        GetHandle; 
     99    typedef boost::shared_ptr        <GetHandle >        GetHandlePtr; 
     100         
     101    /*! \}                                                                 */ 
     102    /*---------------------------------------------------------------------*/ 
     103    /*! \name Constants                                                    */ 
     104    /*! \{                                                                 */ 
     105     
     106    static const FieldType::Category fieldCat = FieldType::CHILD_POINTER_FIELD; 
    99107     
    100108    /*! \}                                                                 */ 
     
    164172    /*! \{                                                                 */ 
    165173 
    166     SChildFCPointerField(FieldContainer       *enclosingFC, 
    167                          UInt16         const  enclosingFCFieldId, 
    168                          UInt16         const  parentFieldId      ); 
    169     SChildFCPointerField(FieldContainer       *enclosingFC, 
    170                          UInt16         const  enclosingFCFieldId, 
    171                          UInt16         const  parentFieldId, 
    172                          ValueType      const  value              ); 
    173     SChildFCPointerField(FieldContainer       *enclosingFC, 
    174                          UInt16         const  enclosingFCFieldId, 
    175                          UInt16         const  parentFieldId, 
    176                          Self           const &other              ); 
     174             SChildFCPointerField(void                  ); 
     175    explicit SChildFCPointerField(ValueType const  value); 
     176             SChildFCPointerField(Self      const &other); 
    177177 
    178178    /*! \}                                                                 */ 
     
    229229    /*! \}                                                                 */ 
    230230    /*---------------------------------------------------------------------*/ 
    231     /*! \name                      MT Sync                                 */ 
     231    /*! \name MT Sync                                                      */ 
    232232    /*! \{                                                                 */ 
    233233 
    234234    void syncWith(Self &source); 
    235235 
     236    /*! \}                                                                 */ 
     237    /*---------------------------------------------------------------------*/ 
     238    /*! \name Internal                                                     */ 
     239    /*! \{                                                                 */ 
     240     
     241    FieldContainer    *getEnclosingFC(void                        ) const; 
     242    void               setEnclosingFC(FieldContainer *pEnclosingFC); 
     243     
     244    Description const *getFieldDescription(void                    ) const; 
     245    void               setFieldDescription(Description const *pDesc); 
     246     
    236247    /*! \}                                                                 */ 
    237248    /*=========================  PROTECTED  ===============================*/ 
     
    241252    /*! \{                                                                 */ 
    242253 
    243     static FieldType       _fieldType; 
    244      
    245            FieldContainer *_enclosingFC; 
    246            UInt16          _enclosingFCFieldId; 
    247            UInt16          _parentFieldId; 
     254    static FieldType             _fieldType; 
     255     
     256           FieldContainer       *_pEnclosingFC; 
     257           Description    const *_pDesc; 
    248258            
    249259#if defined(OSG_TMPL_STATIC_MEMBER_NEEDS_HELPER_FCT)