20 #include "msdevstudio/MSconfig.h"
58 mutable std::vector< std::string >
m_names;
75 void remove (
const std::string & name );
80 bool exists (
const std::string & name )
const;
94 const std::vector< std::string > &
names ()
const;
98 template <
class Type >
103 template<
class Type >
106 typename std::map < std::string, Type * > ::iterator first
108 for ( ; first != m_types.end(); ++first ) {
109 delete first->second;
115 template<
class Type >
118 const std::string & name = obj->name ();
122 template <
class Type >
125 remove (
const std::string & name )
127 typename std::map < std::string, Type * > ::iterator it
128 = m_types.find ( name );
129 if ( it != m_types.end () ) {
130 m_types.erase ( it );
134 template <
class Type >
136 exists (
const std::string & name )
const
140 typename std::map< std::string, Type * >::const_iterator it
141 = m_types.find ( name );
143 return it != m_types.end ();
147 template<
class Type >
152 typename std::map< std::string, Type * >::const_iterator it
153 = m_types.find ( name );
159 template<
class Type >
162 Type * obj = prototype ( name );
166 return obj->clone ();
169 template<
class Type >
173 typename std::map <std::string, Type *>::const_iterator it
175 for ( ; it != m_types.end (); ++it ) {
176 m_names.push_back ( it->first );
184 #endif // _Factory_H_