fixed: auto_ptr -> unique_ptr
[opensg.git] / Source / Base / Field / OSGBoostPathFields.cpp
blob7a8d32e538d0e0efd2de16c0da8006b61a68f438
1 /*---------------------------------------------------------------------------*\
2 * OpenSG ToolBox Toolbox *
3 * *
4 * *
5 * *
6 * *
7 * Authors: David Kabala *
8 * *
9 \*---------------------------------------------------------------------------*/
10 /*---------------------------------------------------------------------------*\
11 * License *
12 * *
13 * This library is free software; you can redistribute it and/or modify it *
14 * under the terms of the GNU Library General Public License as published *
15 * by the Free Software Foundation, version 2. *
16 * *
17 * This library is distributed in the hope that it will be useful, but *
18 * WITHOUT ANY WARRANTY; without even the implied warranty of *
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
20 * Library General Public License for more details. *
21 * *
22 * You should have received a copy of the GNU Library General Public *
23 * License along with this library; if not, write to the Free Software *
24 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
25 * *
26 \*---------------------------------------------------------------------------*/
28 // Source file for new Field type
30 // This define is only set in this source file. It switches the
31 // Windows-specific declarations in the header for compiling the Field,
32 // not for using it.
33 #define OSG_COMPILEPATHTYPEINST
35 // You need this in every OpenSG file
36 #include "OSGBoostPathFields.h"
37 #include "OSGSField.ins"
38 #include "OSGMField.ins"
40 // The new field type include
41 #include "OSGFieldContainer.h"
42 #include "OSGFieldType.h"
43 #include "OSGDataType.h"
45 OSG_BEGIN_NAMESPACE
47 // This is where the DataType for the new Fieldtype is defined.
48 // The parameters are the name of the type and the name of the parent type
49 DataType FieldTraits<BoostPath>::_type("Path", "BaseType");
51 // These macros instantiate the necessary template methods for the fields
52 OSG_FIELDTRAITS_GETTYPE ( BoostPath)
53 OSG_FIELD_DLLEXPORT_DEF1(SField, BoostPath)
54 OSG_FIELD_DLLEXPORT_DEF1(MField, BoostPath)
56 // Output inVal into outVal
57 // the exact mapping doesn't matter,
58 // Our recommendation is to output as a string,
59 // i.e. start and stop with ", as this simplifies integration into the
60 // OSG Loader.
62 // void FieldTraits<BoostPath>::putToStream(const BoostPath &inVal,
63 // OutStream &outVal)
65 // Setup outVal from the contents of inVal
66 // For complicated classes it makes sense to implement this function
67 // as a class method and just call that from here
68 // bool FieldTraits<BoostPath>::getFromCString( BoostPath &outVal,
69 // const Char8 *&inVal)
71 // Binary conversion
73 // Return the size of the binary version in byte
74 // There are two versions of this function, one for a single object,
75 // one for an array of objects
76 //UInt32 FieldTraits<BoostPath>::getBinSize(const BoostPath & obj)
78 //UInt32 FieldTraits<BoostPath>::getBinSize (const BoostPath *obj, UInt32 num)
80 // Copy the object into the BinaryDataHandler
81 // the BDH has a number of methods to add a simple type to the stream
82 // just use those and use the same order to read them back in.
83 // Again there are two versions, one for a single object, one for an
84 // array of objects
85 //void FieldTraits<BoostPath>::copyToBin( BinaryDataHandler &bdh,
86 // const BoostPath &obj)
88 //void FieldTraits<BoostPath>::copyToBin( BinaryDataHandler &bdh,
89 // const BoostPath *objs,
90 // UInt32 num)
93 // Copy the object from the BinaryDataHandler
94 // the BDH has a number of methods to get a simple type from the stream
95 // just use those and use the same order you used to write them out.
96 // Again there are two versions, one for a single object, one for an
97 // array of objects
98 //void FieldTraits<BoostPath>::copyFromBin(BinaryDataHandler &bdh,
99 // BoostPath &obj)
100 //void FieldTraits<BoostPath>::copyFromBin(BinaryDataHandler &bdh,
101 // BoostPath *objs,
102 // UInt32 num)
104 OSG_END_NAMESPACE