changed: gcc8 base update
[opensg.git] / Source / Base / FieldContainer / Fields / OSGMemoryObjectFieldTraits.h
blob057220ebc629f23a5c4b7ccf4e3039912291afa4
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 _OSGMEMORYOBJECTFIELDTRAITS_H_
40 #define _OSGMEMORYOBJECTFIELDTRAITS_H_
41 #ifdef __sgi
42 #pragma once
43 #endif
45 #include "OSGFieldTraits.h"
46 #include "OSGMemoryObject.h"
48 OSG_BEGIN_NAMESPACE
50 /*! \ingroup GrpBaseMemoryObjectsFieldTraits
51 \ingroup GrpLibOSGBase
54 template <>
55 struct FieldTraits<MemoryObject *> :
56 public FieldTraitsPODTemplateBase<MemoryObject *>
58 private:
60 static DataType _type;
62 public:
64 typedef FieldTraits<MemoryObject *> Self;
65 typedef MemoryObject * ArgumentType;
66 typedef MemoryObject * FieldTypeT;
68 enum { Convertible = Self::NotConvertible };
70 static OSG_BASE_DLLMAPPING
71 DataType &getType (void);
73 template<typename RefCountPolicy> inline
74 static const Char8 *getSName (void);
76 template<typename RefCountPolicy> inline
77 static const Char8 *getMName (void);
80 static MemoryObject *getDefault(void) { return NULL; }
82 // Binary
84 // TODO Is it correct to just ignore these for binary ??
86 static SizeT getBinSize(MemoryObject * const &)
88 return 0;
91 static SizeT getBinSize(MemoryObject* const*,
92 SizeT )
94 return 0;
97 static void copyToBin(BinaryDataHandler &,
98 MemoryObject * const & )
102 static void copyToBin(BinaryDataHandler &,
103 MemoryObject * const *,
104 SizeT )
108 static void copyFromBin(BinaryDataHandler &,
109 MemoryObject * const & )
113 static void copyFromBin(BinaryDataHandler &,
114 MemoryObject * const *,
115 SizeT )
122 template<> inline
123 const Char8 *FieldTraits<MemoryObject *,
124 0 >::getMName<MemObjRefCountPolicy>(
125 void)
127 return "MFMemoryObjectPtr";
130 template<> inline
131 const Char8 *FieldTraits<MemoryObject *,
132 0 >::getSName<MemObjRefCountPolicy>(
133 void)
135 return "SFMemoryObjectPtr";
139 OSG_END_NAMESPACE
141 #endif /* _OSGMEMORYOBJECTFIELDTRAITS_H_ */