[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[certi-cvs] certi RTIG/Federate.hh RTIG/Federation.cc RTIG/...
From: |
certi-cvs |
Subject: |
[certi-cvs] certi RTIG/Federate.hh RTIG/Federation.cc RTIG/... |
Date: |
Mon, 09 Aug 2010 18:24:08 +0000 |
CVSROOT: /sources/certi
Module name: certi
Changes by: Eric NOULARD <erk> 10/08/09 18:24:07
Modified files:
RTIG : Federate.hh Federation.cc RTIG.cc RTIG.hh
RTIG_processing.cc Federate.cc
libCERTI : NM_Classes.hh M_Classes.hh M_Classes.cc
NetworkMessage.hh NM_Classes.cc
. : CMakeLists.txt
RTIA : TimeManagement.hh TimeManagement.cc
scripts : CERTI_NetworkMessage.msg
Log message:
Beginning of work for the NULL PRIME idea from Pierre [SIRON]
(to be continued)
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/certi/RTIG/Federate.hh?cvsroot=certi&r1=3.16&r2=3.17
http://cvs.savannah.gnu.org/viewcvs/certi/RTIG/Federation.cc?cvsroot=certi&r1=3.129&r2=3.130
http://cvs.savannah.gnu.org/viewcvs/certi/RTIG/RTIG.cc?cvsroot=certi&r1=3.64&r2=3.65
http://cvs.savannah.gnu.org/viewcvs/certi/RTIG/RTIG.hh?cvsroot=certi&r1=3.34&r2=3.35
http://cvs.savannah.gnu.org/viewcvs/certi/RTIG/RTIG_processing.cc?cvsroot=certi&r1=3.104&r2=3.105
http://cvs.savannah.gnu.org/viewcvs/certi/RTIG/Federate.cc?cvsroot=certi&r1=3.18&r2=3.19
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/NM_Classes.hh?cvsroot=certi&r1=3.22&r2=3.23
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/M_Classes.hh?cvsroot=certi&r1=3.13&r2=3.14
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/M_Classes.cc?cvsroot=certi&r1=3.13&r2=3.14
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/NetworkMessage.hh?cvsroot=certi&r1=3.65&r2=3.66
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/NM_Classes.cc?cvsroot=certi&r1=3.28&r2=3.29
http://cvs.savannah.gnu.org/viewcvs/certi/CMakeLists.txt?cvsroot=certi&r1=1.83&r2=1.84
http://cvs.savannah.gnu.org/viewcvs/certi/RTIA/TimeManagement.hh?cvsroot=certi&r1=3.23&r2=3.24
http://cvs.savannah.gnu.org/viewcvs/certi/RTIA/TimeManagement.cc?cvsroot=certi&r1=3.60&r2=3.61
http://cvs.savannah.gnu.org/viewcvs/certi/scripts/CERTI_NetworkMessage.msg?cvsroot=certi&r1=1.21&r2=1.22
Patches:
Index: RTIG/Federate.hh
===================================================================
RCS file: /sources/certi/certi/RTIG/Federate.hh,v
retrieving revision 3.16
retrieving revision 3.17
diff -u -b -r3.16 -r3.17
--- RTIG/Federate.hh 19 Nov 2009 18:15:29 -0000 3.16
+++ RTIG/Federate.hh 9 Aug 2010 18:24:07 -0000 3.17
@@ -16,7 +16,7 @@
// along with this program ; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// $Id: Federate.hh,v 3.16 2009/11/19 18:15:29 erk Exp $
+// $Id: Federate.hh,v 3.17 2010/08/09 18:24:07 erk Exp $
// ----------------------------------------------------------------------------
#ifndef CERTI_RTIG_FEDERATE_HH
@@ -46,6 +46,8 @@
bool isRegulator() const { return regulator ; };
void setConstrained(bool c) { constrained = c ; };
void setRegulator(bool r) { regulator = r ; };
+ void setIsUsingNERx(bool unx) { usingNERx = unx;};
+ const bool isUsingNERx() {return usingNERx;};
/**
* Sets the ClassRelevanceAdvisorySwitch of the federate to the value of
@@ -112,7 +114,11 @@
void setSaving(bool s) { saving = s ; };
void setRestoring(bool r) { restoring = r ; };
- void addSynchronizationLabel(const std::string&) throw (RTIinternalError);
+ /**
+ * Add a synchronization label to federate.
+ * @param[in] label the synchronization label to be added
+ */
+ void addSynchronizationLabel(const std::string& label) throw
(RTIinternalError);
void removeSynchronizationLabel(const std::string&) throw
(RTIinternalError);
bool isSynchronizationLabel(const std::string&) const ;
@@ -124,6 +130,16 @@
*/
bool regulator ;
bool constrained ; //!< = false by default.
+ /**
+ * If the federate is currently using NER or NERA in order to advance time.
+ * Initialized to be false.
+ * Will be set to true whenever NULL PRIME Message is received from
+ * the concerned federate (i.e. from its RTIA). Note that NULL PRIME
+ * message are sent iff federate has zero lookahead.
+ * Will be set to false whenever a NULL Message is received from
+ * the concerned federate.
+ */
+ bool usingNERx;
bool cras ; //!< = class relevance advisory switch -> true by default.
bool iras ; //!< = interaction relevance advisory siwtch -> true by
default.
@@ -141,4 +157,4 @@
#endif // CERTI_RTIG_FEDERATE_HH
-// $Id: Federate.hh,v 3.16 2009/11/19 18:15:29 erk Exp $
+// $Id: Federate.hh,v 3.17 2010/08/09 18:24:07 erk Exp $
Index: RTIG/Federation.cc
===================================================================
RCS file: /sources/certi/certi/RTIG/Federation.cc,v
retrieving revision 3.129
retrieving revision 3.130
diff -u -b -r3.129 -r3.130
--- RTIG/Federation.cc 31 May 2010 09:33:26 -0000 3.129
+++ RTIG/Federation.cc 9 Aug 2010 18:24:07 -0000 3.130
@@ -18,7 +18,7 @@
// along with this program ; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// $Id: Federation.cc,v 3.129 2010/05/31 09:33:26 erk Exp $
+// $Id: Federation.cc,v 3.130 2010/08/09 18:24:07 erk Exp $
// ----------------------------------------------------------------------------
#include <config.h>
@@ -734,7 +734,7 @@
msg.setDate(time);
this->broadcastAnyMessage(&msg, 0);
- }
+}
void
Federation::getFOM(NM_Join_Federation_Execution& objectModelData)
@@ -2009,7 +2009,7 @@
msg.setDate(time);
broadcastAnyMessage(&msg, federate_handle);
- }
+}
// ----------------------------------------------------------------------------
// isOwner (isAttributeOwnedByFederate)
@@ -2616,5 +2616,5 @@
}} // namespace certi/rtig
-// $Id: Federation.cc,v 3.129 2010/05/31 09:33:26 erk Exp $
+// $Id: Federation.cc,v 3.130 2010/08/09 18:24:07 erk Exp $
Index: RTIG/RTIG.cc
===================================================================
RCS file: /sources/certi/certi/RTIG/RTIG.cc,v
retrieving revision 3.64
retrieving revision 3.65
diff -u -b -r3.64 -r3.65
--- RTIG/RTIG.cc 23 Mar 2010 13:13:28 -0000 3.64
+++ RTIG/RTIG.cc 9 Aug 2010 18:24:07 -0000 3.65
@@ -18,7 +18,7 @@
// along with this program ; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// $Id: RTIG.cc,v 3.64 2010/03/23 13:13:28 erk Exp $
+// $Id: RTIG.cc,v 3.65 2010/08/09 18:24:07 erk Exp $
// ----------------------------------------------------------------------------
#include <config.h>
@@ -68,6 +68,12 @@
udpPort = atoi(udp_port_s);
federations.setVerboseLevel(verboseLevel);
+ /*
+ * Initialize NullPrimeTime to zero, this way
+ * when the first NULL Prime message is received
+ * NullPrimeTime will have a "true" initial value.
+ */
+ NullPrimeTime.setZero();
}
// ----------------------------------------------------------------------------
@@ -1036,4 +1042,4 @@
}} // namespace certi/rtig
-// $Id: RTIG.cc,v 3.64 2010/03/23 13:13:28 erk Exp $
+// $Id: RTIG.cc,v 3.65 2010/08/09 18:24:07 erk Exp $
Index: RTIG/RTIG.hh
===================================================================
RCS file: /sources/certi/certi/RTIG/RTIG.hh,v
retrieving revision 3.34
retrieving revision 3.35
diff -u -b -r3.34 -r3.35
--- RTIG/RTIG.hh 31 May 2010 09:33:26 -0000 3.34
+++ RTIG/RTIG.hh 9 Aug 2010 18:24:07 -0000 3.35
@@ -18,7 +18,7 @@
// along with this program ; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// $Id: RTIG.hh,v 3.34 2010/05/31 09:33:26 erk Exp $
+// $Id: RTIG.hh,v 3.35 2010/08/09 18:24:07 erk Exp $
// ----------------------------------------------------------------------------
#ifndef CERTI_RTIG_HH
@@ -84,6 +84,7 @@
void processSetTimeRegulating(Socket*, NM_Set_Time_Regulating *msg);
void processSetTimeConstrained(Socket*, NM_Set_Time_Constrained *msg);
void processMessageNull(NetworkMessage*);
+ void processMessageNullPrime(NM_Message_Null_Prime* msg);
void processRegisterSynchronization(Socket*,
NM_Register_Federation_Synchronization_Point*);
void processSynchronizationAchieved(Socket*, NetworkMessage*);
void processRequestFederationSave(Socket*, NetworkMessage*);
@@ -127,6 +128,7 @@
int tcpPort ;
int udpPort ;
int verboseLevel ;
+ FederationTime NullPrimeTime;
HandleManager<Handle> federationHandles ;
SocketTCP tcpSocketServer ;
SocketUDP udpSocketServer ;
@@ -143,4 +145,4 @@
#endif // CERTI_RTIG_HH
-// $Id: RTIG.hh,v 3.34 2010/05/31 09:33:26 erk Exp $
+// $Id: RTIG.hh,v 3.35 2010/08/09 18:24:07 erk Exp $
Index: RTIG/RTIG_processing.cc
===================================================================
RCS file: /sources/certi/certi/RTIG/RTIG_processing.cc,v
retrieving revision 3.104
retrieving revision 3.105
diff -u -b -r3.104 -r3.105
--- RTIG/RTIG_processing.cc 9 Aug 2010 14:51:45 -0000 3.104
+++ RTIG/RTIG_processing.cc 9 Aug 2010 18:24:07 -0000 3.105
@@ -18,7 +18,7 @@
// along with this program ; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// $Id: RTIG_processing.cc,v 3.104 2010/08/09 14:51:45 erk Exp $
+// $Id: RTIG_processing.cc,v 3.105 2010/08/09 18:24:07 erk Exp $
// ----------------------------------------------------------------------------
#include <config.h>
@@ -514,6 +514,29 @@
} catch (Exception &e) {}
}
+void
+RTIG::processMessageNullPrime(NM_Message_Null_Prime *msg)
+{
+ /* this is the first NULL PRIME message we receive */
+ if (NullPrimeTime.isZero()) {
+ NullPrimeTime = msg->getDate();
+ }
+
+ /*
+ * Update the NullPrimeDate of the concerned federate.
+ */
+
+ /*
+ * Now check whether if the RTIG should send
+ * an anonymous NULL message.
+ */
+ if (NullPrimeTime > msg->getDate()) {
+ NullPrimeTime = msg->getDate();
+ NM_Message_Null msg;
+ msg.setDate(NullPrimeTime);
+ }
+} /* end of processMessageNullPrime */
+
// ----------------------------------------------------------------------------
//! processRegisterSynchronization.
void
@@ -1506,4 +1529,4 @@
}} // namespace certi/rtig
-// $Id: RTIG_processing.cc,v 3.104 2010/08/09 14:51:45 erk Exp $
+// $Id: RTIG_processing.cc,v 3.105 2010/08/09 18:24:07 erk Exp $
Index: RTIG/Federate.cc
===================================================================
RCS file: /sources/certi/certi/RTIG/Federate.cc,v
retrieving revision 3.18
retrieving revision 3.19
diff -u -b -r3.18 -r3.19
--- RTIG/Federate.cc 24 Nov 2009 21:44:47 -0000 3.18
+++ RTIG/Federate.cc 9 Aug 2010 18:24:07 -0000 3.19
@@ -16,7 +16,7 @@
// along with this program ; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// $Id: Federate.cc,v 3.18 2009/11/24 21:44:47 erk Exp $
+// $Id: Federate.cc,v 3.19 2010/08/09 18:24:07 erk Exp $
// ----------------------------------------------------------------------------
#include <config.h>
@@ -35,7 +35,7 @@
//! A new FederateName is allocated. theLink must have been opened before.
Federate::Federate(const std::string& the_name, FederateHandle the_handle)
throw (RTIinternalError)
- : handle(the_handle), name(the_name), regulator(false), constrained(false),
+ : handle(the_handle), name(the_name), regulator(false),
constrained(false), usingNERx(false),
cras(true), iras(true), aras(false), asas(false),
saving(false), restoring(false)
{
@@ -43,8 +43,7 @@
throw RTIinternalError("Bad initialization parameter for Federate.");
}
-// ----------------------------------------------------------------------------
-//! Add a synchronization label to federate.
+
void
Federate::addSynchronizationLabel(const std::string& label)
throw (RTIinternalError)
@@ -84,4 +83,4 @@
}}
-// $Id: Federate.cc,v 3.18 2009/11/24 21:44:47 erk Exp $
+// $Id: Federate.cc,v 3.19 2010/08/09 18:24:07 erk Exp $
Index: libCERTI/NM_Classes.hh
===================================================================
RCS file: /sources/certi/certi/libCERTI/NM_Classes.hh,v
retrieving revision 3.22
retrieving revision 3.23
diff -u -b -r3.22 -r3.23
--- libCERTI/NM_Classes.hh 9 Aug 2010 14:51:45 -0000 3.22
+++ libCERTI/NM_Classes.hh 9 Aug 2010 18:24:07 -0000 3.23
@@ -1,4 +1,4 @@
-// Generated on 2010 August Mon, 09 at 16:30:13 by the CERTI message generator
+// Generated on 2010 August Mon, 09 at 18:13:03 by the CERTI message generator
#ifndef NM_CLASSES_HH
#define NM_CLASSES_HH
// ****-**** Global System includes ****-****
@@ -1805,6 +1805,23 @@
private:
};
+ class CERTI_EXPORT NM_Message_Null_Prime : public NetworkMessage {
+ public:
+ typedef NetworkMessage Super;
+ NM_Message_Null_Prime();
+ virtual ~NM_Message_Null_Prime();
+ virtual void serialize(libhla::MessageBuffer& msgBuffer);
+ virtual void deserialize(libhla::MessageBuffer& msgBuffer);
+ // specific Getter(s)/Setter(s)
+ const FederationTime& getTimestamp() const {return timestamp;}
+ void setTimestamp(const FederationTime& newTimestamp)
{timestamp=newTimestamp;}
+ // the show method
+ virtual std::ostream& show(std::ostream& out);
+ protected:
+ FederationTime timestamp;
+ private:
+ };
+
class CERTI_EXPORT New_NetworkMessage {
public:
New_NetworkMessage();
Index: libCERTI/M_Classes.hh
===================================================================
RCS file: /sources/certi/certi/libCERTI/M_Classes.hh,v
retrieving revision 3.13
retrieving revision 3.14
diff -u -b -r3.13 -r3.14
--- libCERTI/M_Classes.hh 9 Aug 2010 14:51:45 -0000 3.13
+++ libCERTI/M_Classes.hh 9 Aug 2010 18:24:07 -0000 3.14
@@ -1,4 +1,4 @@
-// Generated on 2010 August Mon, 09 at 16:30:14 by the CERTI message generator
+// Generated on 2010 August Mon, 09 at 18:13:03 by the CERTI message generator
#ifndef M_CLASSES_HH
#define M_CLASSES_HH
// ****-**** Global System includes ****-****
Index: libCERTI/M_Classes.cc
===================================================================
RCS file: /sources/certi/certi/libCERTI/M_Classes.cc,v
retrieving revision 3.13
retrieving revision 3.14
diff -u -b -r3.13 -r3.14
--- libCERTI/M_Classes.cc 9 Aug 2010 14:51:45 -0000 3.13
+++ libCERTI/M_Classes.cc 9 Aug 2010 18:24:07 -0000 3.14
@@ -1,4 +1,4 @@
-// Generated on 2010 August Mon, 09 at 16:30:14 by the CERTI message generator
+// Generated on 2010 August Mon, 09 at 18:13:03 by the CERTI message generator
#include <vector>
#include <string>
#include "M_Classes.hh"
Index: libCERTI/NetworkMessage.hh
===================================================================
RCS file: /sources/certi/certi/libCERTI/NetworkMessage.hh,v
retrieving revision 3.65
retrieving revision 3.66
diff -u -b -r3.65 -r3.66
--- libCERTI/NetworkMessage.hh 9 Aug 2010 14:51:45 -0000 3.65
+++ libCERTI/NetworkMessage.hh 9 Aug 2010 18:24:07 -0000 3.66
@@ -17,7 +17,7 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
-// $Id: NetworkMessage.hh,v 3.65 2010/08/09 14:51:45 erk Exp $
+// $Id: NetworkMessage.hh,v 3.66 2010/08/09 18:24:07 erk Exp $
// ----------------------------------------------------------------------------
#ifndef CERTI_NETWORK_MESSAGE_HH
@@ -149,6 +149,7 @@
RESERVE_OBJECT_INSTANCE_NAME, // HLA1516, only
RTIA->RTIG
RESERVE_OBJECT_INSTANCE_NAME_SUCCEEDED, //
HLA1516, only RTIG->RTIA
RESERVE_OBJECT_INSTANCE_NAME_FAILED, //
HLA1516, only RTIG->RTIA
+ MESSAGE_NULL_PRIME, // CERTI specific for
handling NER or NERA and zero-lk
LAST
} Message_T;
@@ -260,4 +261,4 @@
#endif // CERTI_NETWORK_MESSAGE_HH
-// $Id: NetworkMessage.hh,v 3.65 2010/08/09 14:51:45 erk Exp $
+// $Id: NetworkMessage.hh,v 3.66 2010/08/09 18:24:07 erk Exp $
Index: libCERTI/NM_Classes.cc
===================================================================
RCS file: /sources/certi/certi/libCERTI/NM_Classes.cc,v
retrieving revision 3.28
retrieving revision 3.29
diff -u -b -r3.28 -r3.29
--- libCERTI/NM_Classes.cc 9 Aug 2010 14:51:45 -0000 3.28
+++ libCERTI/NM_Classes.cc 9 Aug 2010 18:24:07 -0000 3.29
@@ -1,4 +1,4 @@
-// Generated on 2010 August Mon, 09 at 16:30:14 by the CERTI message generator
+// Generated on 2010 August Mon, 09 at 18:13:03 by the CERTI message generator
#include <vector>
#include <string>
#include "NM_Classes.hh"
@@ -2753,6 +2753,40 @@
NM_Reserve_Object_Instance_Name_Failed::~NM_Reserve_Object_Instance_Name_Failed()
{
}
+ NM_Message_Null_Prime::NM_Message_Null_Prime() {
+ this->messageName = "NM_Message_Null_Prime";
+ this->type = NetworkMessage::MESSAGE_NULL_PRIME;
+ //timestamp= <no default value in message spec using builtin>
+ }
+
+ NM_Message_Null_Prime::~NM_Message_Null_Prime() {
+ }
+
+ void NM_Message_Null_Prime::serialize(libhla::MessageBuffer& msgBuffer) {
+ //Call mother class
+ Super::serialize(msgBuffer);
+ //Specific serialization code
+ // FIXME FIXME FIXME
+ // don't know how to serialize native field <timestamp> of type
<FederationTime>
+ }
+
+ void NM_Message_Null_Prime::deserialize(libhla::MessageBuffer& msgBuffer) {
+ //Call mother class
+ Super::deserialize(msgBuffer);
+ //Specific deserialization code
+ // FIXME FIXME FIXME
+ // don't know how to deserialize native field <timestamp> of type
<FederationTime>
+ }
+
+ std::ostream& NM_Message_Null_Prime::show(std::ostream& out) {
+ out << "[NM_Message_Null_Prime -Begin]" << std::endl; //Call mother
class
+ Super::show(out);
+ //Specific show code
+ out << " timestamp = " << " //FIXME FIXME don't know how to
serialize native field <timestamp> of type <FederationTime>" << std::endl;
+ out << "[NM_Message_Null_Prime -End]" << std::endl;
+ return out;
+ }
+
New_NetworkMessage::New_NetworkMessage() {
type=0;
_hasDate=false;
@@ -3098,6 +3132,9 @@
case NetworkMessage::RESERVE_OBJECT_INSTANCE_NAME_FAILED:
msg = new NM_Reserve_Object_Instance_Name_Failed();
break;
+ case NetworkMessage::MESSAGE_NULL_PRIME:
+ msg = new NM_Message_Null_Prime();
+ break;
case NetworkMessage::LAST:
throw NetworkError("LAST message type should not be used!!");
break;
Index: CMakeLists.txt
===================================================================
RCS file: /sources/certi/certi/CMakeLists.txt,v
retrieving revision 1.83
retrieving revision 1.84
diff -u -b -r1.83 -r1.84
--- CMakeLists.txt 11 Jul 2010 15:16:17 -0000 1.83
+++ CMakeLists.txt 9 Aug 2010 18:24:07 -0000 1.84
@@ -434,6 +434,11 @@
INCLUDE(CPack)
INCLUDE(UsePackageBackup)
+
+# The UseRPMTools and UseDebian thing
+# are obsolete since CPack 2.6.0 which has
+# builtin support for RPM and DEB.
+# We may get rid of those sooner or later
INCLUDE(UseRPMTools)
IF(RPMTools_FOUND)
RPMTools_ADD_RPM_TARGETS(certi)
@@ -443,9 +448,8 @@
ADD_DEBIAN_TARGETS(certi)
ENDIF(DEBIAN_FOUND)
- ## Patch generating target
-# The custom target is using a cmake script which in turn
-# use execute_process,
+## Patch generating target
+# The custom target is using a cmake script which in turn use execute_process,
# this way we may find a flexible way to build the patch
ADD_CUSTOM_TARGET(patch
COMMAND ${CMAKE_COMMAND} -DWDIR:PATH=${CMAKE_SOURCE_DIR}
-DODIR:PATH=${CMAKE_BINARY_DIR} -P
${CMAKE_SOURCE_DIR}/scripts/CreatePatchCVS.cmake
Index: RTIA/TimeManagement.hh
===================================================================
RCS file: /sources/certi/certi/RTIA/TimeManagement.hh,v
retrieving revision 3.23
retrieving revision 3.24
diff -u -b -r3.23 -r3.24
--- RTIA/TimeManagement.hh 7 Mar 2010 18:23:40 -0000 3.23
+++ RTIA/TimeManagement.hh 9 Aug 2010 18:24:07 -0000 3.24
@@ -18,7 +18,7 @@
// along with this program ; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// $Id: TimeManagement.hh,v 3.23 2010/03/07 18:23:40 erk Exp $
+// $Id: TimeManagement.hh,v 3.24 2010/08/09 18:24:07 erk Exp $
// ----------------------------------------------------------------------------
#ifndef CERTI_RTIA_TIME_MANAGEMENT_HH
@@ -123,6 +123,7 @@
void flushQueueRequest(FederationTime, TypeException &);
bool executeFederateService(NetworkMessage &msg);
void sendNullMessage(FederationTime heure_logique);
+ void sendNullPrimeMessage(FederationTime heure_logique);
void timeRegulationEnabled(FederationTime, TypeException &e);
void timeConstrainedEnabled(FederationTime, TypeException &e);
@@ -136,6 +137,7 @@
/// Federate State
FederationTime lastNullMessageDate ;
+ FederationTime lastNullPrimeMessageDate;
/// Type/date from last request (timeAdvance, nextEvent, flushQueue)
TypeAvancee _avancee_en_cours ;
@@ -154,4 +156,4 @@
#endif // CERTI_RTIA_TIME_MANAGEMENT_HH
-// $Id: TimeManagement.hh,v 3.23 2010/03/07 18:23:40 erk Exp $
+// $Id: TimeManagement.hh,v 3.24 2010/08/09 18:24:07 erk Exp $
Index: RTIA/TimeManagement.cc
===================================================================
RCS file: /sources/certi/certi/RTIA/TimeManagement.cc,v
retrieving revision 3.60
retrieving revision 3.61
diff -u -b -r3.60 -r3.61
--- RTIA/TimeManagement.cc 9 Aug 2010 14:51:45 -0000 3.60
+++ RTIA/TimeManagement.cc 9 Aug 2010 18:24:07 -0000 3.61
@@ -18,7 +18,7 @@
// along with this program ; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// $Id: TimeManagement.cc,v 3.60 2010/08/09 14:51:45 erk Exp $
+// $Id: TimeManagement.cc,v 3.61 2010/08/09 18:24:07 erk Exp $
// ----------------------------------------------------------------------------
#include <config.h>
@@ -120,6 +120,33 @@
}
}
+void TimeManagement::sendNullPrimeMessage(FederationTime heure_logique)
+{
+ NM_Message_Null_Prime msg ;
+
+ msg.setDate(heure_logique);
+
+ /*
+ * We cannot send null prime in the past of
+ * - the last NULL message
+ * - the last NULL PRIME message
+ */
+
+ if ((heure_logique > lastNullMessageDate) || (heure_logique >
lastNullPrimeMessageDate)) {
+ msg.setFederation(fm->_numero_federation);
+ msg.setFederate(fm->federate);
+ msg.setDate(heure_logique) ; // ? See 6 lines upper !
+
+ comm->sendMessage(&msg);
+ lastNullPrimeMessageDate = heure_logique ;
+ D.Out(pdDebug, "NULL PRIME message sent (Time = %f).",
heure_logique.getTime()) ;
+ }
+ else {
+ D.Out(pdExcept, "NULL PRIME message not sent (Time = %f, Last NULL=
%f, Last NULL PRIME = %f).",
+ heure_logique.getTime(), lastNullMessageDate.getTime(),
lastNullPrimeMessageDate.getTime());
+ }
+}
+
// ----------------------------------------------------------------------------
//! Deliver TSO messages to federate (UAV, ReceiveInteraction, etc...).
bool
@@ -1028,4 +1055,4 @@
}} // namespaces
-// $Id: TimeManagement.cc,v 3.60 2010/08/09 14:51:45 erk Exp $
+// $Id: TimeManagement.cc,v 3.61 2010/08/09 18:24:07 erk Exp $
Index: scripts/CERTI_NetworkMessage.msg
===================================================================
RCS file: /sources/certi/certi/scripts/CERTI_NetworkMessage.msg,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -b -r1.21 -r1.22
--- scripts/CERTI_NetworkMessage.msg 9 Aug 2010 14:51:45 -0000 1.21
+++ scripts/CERTI_NetworkMessage.msg 9 Aug 2010 18:24:07 -0000 1.22
@@ -545,6 +545,10 @@
message NM_Reserve_Object_Instance_Name_Failed : merge
NM_Reserve_Object_Instance_Name {
}
+message NM_Message_Null_Prime : merge NetworkMessage {
+ required FederationTime timestamp
+}
+
message New_NetworkMessage {
required uint32 type {default=0}
//required string name {default="MessageBaseClass"}
@@ -553,8 +557,6 @@
optional string tag
}
-
-
native NMStreamType {
language CXX [typedef Socket* NMStreamType;]
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [certi-cvs] certi RTIG/Federate.hh RTIG/Federation.cc RTIG/...,
certi-cvs <=