fixed: auto_ptr -> unique_ptr
[opensg.git] / Source / Base / FieldContainer / Connector / OSGFieldConnectorFactory.h
blob918d0dfd752d48656a1f619b2590b6779126f864
1 /*---------------------------------------------------------------------------*\
2 * OpenSG *
3 * *
4 * *
5 * Copyright (C) 2000-2002 by the OpenSG Forum *
6 * *
7 * www.opensg.org *
8 * *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de *
10 * *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
13 * License *
14 * *
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. *
18 * *
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. *
23 * *
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. *
27 * *
28 \*---------------------------------------------------------------------------*/
29 /*---------------------------------------------------------------------------*\
30 * Changes *
31 * *
32 * *
33 * *
34 * *
35 * *
36 * *
37 \*---------------------------------------------------------------------------*/
39 #ifndef _OSGFIELDCONNECTORFACTORY_H_
40 #define _OSGFIELDCONNECTORFACTORY_H_
41 #ifdef __sgi
42 #pragma once
43 #endif
45 #include "OSGBaseTypes.h"
46 #include "OSGFactoryBase.h"
47 #include "OSGSingletonHolder.h"
48 //#include "OSGFieldDescriptionBase.h"
50 #include <map>
51 #include <vector>
53 OSG_BEGIN_NAMESPACE
55 class Field;
56 class FieldType;
57 class BasicFieldConnector;
59 /*! \ingroup GrpBaseField
60 \ingroup GrpLibOSGBase
63 class OSG_BASE_DLLMAPPING FieldConnectorFactoryBase : public FactoryBase
65 /*========================== PUBLIC =================================*/
67 public:
69 /*---------------------------------------------------------------------*/
70 /*! \name Destructor */
71 /*! \{ */
73 /*! \} */
74 /*---------------------------------------------------------------------*/
75 /*! \name Create */
76 /*! \{ */
78 BasicFieldConnector *createConnector(
79 const FieldDescriptionBase *pSrcDesc,
80 const Field *pSrc,
81 const FieldDescriptionBase *pDstDesc,
82 Field *pDst ) const;
84 /*! \} */
85 /*---------------------------------------------------------------------*/
86 /*! \name Get */
87 /*! \{ */
89 void registerConnector(const FieldType &oSrcType,
90 const FieldType &oDstType,
91 BasicFieldConnector *pSrcToDst,
92 BasicFieldConnector *pDstToSrc);
94 /*! \} */
95 /*---------------------------------------------------------------------*/
96 /*! \name The */
97 /*! \{ */
99 /*! \} */
100 /*========================= PROTECTED ===============================*/
102 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 /*---------------------------------------------------------------------*/
123 /* Member */
125 /*---------------------------------------------------------------------*/
126 /*! \name Constructors */
127 /*! \{ */
129 FieldConnectorFactoryBase(void);
130 virtual ~FieldConnectorFactoryBase(void);
132 /*! \} */
133 /*---------------------------------------------------------------------*/
134 /* Member */
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);
144 /*! \} */
145 /*========================== PRIVATE ================================*/
147 private:
149 template <class SingletonT>
150 friend class SingletonHolder;
152 friend class FieldType;
153 friend class Field;
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);
163 #if defined(WIN32)
164 OSG_BASE_EXPIMP_TMPL
165 template class OSG_BASE_DLLMAPPING SingletonHolder<FieldConnectorFactoryBase>;
166 #endif
168 /*! \typedef OSG::SingletonHolder<OSG::FieldConnectorFactoryBase> FieldConnectorFactory;
169 \ingroup GrpBaseField
170 \relatesalso OSG::FieldConnectorFactoryBase
173 typedef OSG::SingletonHolder<OSG::FieldConnectorFactoryBase> FieldConnectorFactory;
175 OSG_END_NAMESPACE
177 #endif /* _OSGFIELDCONNECTORFACTORY_H_ */