]> git.mxchange.org Git - simgear.git/blob - simgear/hla/RTIFederate.hxx
hla: Fix buffer overrun in SGMath vector types.
[simgear.git] / simgear / hla / RTIFederate.hxx
1 // Copyright (C) 2009 - 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 RTIFederate_hxx
19 #define RTIFederate_hxx
20
21 #include <string>
22 #include "simgear/structure/SGWeakReferenced.hxx"
23 #include "RTIInteractionClass.hxx"
24 #include "RTIObjectClass.hxx"
25 #include "RTIObjectInstance.hxx"
26
27 class SGTimeStamp;
28
29 namespace simgear {
30
31 class RTIFederate : public SGWeakReferenced {
32 public:
33     RTIFederate();
34     virtual ~RTIFederate();
35
36     /// Create a federation execution
37     /// Semantically this methods should be static,
38     enum FederationManagementResult {
39         FederationManagementSuccess,
40         FederationManagementFail,
41         FederationManagementFatal
42     };
43
44     virtual FederationManagementResult createFederationExecution(const std::string& federation, const std::string& objectModel) = 0;
45     virtual FederationManagementResult destroyFederationExecution(const std::string& federation) = 0;
46
47     /// Join with federateName the federation execution federation
48     virtual FederationManagementResult join(const std::string& federateType, const std::string& federation) = 0;
49     virtual bool resign() = 0;
50     virtual bool getJoined() const = 0;
51
52     /// Synchronization Point handling
53     virtual bool registerFederationSynchronizationPoint(const std::string& label, const RTIData& tag) = 0;
54     virtual bool getFederationSynchronizationPointAnnounced(const std::string& label) = 0;
55     virtual bool synchronizationPointAchieved(const std::string& label) = 0;
56     virtual bool getFederationSynchronized(const std::string& label) = 0;
57
58     /// Time management
59     virtual bool enableTimeConstrained() = 0;
60     virtual bool disableTimeConstrained() = 0;
61     virtual bool getTimeConstrainedEnabled() = 0;
62
63     virtual bool enableTimeRegulation(const SGTimeStamp& lookahead) = 0;
64     virtual bool disableTimeRegulation() = 0;
65     virtual bool modifyLookahead(const SGTimeStamp& timeStamp) = 0;
66     virtual bool getTimeRegulationEnabled() = 0;
67
68     virtual bool timeAdvanceRequest(const SGTimeStamp& fedTime) = 0;
69     virtual bool timeAdvanceRequestAvailable(const SGTimeStamp& timeStamp) = 0;
70     virtual bool flushQueueRequest(const SGTimeStamp& timeStamp) = 0;
71     virtual bool getTimeAdvancePending() = 0;
72
73     virtual bool queryFederateTime(SGTimeStamp& timeStamp) = 0;
74     virtual bool queryLookahead(SGTimeStamp& timeStamp) = 0;
75     virtual bool queryGALT(SGTimeStamp& timeStamp) = 0;
76     virtual bool queryLITS(SGTimeStamp& timeStamp) = 0;
77
78     /// Process messages
79     virtual bool processMessage() = 0;
80     virtual bool processMessages(const double& minimum, const double& maximum) = 0;
81
82     virtual RTIObjectClass* createObjectClass(const std::string& name, HLAObjectClass* hlaObjectClass) = 0;
83     virtual RTIInteractionClass* createInteractionClass(const std::string& name, HLAInteractionClass* interactionClass) = 0;
84
85     virtual RTIObjectInstance* getObjectInstance(const std::string& name) = 0;
86
87 private:
88     RTIFederate(const RTIFederate&);
89     RTIFederate& operator=(const RTIFederate&);
90 };
91
92 }
93
94 #endif