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/Base/OSGFieldDescriptionBase.h

    r889 r1032  
    5454OSG_BEGIN_NAMESPACE 
    5555 
    56 class Field; 
    5756 
    5857template <class AttachmentDescT> 
     
    141140    FieldDescriptionBase(const FieldType       &elementType, 
    142141                         const Char8           *szName, 
    143                          const std::string      fieldDocumentation, 
     142                         const std::string     &fieldDocumentation, 
    144143                         const UInt32           uiFieldId, 
    145144                         const BitVector        vFieldMask, 
     
    147146                         const UInt32           uiFieldFlags, 
    148147                               FieldEditMethod  fEditMethod, 
    149                                FieldGetMethod   fGetMethod, 
    150                          const Char8           *defaultValue = NULL); 
     148                               FieldGetMethod   fGetMethod          ); 
    151149 
    152150    FieldDescriptionBase(const FieldType            &elementType, 
    153151                         const Char8                *szName, 
    154                          const std::string          fieldDocumentation, 
     152                         const std::string          &fieldDocumentation, 
    155153                         const UInt32                uiFieldId, 
    156154                         const BitVector             vFieldMask, 
     
    158156                         const UInt32                uiFieldFlags, 
    159157                               FieldIndexEditMethod  fIndexedEditMethod, 
    160                                FieldIndexGetMethod   fIndexedGetMethod, 
    161                          const Char8                *defaultValue = NULL); 
     158                               FieldIndexGetMethod   fIndexedGetMethod  ); 
    162159 
    163160    FieldDescriptionBase(const FieldDescriptionBase &source); 
     
    187184          UInt32       getFieldId     (void                        ) const; 
    188185          void         setFieldId     (UInt32 uiFieldId            ); 
    189  
    190     const Char8       *getDefaultValue(void                        ) const; 
    191186 
    192187    const FieldType   &getFieldType   (void                        ) const; 
     
    292287    /*! \{                                                                 */ 
    293288 
    294     virtual GetFieldHandlePtr  createGetHandler (const Field *pField) = 0; 
    295     virtual EditFieldHandlePtr createEditHandler(      Field *pField) = 0; 
     289    virtual GetFieldHandlePtr  createGetHandler (Field const *pField) const = 0; 
     290    virtual EditFieldHandlePtr createEditHandler(Field       *pField) const = 0; 
    296291 
    297292#if 0 
     
    306301#endif 
    307302 
    308  
    309303    /*! \}                                                                 */ 
    310304    /*---------------------------------------------------------------------*/ 
     
    339333    /*! \{                                                                 */ 
    340334 
     335    template <class SFieldT> 
     336    struct SFieldFunctions 
     337    { 
     338        static void beginEdit(SFieldT            *pField, 
     339                              UInt32              uiAspect, 
     340                              AspectOffsetStore  &oOffsets); 
     341 
     342        static bool isShared (SFieldT            *pField  ); 
     343    }; 
     344     
     345    template <class MFieldT> 
     346    struct MFieldFunctions 
     347    { 
     348        static void beginEdit(MFieldT            *pField, 
     349                              UInt32              uiAspect, 
     350                              AspectOffsetStore  &oOffsets); 
     351 
     352        static bool isShared (MFieldT            *pField  ); 
     353    }; 
     354     
    341355    /*! \}                                                                 */ 
    342356    /*---------------------------------------------------------------------*/ 
     
    364378          FieldIndexGetMethod   _fIndexedGetMethod; 
    365379          FieldIndexEditMethod  _fIndexedEditMethod; 
    366  
    367           IDString              _defaultValue; 
    368380 
    369381    /*! \}                                                                 */