fixed: auto_ptr -> unique_ptr
[opensg.git] / Source / Base / Field / OSGFieldType.h
blob8240d2d5626596ba4609b12ae34fa18f6f52a310
1 /*---------------------------------------------------------------------------*\
2 * OpenSG *
3 * *
4 * *
5 * Copyright (C) 2000-2002 by the OpenSG Forum *
6 * *
7 * www.opensg.org *
8 * *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de *
10 * *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
13 * License *
14 * *
15 * This library is free software; you can redistribute it and/or modify it *
16 * under the terms of the GNU Library General Public License as published *
17 * by the Free Software Foundation, version 2. *
18 * *
19 * This library is distributed in the hope that it will be useful, but *
20 * WITHOUT ANY WARRANTY; without even the implied warranty of *
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
22 * Library General Public License for more details. *
23 * *
24 * You should have received a copy of the GNU Library General Public *
25 * License along with this library; if not, write to the Free Software *
26 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
27 * *
28 \*---------------------------------------------------------------------------*/
29 /*---------------------------------------------------------------------------*\
30 * Changes *
31 * *
32 * *
33 * *
34 * *
35 * *
36 * *
37 \*---------------------------------------------------------------------------*/
39 #ifndef _OSGFIELDTYPE_H_
40 #define _OSGFIELDTYPE_H_
41 #ifdef __sgi
42 #pragma once
43 #endif
45 #include <typeinfo>
46 #include "OSGDataType.h"
47 #include "OSGFieldForwards.h"
49 OSG_BEGIN_NAMESPACE
51 class Field;
53 #ifdef OSG_1_GET_COMPAT
54 #define SINGLE_FIELD SingleField
55 #define MULTI_FIELD MultiField
56 #endif
58 /*! \ingroup GrpBaseField
59 \ingroup GrpLibOSGBase
62 class OSG_BASE_DLLMAPPING FieldType : public DataType
64 /*========================== PUBLIC =================================*/
66 public:
68 enum Cardinality
70 SingleField,
71 MultiField
75 enum Class
77 ValueField,
78 PtrField,
79 ParentPtrField,
80 ChildPtrField
83 /*---------------------------------------------------------------------*/
84 /*! \name Constructors */
85 /*! \{ */
87 FieldType(const Char8 *szName,
88 const Char8 *szParentName,
89 const DataType &contentType,
90 Cardinality cardinality,
91 Class fieldClass,
92 FieldDescCreator fCreator = NULL,
93 IndexedFieldDescCreator fIdxCreator = NULL,
94 const UInt32 uiNameSpace = GlobalNamespace);
96 FieldType(const Char8 *szName,
97 const Char8 *szParentName,
98 const DataType &contentType ,
99 Cardinality cardinality ,
100 Class fieldClass,
101 const FieldType &pScanAsType,
102 FieldDescCreator fCreator = NULL,
103 IndexedFieldDescCreator fIdxCreator = NULL,
104 const UInt32 uiNameSpace = GlobalNamespace);
106 /*! \} */
107 /*---------------------------------------------------------------------*/
108 /*! \name Destructor */
109 /*! \{ */
111 virtual ~FieldType(void);
113 /*! \} */
114 /*---------------------------------------------------------------------*/
115 /*! \name Is */
116 /*! \{ */
118 // bool isFieldContainerPtrField(void);
120 /*! \} */
121 /*---------------------------------------------------------------------*/
122 /*! \name Get */
123 /*! \{ */
125 const DataType &getContentType(void) const;
126 Cardinality getCardinality(void) const;
127 Class getClass (void) const;
129 UInt32 getScanTypeId (void) const;
130 bool isPtrField (void) const;
132 /*! \} */
134 #if defined(OSG_STATIC_MEMEBER_NEEDS_COPY_ASIGN_INIT)
135 /*!\brief prohibit default function (move to 'public' if needed) */
136 FieldType(const FieldType &source);
137 /*!\brief prohibit default function (move to 'public' if needed) */
138 FieldType &operator =(const FieldType &obj);
139 #endif
141 /*========================= PROTECTED ===============================*/
143 protected:
145 typedef DataType Inherited;
147 /*---------------------------------------------------------------------*/
148 /* Member */
150 Cardinality _cardinality;
151 UInt32 _uiLoadTypeId;
152 Class _fieldClass;
154 const DataType &_contentType;
155 const FieldType *_pScanAsType;
157 /*========================== PRIVATE ================================*/
159 private:
161 #if !defined(OSG_STATIC_MEMEBER_NEEDS_COPY_ASIGN_INIT)
162 /*!\brief prohibit default function (move to 'public' if needed) */
163 FieldType(const FieldType &source);
164 /*!\brief prohibit default function (move to 'public' if needed) */
165 FieldType &operator =(const FieldType &obj);
166 #endif
169 OSG_END_NAMESPACE
171 #include "OSGFieldType.inl"
173 #endif /* _OSGFIELDTYPE_H_ */