Show
Ignore:
Timestamp:
12/12/07 18:00:42 (9 months 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/Base/Field/OSGFieldType.h

    r785 r1032  
    4545#include <typeinfo> 
    4646#include "OSGDataType.h" 
     47#include "OSGFieldForwards.h" 
    4748 
    4849OSG_BEGIN_NAMESPACE 
     
    6263{ 
    6364    /*==========================  PUBLIC  =================================*/ 
    64  
    6565  public: 
    66  
    67     enum Cardinality  
    68     {  
    69         SINGLE_FIELD,  
    70         MULTI_FIELD  
     66    enum Cardinality 
     67    { 
     68        SINGLE_FIELD, 
     69        MULTI_FIELD 
    7170    }; 
    72  
     71     
     72    enum Category 
     73    { 
     74        DATA_FIELD, 
     75        CHILD_POINTER_FIELD, 
     76        INTERNAL_POINTER_FIELD, 
     77        PARENT_POINTER_FIELD, 
     78        WEAK_POINTER_FIELD 
     79    }; 
     80   
    7381    /*---------------------------------------------------------------------*/ 
    7482    /*! \name                   Constructors                               */ 
    7583    /*! \{                                                                 */ 
    7684 
    77     FieldType(const Char8             *szName,  
    78               const Char8             *szParentName, 
    79               const DataType          &contentType, 
    80                     Cardinality        cardinality, 
    81               const UInt32             uiNameSpace = GlobalNamespace); 
     85    FieldType(const Char8        *szName,  
     86              const Char8        *szParentName, 
     87              const DataType     &contentType, 
     88                    Cardinality   cardinality, 
     89                    Category      category, 
     90              const UInt32        uiNameSpace = GlobalNamespace); 
    8291 
    83     FieldType(const Char8             *szName,  
    84               const Char8             *szParentName, 
    85               const DataType          &contentType , 
    86                     Cardinality        cardinality , 
    87               const FieldType         &pScanAsType, 
    88               const UInt32             uiNameSpace = GlobalNamespace); 
     92    FieldType(const Char8        *szName,  
     93              const Char8        *szParentName, 
     94              const DataType     &contentType, 
     95                    Cardinality   cardinality, 
     96                    Category      category, 
     97              const FieldType    &pScanAsType, 
     98              const UInt32        uiNameSpace = GlobalNamespace); 
    8999 
    90100    /*! \}                                                                 */ 
     
    109119    const DataType    &getContentType(void) const; 
    110120          Cardinality  getCardinality(void) const; 
     121          Category     getCategory   (void) const; 
    111122 
    112123          UInt32       getScanTypeId (void) const; 
     
    130141    /*                             Member                                  */ 
    131142 
    132           Cardinality        _cardinality; 
    133           UInt32             _uiLoadTypeId
     143          Cardinality   _cardinality; 
     144          Category      _category
    134145 
    135     const DataType          &_contentType; 
    136     const FieldType         *_pScanAsType; 
     146    const DataType     &_contentType; 
     147    const FieldType    *_pScanAsType; 
    137148 
    138149    /*==========================  PRIVATE  ================================*/