]> git.mxchange.org Git - simgear.git/blob - simgear/hla/RTI13Federate.hxx
Move the decision which rti to use into HLAFederate.
[simgear.git] / simgear / hla / RTI13Federate.hxx
1 // Copyright (C) 2009 - 2010  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 RTI13Federate_hxx
19 #define RTI13Federate_hxx
20
21 #ifndef RTI_USES_STD_FSTREAM
22 #define RTI_USES_STD_FSTREAM
23 #endif
24
25 #include <RTI.hh>
26
27 #include "RTIFederate.hxx"
28 #include "RTI13ObjectClass.hxx"
29 #include "RTI13ObjectInstance.hxx"
30
31 namespace simgear {
32
33 class RTI13Ambassador;
34
35 class RTI13Federate : public RTIFederate {
36 public:
37     RTI13Federate(const std::list<std::string>& stringList);
38     virtual ~RTI13Federate();
39
40     virtual bool createFederationExecution(const std::string& federation, const std::string& objectModel);
41     virtual bool destroyFederationExecution(const std::string& federation);
42
43     /// Join with federateName the federation execution federation
44     virtual bool join(const std::string& federateType, const std::string& federation);
45     virtual bool resign();
46
47     /// Synchronization Point handling
48     virtual bool registerFederationSynchronizationPoint(const std::string& label, const RTIData& tag);
49     virtual bool waitForFederationSynchronizationPointAnnounced(const std::string& label);
50     virtual bool synchronizationPointAchieved(const std::string& label);
51     virtual bool waitForFederationSynchronized(const std::string& label);
52
53     /// Time management
54     virtual bool enableTimeConstrained();
55     virtual bool disableTimeConstrained();
56
57     virtual bool enableTimeRegulation(const SGTimeStamp& lookahead);
58     virtual bool disableTimeRegulation();
59
60     virtual bool timeAdvanceRequestBy(const SGTimeStamp& dt);
61     virtual bool timeAdvanceRequest(const SGTimeStamp& fedTime);
62
63     virtual bool queryFederateTime(SGTimeStamp& timeStamp);
64     virtual bool modifyLookahead(const SGTimeStamp& timeStamp);
65     virtual bool queryLookahead(SGTimeStamp& timeStamp);
66
67     /// Process messages
68     virtual bool tick();
69     virtual bool tick(const double& minimum, const double& maximum);
70
71     virtual RTI13ObjectClass* createObjectClass(const std::string& name, HLAObjectClass* hlaObjectClass);
72
73     virtual RTI13ObjectInstance* getObjectInstance(const std::string& name);
74
75 private:
76     RTI13Federate(const RTI13Federate&);
77     RTI13Federate& operator=(const RTI13Federate&);
78
79     /// The federate handle
80     RTI::FederateHandle _federateHandle;
81
82     /// The timeout for the single callback tick function in
83     /// syncronous operations that need to wait for a callback
84     double _tickTimeout;
85
86     /// RTI connection
87     SGSharedPtr<RTI13Ambassador> _ambassador;
88 };
89
90 }
91
92 #endif