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 _OSGFIELDCONNECTORFACTORY_H_
40 #define _OSGFIELDCONNECTORFACTORY_H_
45 #include "OSGBaseTypes.h"
46 #include "OSGFactoryBase.h"
47 #include "OSGSingletonHolder.h"
48 //#include "OSGFieldDescriptionBase.h"
57 class BasicFieldConnector
;
59 /*! \ingroup GrpBaseField
60 \ingroup GrpLibOSGBase
63 class OSG_BASE_DLLMAPPING FieldConnectorFactoryBase
: public FactoryBase
65 /*========================== PUBLIC =================================*/
69 /*---------------------------------------------------------------------*/
70 /*! \name Destructor */
74 /*---------------------------------------------------------------------*/
78 BasicFieldConnector
*createConnector(
79 const FieldDescriptionBase
*pSrcDesc
,
81 const FieldDescriptionBase
*pDstDesc
,
85 /*---------------------------------------------------------------------*/
89 void registerConnector(const FieldType
&oSrcType
,
90 const FieldType
&oDstType
,
91 BasicFieldConnector
*pSrcToDst
,
92 BasicFieldConnector
*pDstToSrc
);
95 /*---------------------------------------------------------------------*/
100 /*========================= PROTECTED ===============================*/
104 typedef FactoryBase Inherited
;
106 typedef std::map
<UInt32
,
107 BasicFieldConnector
*> ConnectorMap
;
108 typedef std::map
<UInt32
,
109 BasicFieldConnector
*>::iterator ConnectorMapIt
;
110 typedef std::map
<UInt32
,
111 BasicFieldConnector
*>::const_iterator ConnectorMapConstIt
;
113 typedef std::map
<UInt32
,
114 ConnectorMap
*> EntryMap
;
115 typedef std::map
<UInt32
,
116 ConnectorMap
*>::iterator EntryMapIt
;
117 typedef std::map
<UInt32
,
118 ConnectorMap
*>::const_iterator EntryMapConstIt
;
120 EntryMap _mConnectorMap
;
122 /*---------------------------------------------------------------------*/
125 /*---------------------------------------------------------------------*/
126 /*! \name Constructors */
129 FieldConnectorFactoryBase(void);
130 virtual ~FieldConnectorFactoryBase(void);
133 /*---------------------------------------------------------------------*/
136 virtual bool initialize (void);
137 virtual bool terminate (void);
139 virtual bool initializePendingElements (void);
141 virtual bool initializeFactoryPost (void);
142 virtual bool initializePendingElementsFactoryPost(void);
145 /*========================== PRIVATE ================================*/
149 template <class SingletonT
>
150 friend class SingletonHolder
;
152 friend class FieldType
;
155 /*---------------------------------------------------------------------*/
157 /*!\brief prohibit default function (move to 'public' if needed) */
158 FieldConnectorFactoryBase(const FieldConnectorFactoryBase
&source
);
159 /*!\brief prohibit default function (move to 'public' if needed) */
160 void operator =(const FieldConnectorFactoryBase
&source
);
165 template class OSG_BASE_DLLMAPPING SingletonHolder
<FieldConnectorFactoryBase
>;
168 /*! \typedef OSG::SingletonHolder<OSG::FieldConnectorFactoryBase> FieldConnectorFactory;
169 \ingroup GrpBaseField
170 \relatesalso OSG::FieldConnectorFactoryBase
173 typedef OSG::SingletonHolder
<OSG::FieldConnectorFactoryBase
> FieldConnectorFactory
;
177 #endif /* _OSGFIELDCONNECTORFACTORY_H_ */