]> git.mxchange.org Git - simgear.git/blobdiff - simgear/hla/RTIFederate.hxx
hla: add missing file fir the last commit.
[simgear.git] / simgear / hla / RTIFederate.hxx
index 4b5d2d83c20b4c40a27f2afdf0d2ebd2b149eff7..94d692b0d87917c714613e8b4639e6f17abe3f53 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2009 - 2010  Mathias Froehlich - Mathias.Froehlich@web.de
+// Copyright (C) 2009 - 2011  Mathias Froehlich - Mathias.Froehlich@web.de
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Library General Public
@@ -32,63 +32,59 @@ public:
     RTIFederate();
     virtual ~RTIFederate();
 
-    /// Get the name of the joined federate/federation
-    const std::string& getFederateType() const
-    { return _federateType; }
-    const std::string& getFederationName() const
-    { return _federationName; }
-
     /// Create a federation execution
     /// Semantically this methods should be static,
-    /// but the nonstatic case could reuse the connection to the server
-    /// FIXME: cannot determine from the return value if we created the execution
-    virtual bool createFederationExecution(const std::string& federation, const std::string& objectModel) = 0;
-    virtual bool destroyFederationExecution(const std::string& federation) = 0;
+    enum FederationManagementResult {
+        FederationManagementSuccess,
+        FederationManagementFail,
+        FederationManagementFatal
+    };
+
+    virtual FederationManagementResult createFederationExecution(const std::string& federation, const std::string& objectModel) = 0;
+    virtual FederationManagementResult destroyFederationExecution(const std::string& federation) = 0;
 
     /// Join with federateName the federation execution federation
-    virtual bool join(const std::string& federateType, const std::string& federation) = 0;
+    virtual FederationManagementResult join(const std::string& federateType, const std::string& federation) = 0;
     virtual bool resign() = 0;
+    virtual bool getJoined() const = 0;
 
     /// Synchronization Point handling
     virtual bool registerFederationSynchronizationPoint(const std::string& label, const RTIData& tag) = 0;
-    virtual bool waitForFederationSynchronizationPointAnnounced(const std::string& label) = 0;
+    virtual bool getFederationSynchronizationPointAnnounced(const std::string& label) = 0;
     virtual bool synchronizationPointAchieved(const std::string& label) = 0;
-    virtual bool waitForFederationSynchronized(const std::string& label) = 0;
+    virtual bool getFederationSynchronized(const std::string& label) = 0;
 
     /// Time management
     virtual bool enableTimeConstrained() = 0;
     virtual bool disableTimeConstrained() = 0;
+    virtual bool getTimeConstrainedEnabled() = 0;
 
     virtual bool enableTimeRegulation(const SGTimeStamp& lookahead) = 0;
     virtual bool disableTimeRegulation() = 0;
+    virtual bool modifyLookahead(const SGTimeStamp& timeStamp) = 0;
+    virtual bool getTimeRegulationEnabled() = 0;
 
-    virtual bool timeAdvanceRequestBy(const SGTimeStamp& dt) = 0;
     virtual bool timeAdvanceRequest(const SGTimeStamp& fedTime) = 0;
+    virtual bool timeAdvanceRequestAvailable(const SGTimeStamp& timeStamp) = 0;
+    virtual bool getTimeAdvancePending() = 0;
+
+    virtual bool queryFederateTime(SGTimeStamp& timeStamp) = 0;
+    virtual bool queryLookahead(SGTimeStamp& timeStamp) = 0;
+    virtual bool queryGALT(SGTimeStamp& timeStamp) = 0;
+    virtual bool queryLITS(SGTimeStamp& timeStamp) = 0;
 
     /// Process messages
-    virtual bool tick() = 0;
-    virtual bool tick(const double& minimum, const double& maximum) = 0;
+    virtual bool processMessage() = 0;
+    virtual bool processMessages(const double& minimum, const double& maximum) = 0;
 
     virtual RTIObjectClass* createObjectClass(const std::string& name, HLAObjectClass* hlaObjectClass) = 0;
     // virtual RTIInteractionClass* createInteractionClass(const std::string& name) = 0;
 
     virtual RTIObjectInstance* getObjectInstance(const std::string& name) = 0;
 
-protected:
-    void setFederateType(const std::string& federateType)
-    { _federateType = federateType; }
-    void setFederationName(const std::string& federationName)
-    { _federationName = federationName; }
-
 private:
     RTIFederate(const RTIFederate&);
     RTIFederate& operator=(const RTIFederate&);
-
-    /// The federates name
-    std::string _federateType;
-
-    /// The federation execution name
-    std::string _federationName;
 };
 
 }