1 // Copyright (C) 2011 - 2012 Mathias Froehlich - Mathias.Froehlich@web.de
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Library General Public
5 // License as published by the Free Software Foundation; either
6 // version 2 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Library General Public License for more details.
13 // You should have received a copy of the GNU General Public License
14 // along with this program; if not, write to the Free Software
15 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 #ifndef RTIFederateFactoryRegistry_hxx
19 #define RTIFederateFactoryRegistry_hxx
23 #include "simgear/structure/SGReferenced.hxx"
24 #include "simgear/structure/SGSharedPtr.hxx"
25 #include "RTIFederateFactory.hxx"
27 #include "simgear/threads/SGThread.hxx"
31 class RTIFederateFactoryRegistry : public SGReferenced {
33 ~RTIFederateFactoryRegistry();
35 SGSharedPtr<RTIFederate> create(const std::string& name, const std::list<std::string>& stringList) const;
37 void registerFactory(RTIFederateFactory* factory);
39 static const SGSharedPtr<RTIFederateFactoryRegistry>& instance();
42 RTIFederateFactoryRegistry();
44 RTIFederateFactoryRegistry(const RTIFederateFactoryRegistry&);
45 RTIFederateFactoryRegistry& operator=(const RTIFederateFactoryRegistry&);
47 mutable SGMutex _mutex;
48 typedef std::list<SGSharedPtr<RTIFederateFactory> > FederateFactoryList;
49 FederateFactoryList _federateFactoryList;