changed: gcc8 base update
[opensg.git] / Source / Base / FieldContainer / Fields / OSGNodeFieldTraits.h
blobbc5955a506aef684e833210dc1e8eb16e914e5bf
1 /*---------------------------------------------------------------------------*\
2 * OpenSG *
3 * *
4 * *
5 * Copyright (C) 2003 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 _OSGNODEFIELDTRAITS_H_
40 #define _OSGNODEFIELDTRAITS_H_
41 #ifdef __sgi
42 #pragma once
43 #endif
45 #include "OSGFieldContainerFieldTraits.h"
46 #include "OSGPointerType.h"
48 #include "OSGContainerForwards.h"
50 OSG_BEGIN_NAMESPACE
52 /*! \ingroup GrpBaseFieldContainerFieldTraits
53 \ingroup GrpLibOSGBase
56 template <>
57 struct FieldTraits<Node *> : public FieldTraitsFCPtrBase<Node *>
59 private:
61 static PointerType _type;
63 public:
65 typedef FieldTraits<Node *, 0> Self;
67 enum { Convertible = Self::NotConvertible };
69 static OSG_BASE_DLLMAPPING
70 DataType &getType (void);
72 template<typename RefCountPolicy> inline
73 static const Char8 *getSName (void);
75 template<typename RefCountPolicy> inline
76 static const Char8 *getMName (void);
79 template<> inline
80 const Char8 *FieldTraits<Node *, 0>::getSName<RecordedRefCountPolicy>(void)
82 return "SFRecNodePtr";
85 template<> inline
86 const Char8 *FieldTraits<Node *, 0>::getSName<UnrecordedRefCountPolicy>(void)
88 return "SFUnrecNodePtr";
91 template<> inline
92 const Char8 *FieldTraits<Node *, 0>::getSName<WeakRefCountPolicy>(void)
94 return "SFWeakNodePtr";
97 template<> inline
98 const Char8 *FieldTraits<Node *, 0>::getSName<NoRefCountPolicy>(void)
100 return "SFUnrefdNodePtr";
105 template<> inline
106 const Char8 *FieldTraits<Node *, 0>::getMName<RecordedRefCountPolicy>(void)
108 return "MFRecNodePtr";
111 template<> inline
112 const Char8 *FieldTraits<Node *, 0>::getMName<UnrecordedRefCountPolicy>(void)
114 return "MFUnrecNodePtr";
117 template<> inline
118 const Char8 *FieldTraits<Node *, 0>::getMName<WeakRefCountPolicy>(void)
120 return "MFWeakNodePtr";
123 template<> inline
124 const Char8 *FieldTraits<Node *, 0>::getMName<NoRefCountPolicy>(void)
126 return "MFUnrefdNodePtr";
131 /*! \ingroup GrpBaseFieldContainerFieldTraits
132 \ingroup GrpLibOSGBase
135 template <>
136 struct FieldTraits<Node *, 1> : public FieldTraitsFCPtrBase<Node *, 1>
138 private:
140 public:
142 typedef FieldTraits<Node *, 1> Self;
144 enum { Convertible = Self::NotConvertible };
146 static const FieldType::Cardinality eParentCard = FieldType::SingleField;
148 static OSG_BASE_DLLMAPPING
149 DataType &getType (void);
151 template<typename RefCountPolicy> inline
152 static const Char8 *getSName (void);
154 template<typename RefCountPolicy> inline
155 static const Char8 *getMName (void);
158 template<> inline
159 const Char8 *FieldTraits<Node *, 1>::getSName<RecordedRefCountPolicy>(void)
161 return "SFRecChildNodePtr";
164 template<> inline
165 const Char8 *FieldTraits<Node *, 1>::getSName<UnrecordedRefCountPolicy>(void)
167 return "SFUnrecChildNodePtr";
170 template<> inline
171 const Char8 *FieldTraits<Node *, 1>::getSName<WeakRefCountPolicy>(void)
173 return "SFWeakChildNodePtr";
176 template<> inline
177 const Char8 *FieldTraits<Node *, 1>::getSName<NoRefCountPolicy>(void)
179 return "SFUnrefdChildNodePtr";
184 template<> inline
185 const Char8 *FieldTraits<Node *, 1>::getMName<RecordedRefCountPolicy>(void)
187 return "MFRecChildNodePtr";
190 template<> inline
191 const Char8 *FieldTraits<Node *, 1>::getMName<UnrecordedRefCountPolicy>(void)
193 return "MFUnrecChildNodePtr";
196 template<> inline
197 const Char8 *FieldTraits<Node *, 1>::getMName<WeakRefCountPolicy>(void)
199 return "MFWeakChildNodePtr";
202 template<> inline
203 const Char8 *FieldTraits<Node *, 1>::getMName<NoRefCountPolicy>(void)
205 return "MFUnrefdChildNodePtr";
208 OSG_END_NAMESPACE
210 #endif /* _OSGNODEFIELDTRAITS_H_ */