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

    r1030 r1032  
    4545#include "OSGContainerForwards.h" 
    4646#include "OSGMFCPointerFieldBase.h" 
    47  
     47#include "OSGChildFCPointerFieldDescription.h" 
    4848#include "OSGEditMFCPointerFieldHandle.h" 
    4949#include "OSGGetMFCPointerFieldHandle.h" 
     
    105105     
    106106    typedef FieldTraits     <ValueType, 
    107                              NamespaceI       >          MFieldTraits; 
    108     typedef FieldDescription<MFieldTraits, 
    109                              MultiField
    110                              ChildPointerField>          Description; 
     107                             NamespaceI             >    MFieldTraits; 
     108    typedef ChildFCPointerFieldDescription< 
     109                             MFieldTraits
     110                             FieldType::MULTI_FIELD >    Description;  
    111111                            
    112112    typedef          ValueType                          *pointer; 
     
    115115    typedef typename MFieldTraits::ArgumentType          ArgumentType; 
    116116         
    117     typedef EditMFCPointerFieldHandle<Self             > EditHandle; 
    118     typedef boost::shared_ptr<typename Self::EditHandle> EditHandlePtr; 
    119     typedef GetMFCPointerFieldHandle <Self             > GetHandle; 
    120     typedef boost::shared_ptr<typename Self::GetHandle > GetHandlePtr; 
     117    typedef EditMFCPointerFieldHandle<Self      >        EditHandle; 
     118    typedef boost::shared_ptr        <EditHandle>        EditHandlePtr; 
     119     
     120    typedef GetMFCPointerFieldHandle <Self      >        GetHandle; 
     121    typedef boost::shared_ptr        <GetHandle >        GetHandlePtr; 
     122     
     123    /*! \}                                                                 */ 
     124    /*---------------------------------------------------------------------*/ 
     125    /*! \name Constants                                                    */ 
     126    /*! \{                                                                 */ 
     127     
     128    static const FieldType::Category fieldCat = FieldType::CHILD_POINTER_FIELD; 
    121129     
    122130    /*! \}                                                                 */ 
     
    264272    /*! \{                                                                 */ 
    265273 
    266     MChildFCPointerField(FieldContainer       *enclosingFC, 
    267                          UInt16         const  enclosingFCFieldId, 
    268                          UInt16         const  parentFieldId      ); 
    269     MChildFCPointerField(FieldContainer       *enclosingFC, 
    270                          UInt16         const  enclosingFCFieldId, 
    271                          UInt16         const  parentFieldId, 
    272                          UInt32         const  size               ); 
    273     MChildFCPointerField(FieldContainer       *enclosingFC, 
    274                          UInt16         const  enclosingFCFieldId, 
    275                          UInt16         const  parentFieldId, 
    276                          Self           const &other              ); 
     274    MChildFCPointerField(void               ); 
     275    MChildFCPointerField(UInt32 const  size ); 
     276    MChildFCPointerField(Self   const &other); 
    277277 
    278278    /*! \}                                                                 */ 
     
    406406    /*! \}                                                                 */ 
    407407    /*---------------------------------------------------------------------*/ 
     408    /*! \name Internal                                                     */ 
     409    /*! \{                                                                 */ 
     410     
     411    FieldContainer    *getEnclosingFC(void                        ) const; 
     412    void               setEnclosingFC(FieldContainer *pEnclosingFC); 
     413     
     414    Description const *getFieldDescription(void                    ) const; 
     415    void               setFieldDescription(Description const *pDesc); 
     416     
     417    /*! \}                                                                 */ 
     418    /*---------------------------------------------------------------------*/ 
    408419    /*! \name Dump                                                         */ 
    409420    /*! \{                                                                 */ 
     
    419430    /*! \{                                                                 */ 
    420431 
    421     static FieldType       _fieldType; 
    422      
    423            FieldContainer *_enclosingFC; 
    424            UInt16          _enclosingFCFieldId; 
    425            UInt16          _parentFieldId; 
     432    static FieldType             _fieldType; 
     433     
     434           FieldContainer       *_pEnclosingFC; 
     435           Description    const *_pDesc; 
    426436 
    427437#if defined(OSG_TMPL_STATIC_MEMBER_NEEDS_HELPER_FCT)