1 /*---------------------------------------------------------------------------*\
5 * Copyright (C) 2000-2002 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 _OSGVRMLPROTOTYPEHANDLER_H_
40 #define _OSGVRMLPROTOTYPEHANDLER_H_
45 #include "OSGBaseTypes.h"
46 #include "OSGBaseFunctions.h"
50 #include "OSGVRMLNodeHelper.h"
54 #include "OSGDeprecatedCPP.h"
59 /*! \brief VRML97 Loader prototype handler
60 \ingroup GrpFileIOWRLObj
61 \ingroup GrpLibOSGFileIO
64 template <class BaseT
>
65 class VRMLNodePrototypeHandler
: public BaseT
67 /*========================== PRIVATE ================================*/
71 typedef VRMLNodePrototypeHandler
<BaseT
> Self
;
73 /*========================== PUBLIC =================================*/
76 /*---------------------------------------------------------------------*/
77 /*! \name Constructors */
80 VRMLNodePrototypeHandler(void);
83 /*---------------------------------------------------------------------*/
84 /*! \name Destructor */
87 virtual ~VRMLNodePrototypeHandler(void);
90 /*---------------------------------------------------------------------*/
91 /*! \name Skel replacements */
94 virtual void beginProto (const Char8
*szProtoname
);
95 virtual void endProtoInterface ( void);
96 virtual void endProto ( void);
98 virtual void beginEventInDecl (const Char8
*szEventType
,
99 const UInt32 uiFieldTypeId
,
100 const Char8
*szEventName
);
102 virtual void beginEventOutDecl (const Char8
*szEventType
,
103 const UInt32 uiFieldTypeId
,
104 const Char8
*szEventName
);
106 virtual void beginFieldDecl (const Char8
*szFieldType
,
107 const UInt32 uiFieldTypeId
,
108 const Char8
*szFieldName
);
110 virtual void endFieldDecl ( void);
112 virtual void beginExposedFieldDecl (const Char8
*szFieldType
,
113 const UInt32 uiFieldTypeId
,
114 const Char8
*szFieldName
);
116 virtual void endExposedFieldDecl ( void);
119 /*---------------------------------------------------------------------*/
124 /*========================= PROTECTED ===============================*/
128 typedef BaseT Inherited
;
130 #if defined(_LIBCPP_VERSION)
132 OSG_STDEXTENSION_NAMESPACE::hash_map
<
134 VRMLNodeHelper
*> NameHelperMap
;
142 size_t operator()(const std::string
&s
) const
144 return OSG_STDEXTENSION_NAMESPACE::__stl_hash_string(s
.c_str());
149 # ifdef OSG_STL_HAS_HASH_MAP
150 # ifdef OSG_USE_HASH_COMPARE
152 OSG_STDEXTENSION_NAMESPACE::hash_map
<
155 HashCmpString
> NameHelperMap
;
158 OSG_STDEXTENSION_NAMESPACE::hash_map
<
161 string_hash
> NameHelperMap
;
165 std::map
<const std::string
,
166 VRMLNodeHelper
* > NameHelperMap
;
170 /*---------------------------------------------------------------------*/
174 /** The current helper that we are actively adding fields too and
177 VRMLNodeHelper
*_pCurrentHelper
;
179 /** Map from proto name to the helper to handle that proto type. */
180 NameHelperMap _mNodeHelperHash
;
183 VRMLNodeHelper
*findNodeHelper (const Char8
*szNodeTypename
);
185 virtual void preStandardProtos ( void);
186 virtual void postStandardProtos( void);
189 /*========================== PRIVATE ================================*/
192 /*!\brief prohibit default function (move to 'public' if needed) */
193 VRMLNodePrototypeHandler(const VRMLNodePrototypeHandler
&source
);
194 /*!\brief prohibit default function (move to 'public' if needed) */
195 void operator =(const VRMLNodePrototypeHandler
&source
);
200 #include "OSGVRMLPrototypeHandler.inl"
202 #endif /* _OSGVRMLPROTOTYPEHANDLER_H_ */