]> git.mxchange.org Git - simgear.git/blob - simgear/hla/RTIFederateFactoryRegistry.hxx
hla: Remove deprecated methods from HLAObjectClass
[simgear.git] / simgear / hla / RTIFederateFactoryRegistry.hxx
1 // Copyright (C) 2011 - 2012  Mathias Froehlich - Mathias.Froehlich@web.de
2 //
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.
7 //
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.
12 //
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.
16 //
17
18 #ifndef RTIFederateFactoryRegistry_hxx
19 #define RTIFederateFactoryRegistry_hxx
20
21 #include <list>
22 #include <string>
23 #include "simgear/structure/SGReferenced.hxx"
24 #include "simgear/structure/SGSharedPtr.hxx"
25 #include "RTIFederateFactory.hxx"
26
27 #include "simgear/threads/SGThread.hxx"
28
29 namespace simgear {
30
31 class RTIFederateFactoryRegistry : public SGReferenced {
32 public:
33     ~RTIFederateFactoryRegistry();
34
35     SGSharedPtr<RTIFederate> create(const std::string& name, const std::list<std::string>& stringList) const;
36
37     void registerFactory(RTIFederateFactory* factory);
38
39     static const SGSharedPtr<RTIFederateFactoryRegistry>& instance();
40
41 private:
42     RTIFederateFactoryRegistry();
43
44     RTIFederateFactoryRegistry(const RTIFederateFactoryRegistry&);
45     RTIFederateFactoryRegistry& operator=(const RTIFederateFactoryRegistry&);
46
47     mutable SGMutex _mutex;
48     typedef std::list<SGSharedPtr<RTIFederateFactory> > FederateFactoryList;
49     FederateFactoryList _federateFactoryList;
50 };
51
52 }
53
54 #endif