1 /*---------------------------------------------------------------------------*\
5 * Copyright (C) 2003 by the OpenSG Forum *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
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. *
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. *
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. *
28 \*---------------------------------------------------------------------------*/
29 /*---------------------------------------------------------------------------*\
37 \*---------------------------------------------------------------------------*/
39 #ifndef _OSGMEMORYOBJECTFIELDTRAITS_H_
40 #define _OSGMEMORYOBJECTFIELDTRAITS_H_
45 #include "OSGFieldTraits.h"
46 #include "OSGMemoryObject.h"
50 /*! \ingroup GrpBaseMemoryObjectsFieldTraits
51 \ingroup GrpLibOSGBase
55 struct FieldTraits
<MemoryObject
*> :
56 public FieldTraitsPODTemplateBase
<MemoryObject
*>
60 static DataType _type
;
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
; }
84 // TODO Is it correct to just ignore these for binary ??
86 static SizeT
getBinSize(MemoryObject
* const &)
91 static SizeT
getBinSize(MemoryObject
* const*,
97 static void copyToBin(BinaryDataHandler
&,
98 MemoryObject
* const & )
102 static void copyToBin(BinaryDataHandler
&,
103 MemoryObject
* const *,
108 static void copyFromBin(BinaryDataHandler
&,
109 MemoryObject
* const & )
113 static void copyFromBin(BinaryDataHandler
&,
114 MemoryObject
* const *,
123 const Char8
*FieldTraits
<MemoryObject
*,
124 0 >::getMName
<MemObjRefCountPolicy
>(
127 return "MFMemoryObjectPtr";
131 const Char8
*FieldTraits
<MemoryObject
*,
132 0 >::getSName
<MemObjRefCountPolicy
>(
135 return "SFMemoryObjectPtr";
141 #endif /* _OSGMEMORYOBJECTFIELDTRAITS_H_ */