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 _OSGASPECTIDFIELDTRAITS_H_
40 #define _OSGASPECTIDFIELDTRAITS_H_
45 #include "OSGSystemDef.h"
46 #include "OSGSysFieldTraits.h"
47 #include "OSGAspectPool.h"
51 /*! \ingroup GrpBaseFieldTraits
52 \ingroup GrpLibOSGBase
56 struct FieldTraits
<AspectId
, 2> :
57 public FieldTraitsPODTemplateBase
<AspectId
, 2>
61 static DataType _type
;
65 typedef FieldTraits
<AspectId
, 2> Self
;
67 enum { Convertible
= (Self::ToStreamConvertible
|
68 Self::FromStringConvertible
) };
70 static OSG_SYSTEM_DLLMAPPING
71 DataType
&getType (void);
73 static const Char8
*getSName(void) { return "SFAspectId"; }
75 static const Char8
*getMName(void) { return "MFAspectId"; }
77 static BitVector
getDefault(void) { return AspectId(); }
79 static void putToStream(const AspectId
&val
,
82 FieldTraits
<UInt32
>::putToStream(val
, str
);
85 static bool getFromCString( AspectId
&outVal
,
93 if(inVal
[0] >= '0' && inVal
[0] <= '9')
95 FieldTraits
<UInt32
>::getFromCString(outVal
, inVal
);
100 outVal
= AspectPool::the()->get(inVal
);
106 #ifndef DOXYGEN_SHOULD_SKIP_THIS
108 /*! \ingroup GrpBaseFieldSingle */
109 typedef SField
<AspectId
, 2> SFAspectId
;
113 /*! \ingroup GrpBaseFieldSingle \ingroup GrpLibOSGBase */
114 struct SFAspectId
: public SField
<AspectId
, 2> {};
120 #endif /* _OSGASPECTIDFIELDTRAITS_H_ */