Index: libCERTI/PrettyDebug.hh
===================================================================
RCS file: /sources/certi/certi/libCERTI/PrettyDebug.hh,v
retrieving revision 4.4
diff -u -r4.4 PrettyDebug.hh
--- libCERTI/PrettyDebug.hh	9 Aug 2007 09:22:45 -0000	4.4
+++ libCERTI/PrettyDebug.hh	2 Apr 2009 19:56:32 -0000
@@ -19,7 +19,7 @@
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
 // USA
 //
-// $Id: PrettyDebug.hh,v 4.4 2007/08/09 09:22:45 rousse Exp $
+// $Id: PrettyDebug.hh,v 4.4.8.1 2009/02/10 18:25:15 erk Exp $
 // ----------------------------------------------------------------------------
 
 #ifndef PRETTYDEBUG_HH
@@ -131,7 +131,8 @@
     inline void Out(pdDebugLevel Level, const char *Format, ...) {};
 #else
 	void Out(pdDebugLevel Level, const char *Format, ...);
-	void Mes(pdDebugLevel Level, const char type, const short testMess, const char *context);
+	void Mes(pdDebugLevel Level, const char type, const short testMess, const char *context);
+
 #endif
 
 };
@@ -142,4 +143,4 @@
 
 #endif // PRETTYDEBUG_HH
 
-// $Id: PrettyDebug.hh,v 4.4 2007/08/09 09:22:45 rousse Exp $
+// $Id: PrettyDebug.hh,v 4.4.8.1 2009/02/10 18:25:15 erk Exp $
Index: libCERTI/GAV.hh
===================================================================
RCS file: /sources/certi/certi/libCERTI/GAV.hh,v
retrieving revision 3.13
diff -u -r3.13 GAV.hh
--- libCERTI/GAV.hh	7 Dec 2008 20:16:13 -0000	3.13
+++ libCERTI/GAV.hh	2 Apr 2009 19:56:32 -0000
@@ -27,7 +27,7 @@
 
 namespace certi {
 
-class AttributeHandleSet
+class CERTI_EXPORT AttributeHandleSet
     : public std::list<AttributeHandle>
 {
 public:
@@ -47,8 +47,8 @@
 
     virtual void empty();
 
-    virtual RTI::Boolean isEmpty() const ;
-    virtual RTI::Boolean isMember(AttributeHandle h) const ;
+    virtual bool isEmpty() const ;
+    virtual bool isMember(AttributeHandle h) const ;
 };
 
 class FederateHandleSet : public std::list<FederateHandle>
@@ -70,7 +70,7 @@
 
     virtual void empty();
 
-    virtual RTI::Boolean isMember(FederateHandle h) const ;
+    virtual bool isMember(FederateHandle h) const ;
 };
 
 class AttributeHandleValuePair
@@ -118,9 +118,6 @@
     virtual OrderType getOrderType(ULong i) const
         throw (ArrayIndexOutOfBounds, InvalidHandleValuePairSetContext);
 
-    virtual RTI::Region *getRegion(ULong i) const
-        throw (ArrayIndexOutOfBounds, InvalidHandleValuePairSetContext);
-
     virtual void add(Handle h, const char *buff, ULong valueLength)
         throw (ValueLengthExceeded, ValueCountExceeded);
     virtual void remove(Handle h) throw (ArrayIndexOutOfBounds);
@@ -174,9 +171,6 @@
     virtual OrderType getOrderType() const
         throw (InvalidHandleValuePairSetContext);
 
-    virtual RTI::Region *getRegion() const
-        throw (InvalidHandleValuePairSetContext);
-
     virtual void add(Handle h, const char *buff, ULong valueLength)
         throw (ValueLengthExceeded, ValueCountExceeded);
 
Index: libCERTI/Message.cc
===================================================================
RCS file: /sources/certi/certi/libCERTI/Message.cc,v
retrieving revision 3.62
diff -u -r3.62 Message.cc
--- libCERTI/Message.cc	7 Dec 2008 20:16:14 -0000	3.62
+++ libCERTI/Message.cc	2 Apr 2009 19:56:32 -0000
@@ -197,23 +197,23 @@
     @param the_time federation time
 */
 void
-Message::setFedTime(const RTI::FedTime &the_time)
+Message::setFedTime(const double the_time)
 {
-    fed_time = dynamic_cast<const RTIfedTime &>(the_time);
+    fed_time = the_time;
 }
 
 // ----------------------------------------------------------------------------
 void
-Message::setLookahead(const RTI::FedTime& the_lookahead)
+Message::setLookahead(const double the_lookahead)
 {
-    lookahead = (FederationTimeDelta) ((RTIfedTime&) the_lookahead).getTime();
+    lookahead = the_lookahead;
 }
 
 // ----------------------------------------------------------------------------
 void
 Message::setFederationTime(FederationTime the_time)
 {
-    fed_time = RTIfedTime(the_time);
+    fed_time = the_time;
 }
 
 // ----------------------------------------------------------------------------
@@ -238,14 +238,14 @@
 
 // ----------------------------------------------------------------------------
 void
-Message::setTransportation(RTI::TransportationHandle the_transport)
+Message::setTransportation(TransportType the_transport)
 {
     transport = the_transport;
 }
 
 // ----------------------------------------------------------------------------
 void
-Message::setOrdering(RTI::OrderingHandle the_ordering)
+Message::setOrdering(OrderType the_ordering)
 {
     order = the_ordering;
 }
Index: libCERTI/NetworkMessage.hh
===================================================================
RCS file: /sources/certi/certi/libCERTI/NetworkMessage.hh,v
retrieving revision 3.44
diff -u -r3.44 NetworkMessage.hh
--- libCERTI/NetworkMessage.hh	20 Nov 2008 18:21:56 -0000	3.44
+++ libCERTI/NetworkMessage.hh	2 Apr 2009 19:56:32 -0000
@@ -23,7 +23,7 @@
 #ifndef CERTI_NETWORK_MESSAGE_HH
 #define CERTI_NETWORK_MESSAGE_HH
 
-#include "fedtime.hh"
+#include "FedTimeD.hh"
 #include "Exception.hh"
 #include "Socket.hh"
 #include "RTIRegion.hh"
Index: libCERTI/Message_W.cc
===================================================================
RCS file: /sources/certi/certi/libCERTI/Message_W.cc,v
retrieving revision 3.39
diff -u -r3.39 Message_W.cc
--- libCERTI/Message_W.cc	21 Nov 2008 12:45:25 -0000	3.39
+++ libCERTI/Message_W.cc	2 Apr 2009 19:56:32 -0000
@@ -17,7 +17,7 @@
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
 // USA
 //
-// $Id: Message_W.cc,v 3.39 2008/11/21 12:45:25 approx Exp $
+// $Id: Message_W.cc,v 3.39.4.1 2009/01/05 13:34:51 gotthardp Exp $
 // ----------------------------------------------------------------------------
 
 
@@ -494,7 +494,7 @@
           case ENABLE_TIME_CONSTRAINED:
           case DISABLE_TIME_CONSTRAINED:
             msgBuffer.write_bool(boolean);
-            msgBuffer.write_double(lookahead);
+            msgBuffer.write_double(lookahead.getTime());
             break ;
 
 	  // Body contains boolean
@@ -527,7 +527,7 @@
           case MODIFY_LOOKAHEAD:
           case QUERY_LOOKAHEAD:
             // we put another time but is the lookahead
-	    msgBuffer.write_double(lookahead) ;
+	    msgBuffer.write_double(lookahead.getTime());
             break ;
             // -- Default Handler --
 
@@ -564,7 +564,7 @@
     // Note sometimes federationTime is not useful.
     msgBuffer.write_int32(this->type) ;
     msgBuffer.write_int32(this->exception);
-    msgBuffer.write_double(getFederationTime());
+    msgBuffer.write_double(getFederationTime().getTime());
 
     // If the message carry an exception, the Body will only contain the
     // exception reason.
@@ -609,4 +609,4 @@
 
 } // namespace certi
 
-// $Id: Message_W.cc,v 3.39 2008/11/21 12:45:25 approx Exp $
+// $Id: Message_W.cc,v 3.39.4.1 2009/01/05 13:34:51 gotthardp Exp $
Index: libCERTI/GAV.cc
===================================================================
RCS file: /sources/certi/certi/libCERTI/GAV.cc,v
retrieving revision 3.18
diff -u -r3.18 GAV.cc
--- libCERTI/GAV.cc	7 Dec 2008 20:16:13 -0000	3.18
+++ libCERTI/GAV.cc	2 Apr 2009 19:56:32 -0000
@@ -16,7 +16,7 @@
 // License along with this program ; if not, write to the Free Software
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 //
-// $Id: GAV.cc,v 3.18 2008/12/07 20:16:13 gotthardp Exp $
+// $Id: GAV.cc,v 3.18.4.1 2009/01/05 13:34:51 gotthardp Exp $
 // ----------------------------------------------------------------------------
 
 #include "GAV.hh"
@@ -159,14 +159,6 @@
 }
 
 // ----------------------------------------------------------------------------
-RTI::Region *
-AttributeHandleValuePairSet::getRegion(ULong) const
-    throw (ArrayIndexOutOfBounds, InvalidHandleValuePairSetContext)
-{
-    throw RTIinternalError("Unimplemented service");
-}
-
-// ----------------------------------------------------------------------------
 void
 AttributeHandleValuePairSet::add(Handle h,
                                     const char *buff,
@@ -286,7 +278,7 @@
 AttributeHandleSet::remove(AttributeHandle h)
     throw (AttributeNotDefined)// not guaranteed safe while iterating
 {
-    if (isMember(h) == RTI::RTI_TRUE)
+    if (isMember(h) == true)
         list<AttributeHandle>::remove(h);
     else
         throw AttributeNotDefined("");
@@ -300,17 +292,17 @@
 }
 
 // ----------------------------------------------------------------------------
-RTI::Boolean
+bool
 AttributeHandleSet::isEmpty() const
 {
-    return RTI::Boolean(list<AttributeHandle>::empty());
+    return list<AttributeHandle>::empty();
 }
 
 // ----------------------------------------------------------------------------
-RTI::Boolean
+bool
 AttributeHandleSet::isMember(AttributeHandle h) const
 {
-    return RTI::Boolean(find(begin(), end(), h) != end());
+    return find(begin(), end(), h) != end();
 }
 
 // ----------------------------------------------------------------------------
@@ -356,7 +348,7 @@
 FederateHandleSet::remove(FederateHandle h)
     throw (ArrayIndexOutOfBounds)
 {
-    if (isMember(h) == RTI::RTI_TRUE)
+    if (isMember(h) == true)
         list<FederateHandle>::remove(h);
     else
         throw AttributeNotDefined("");
@@ -370,10 +362,10 @@
 }
 
 // ----------------------------------------------------------------------------
-RTI::Boolean
+bool
 FederateHandleSet::isMember(FederateHandle h) const
 {
-    return RTI::Boolean(find(begin(), end(), h) != end());
+    return find(begin(), end(), h) != end();
 }
 
 // ----------------------------------------------------------------------------
@@ -499,14 +491,6 @@
 }
 
 // ----------------------------------------------------------------------------
-RTI::Region *
-ParameterHandleValuePairSet::getRegion() const
-    throw (InvalidHandleValuePairSetContext)
-{
-    throw RTIinternalError("Unimplemented service");
-}
-
-// ----------------------------------------------------------------------------
 void
 ParameterHandleValuePairSet::add(Handle h,
                                     const char *buff,
@@ -581,5 +565,5 @@
 
 } // namespace certi
 
-// $Id: GAV.cc,v 3.18 2008/12/07 20:16:13 gotthardp Exp $
+// $Id: GAV.cc,v 3.18.4.1 2009/01/05 13:34:51 gotthardp Exp $
 
Index: libCERTI/Message.hh
===================================================================
RCS file: /sources/certi/certi/libCERTI/Message.hh,v
retrieving revision 3.54
diff -u -r3.54 Message.hh
--- libCERTI/Message.hh	7 Dec 2008 20:16:14 -0000	3.54
+++ libCERTI/Message.hh	2 Apr 2009 19:56:32 -0000
@@ -26,7 +26,7 @@
 #include "SocketUN.hh"
 #include "BasicMessage.hh"
 #include "GAV.hh"
-#include "fedtime.hh"
+#include "FedTimeD.hh"
 
 #include <vector>
 #include <string>
@@ -327,10 +327,10 @@
     void setResignAction(RTI::ResignAction);
     RTI::ResignAction getResignAction() const { return resignAction ; };
 
-    void setFedTime(const RTI::FedTime&);
-    const RTI::FedTime& getFedTime() const { return fed_time; };
+    void setFedTime(const double);
+    double getFedTime() const { return fed_time.getTime(); };
 
-    void setLookahead(const RTI::FedTime&);
+    void setLookahead(const double);
 
     void setFederationTime(FederationTime);
     FederationTime getFederationTime() const { return fed_time.getTime(); };
@@ -341,12 +341,12 @@
     void setObject(ObjectHandle);
     ObjectHandle getObject() const { return object ; };
 
-    void setTransportation(RTI::TransportationHandle);
-    RTI::TransportationHandle getTransportation() const
+    void setTransportation(TransportType);
+    TransportType getTransportation() const
     { return transport; }
 
-    void setOrdering(RTI::OrderingHandle);
-    RTI::OrderingHandle getOrdering() const
+    void setOrdering(OrderType);
+    OrderType getOrdering() const
     { return order; }
 
     void setEventRetraction(EventRetractionHandle);
@@ -389,7 +389,7 @@
     TypeException exception ;
     std::string exceptionReason;
 
-    RTIfedTime fed_time;
+    FedTime fed_time;
     bool boolean ;
     FederationTimeDelta lookahead ;
     FederateHandle federate ;
Index: libCERTI/CMakeLists.txt
===================================================================
RCS file: /sources/certi/certi/libCERTI/CMakeLists.txt,v
retrieving revision 1.24
diff -u -r1.24 CMakeLists.txt
--- libCERTI/CMakeLists.txt	18 Dec 2008 11:56:00 -0000	1.24
+++ libCERTI/CMakeLists.txt	2 Apr 2009 19:56:32 -0000
@@ -64,6 +64,7 @@
 )
 
 SET(CERTI_TIME_SRCS
+FedTime.cc FedTimeD.hh
 LBTS.cc
 LBTS.hh
 )
@@ -209,44 +210,7 @@
 
 SET_TARGET_PROPERTIES(CERTI PROPERTIES VERSION 1.0.0 SOVERSION 1)
 
-##################################################################
-# Lib FedTime 
-# A replacement lib FedTime may be provided by the user
-# CERTI is provided one. The lib FedTime depends on libRTI
-# since it inherits from the RTI::FedTime abstract class.
-##################################################################
-IF(CMAKE_COMPILER_IS_GNUCC)
-    SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-long-long")
-ENDIF(CMAKE_COMPILER_IS_GNUCC)
-IF(CMAKE_COMPILER_IS_GNUCXX)
-    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-long-long")
-ENDIF(CMAKE_COMPILER_IS_GNUCXX)
-
-INCLUDE_DIRECTORIES(../libHLA)
-SET(FEDTIME_SRCS
-    FedTime.cc
-    ${CMAKE_SOURCE_DIR}/include/fedtime.hh
-)
-
-SOURCE_GROUP("Source Files\\FedTime" FILES ${FEDTIME_SRCS})
-
-ADD_LIBRARY(FedTime
-    ${FEDTIME_SRCS}
-)
-
-TARGET_LINK_LIBRARIES(FedTime RTI HLA)
-
-SET_TARGET_PROPERTIES(FedTime PROPERTIES PROJECT_LABEL LibFedTime)
-IF (MINGW)
-    SET_TARGET_PROPERTIES(FedTime PROPERTIES LINK_FLAGS "-Wl,--output-def,${LIBRARY_OUTPUT_PATH}/libFedTime.def")
-    INSTALL(FILES ${LIBRARY_OUTPUT_PATH}/libFedTime.def
-            DESTINATION lib)
-ENDIF (MINGW)
-
-SET_TARGET_PROPERTIES(FedTime PROPERTIES VERSION 1.0.0 SOVERSION 1)
-
-# Install rules for both libCERTI and libFedTime
-INSTALL(TARGETS CERTI FedTime
+INSTALL(TARGETS CERTI
     RUNTIME DESTINATION bin
     LIBRARY DESTINATION lib
     ARCHIVE DESTINATION lib)
Index: libCERTI/LBTS.cc
===================================================================
RCS file: /sources/certi/certi/libCERTI/LBTS.cc,v
retrieving revision 3.12
diff -u -r3.12 LBTS.cc
--- libCERTI/LBTS.cc	7 Dec 2008 20:16:14 -0000	3.12
+++ libCERTI/LBTS.cc	2 Apr 2009 19:56:32 -0000
@@ -122,7 +122,7 @@
 void
 LBTS::update(FederateHandle num_fed, FederationTime time)
 {
-    D.Out(pdDebug, "LBTS.update: Updating federate %d(%f).", num_fed, time);
+    D.Out(pdDebug, "LBTS.update: Updating federate %d(%f).", num_fed, time.getTime());
 
     ClockSet::iterator it = clocks.find(num_fed);
 
@@ -136,10 +136,10 @@
               num_fed);
     else {
         D.Out(pdDebug, "before LBTS.update: federate %u, old time %f.",
-              it->first, it->second);
+              it->first, it->second.getTime());
         it->second = time ;
         D.Out(pdDebug, "after LBTS.update: federate %u, new time %f.",
-              it->first, it->second) ;
+              it->first, it->second.getTime());
         compute();
     }
 }
Index: libCERTI/LBTS.hh
===================================================================
RCS file: /sources/certi/certi/libCERTI/LBTS.hh,v
retrieving revision 3.8
diff -u -r3.8 LBTS.hh
--- libCERTI/LBTS.hh	20 Nov 2007 09:04:54 -0000	3.8
+++ libCERTI/LBTS.hh	2 Apr 2009 19:56:32 -0000
@@ -19,17 +19,18 @@
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
 // USA
 //
-// $Id: LBTS.hh,v 3.8 2007/11/20 09:04:54 erk Exp $
+// $Id: LBTS.hh,v 3.8.8.1 2009/01/05 13:34:51 gotthardp Exp $
 // ----------------------------------------------------------------------------
 
 #ifndef LIBCERTI_LBTS_HH
 #define LIBCERTI_LBTS_HH
 
 #include "certi.hh"
+#include "FedTimeD.hh"
 
 #ifndef _WIN32				
-#include <unistd.h>
-#include <stdlib.h>
+#include <unistd.h>
+#include <stdlib.h>
 #endif
 
 #include <map>
@@ -68,4 +69,4 @@
 
 #endif // LIBCERTI_LBTS_HH
 
-// $Id: LBTS.hh,v 3.8 2007/11/20 09:04:54 erk Exp $
+// $Id: LBTS.hh,v 3.8.8.1 2009/01/05 13:34:51 gotthardp Exp $
Index: libCERTI/FedTime.cc
===================================================================
RCS file: /sources/certi/certi/libCERTI/FedTime.cc,v
retrieving revision 3.15
diff -u -r3.15 FedTime.cc
--- libCERTI/FedTime.cc	10 Dec 2008 16:53:24 -0000	3.15
+++ libCERTI/FedTime.cc	2 Apr 2009 19:56:32 -0000
@@ -17,241 +17,101 @@
 // You should have received a copy of the GNU Lesser General Public
 // License along with this program ; if not, write to the Free Software
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// $Id: FedTime.cc,v 3.15.4.2 2009/01/05 15:22:34 gotthardp Exp $
 // ----------------------------------------------------------------------------
 
 #include <math.h>
 
-#include "certi.hh"
-#include "fedtime.hh"
-#include "HLAtypesIEEE1516.hh"
-
-#ifdef _WIN32
-	#ifdef max
-		#undef max
-	#endif
-#endif
+#include "FedTimeD.hh"
 
-#include <algorithm>
 #include <limits>
 #include <sstream>
-#include <typeinfo>
 
-using std::stringstream ;
-
-typedef RTI::FedTime FedTime ;
-typedef RTI::Double Double ;
+using namespace certi;
 
 namespace
 {
 
-// ----------------------------------------------------------------------------
-/** FedTime to RTIfedTime reference cast
- */
-inline const RTIfedTime &
-rft(const FedTime &time)
-    throw (RTI::InvalidFederationTime)
-{
-    try {
-	return dynamic_cast<const RTIfedTime &>(time);
-    }
-    catch (std::bad_cast) {
-	throw RTI::InvalidFederationTime("Could not cast to RTIfedTime");
-    }
-}
-
-inline bool
-is_infinity(const FedTime &time)
-{
-    return const_cast<FedTime &>(time).isPositiveInfinity() == RTI::RTI_TRUE ;
-}
-
-/*
- fcmp
- Copyright (c) 1998-2000 Theodore C. Belding
- University of Michigan Center for the Study of Complex Systems
- <mailto:Ted.Belding@umich.edu>
- <http://fcmp.sourceforge.net>
-
- This file is part of the fcmp distribution. fcmp is free software;
- you can redistribute and modify it under the terms of the GNU Library
- General Public License (LGPL), version 2 or later.  This software
- comes with absolutely no warranty. See the file COPYING for details
- and terms of copying.
-
- Description:
-
- Knuth's floating point comparison operators, from:
- Knuth, D. E. (1998). The Art of Computer Programming.
- Volume 2: Seminumerical Algorithms. 3rd ed. Addison-Wesley.
- Section 4.2.2, p. 233. ISBN 0-201-89684-2.
-
- Input parameters:
- x1, x2: numbers to be compared
- epsilon: determines tolerance
-
- epsilon should be carefully chosen based on the machine's precision,
- the observed magnitude of error, the desired precision, and the
- magnitude of the numbers to be compared. See the fcmp README file for
- more information.
-
- This routine may be used for both single-precision (float) and
- double-precision (double) floating-point numbers.
-
- Returns:
- -1 if x1 < x2
-  0 if x1 == x2
-  1 if x1 > x2
-*/
-
-inline int
-fcmp(double x1,double x2, double epsilon)
-{
-    int exponent;
-    double delta;
-    double difference;
-
-    /* Get exponent(max(fabs(x1), fabs(x2))) and store it in exponent. */
-
-    /* If neither x1 nor x2 is 0, */
-    /* this is equivalent to max(exponent(x1), exponent(x2)). */
-
-    /* If either x1 or x2 is 0, its exponent returned by frexp would be 0, */
-    /* which is much larger than the exponents of numbers close to 0 in */
-    /* magnitude. But the exponent of 0 should be less than any number */
-    /* whose magnitude is greater than 0. */
-
-    /* So we only want to set exponent to 0 if both x1 and */
-    /* x2 are 0. Hence, the following works for all x1 and x2. */
-
-    frexp(fabs(x1) > fabs(x2) ? x1 : x2, &exponent);
-
-    /* Do the comparison. */
-
-    /* delta = epsilon * pow(2, exponent) */
-
-    /* Form a neighborhood around x2 of size delta in either direction. */
-    /* If x1 is within this delta neighborhood of x2, x1 == x2. */
-    /* Otherwise x1 > x2 or x1 < x2, depending on which side of */
-    /* the neighborhood x1 is on. */
-
-    delta = ldexp(epsilon, exponent);
-
-    difference = x1 - x2;
-
-    if (difference > delta)
-        return 1; /* x1 > x2 */
-    else if (difference < -delta)
-        return -1;  /* x1 < x2 */
-    else /* -delta <= difference <= delta */
-        return 0;  /* x1 == x2 */
-}
-
 const char *infinity_str = "+inf" ;
 
 } // anonymous namespace
 
 // ----------------------------------------------------------------------------
-// FedTimeFactory
-RTI::FedTime *
-RTI::FedTimeFactory::makeZero()
-    throw (RTI::MemoryExhausted)
-{
-    return new RTIfedTime();
-}
-
-RTI::FedTime *
-RTI::FedTimeFactory::decode(const char *)
-    throw (RTI::MemoryExhausted)
-{
-    throw RTI::RTIinternalError("Not implemented");
-}
-
-// ----------------------------------------------------------------------------
 // FedTime
-//FedTime::~FedTime()
-//{
-//}
 
-const double RTIfedTime::epsilon = std::numeric_limits<double>::epsilon();
+const double FedTime::epsilon = std::numeric_limits<double>::epsilon();
 
 int
-RTIfedTime::fcmp(const double x1, const double x2) {
-	return ::fcmp(x1,x2,RTIfedTime::epsilon);
+FedTime::fcmp(const double x1, const double x2) {
+	return certi::fcmp(x1,x2,FedTime::epsilon);
 }
 
 // ----------------------------------------------------------------------------
-// RTIfedTime
-RTIfedTime::RTIfedTime()
+// FedTime
+FedTime::FedTime()
     : _fedTime(0),
       _zero(0),
-      _epsilon(RTIfedTime::epsilon),
+      _epsilon(FedTime::epsilon),
       _positiveInfinity(std::numeric_limits<double>::infinity()) { }
 
-RTIfedTime::RTIfedTime(const RTI::Double &time)
+FedTime::FedTime(const double &time)
     : _fedTime(time),
       _zero(0),
-      _epsilon(RTIfedTime::epsilon),
-      _positiveInfinity(std::numeric_limits<double>::infinity()) { }
-
-RTIfedTime::RTIfedTime(const FedTime &time)
-    : _fedTime(rft(time).getTime()),
-      _zero(0),
-      _epsilon(RTIfedTime::epsilon),
+      _epsilon(FedTime::epsilon),
       _positiveInfinity(std::numeric_limits<double>::infinity()) { }
 
-// ----------------------------------------------------------------------------
-RTIfedTime::RTIfedTime(const RTIfedTime &time)
-    : FedTime(),
-      _fedTime(time._fedTime),
+FedTime::FedTime(const FedTime &time)
+    : _fedTime(time._fedTime),
       _zero(time._zero),
       _epsilon(time._epsilon),
       _positiveInfinity(time._positiveInfinity) { }
 
 // ----------------------------------------------------------------------------
-RTIfedTime::~RTIfedTime()
+FedTime::~FedTime()
 {
 }
 
 // ----------------------------------------------------------------------------
 void
-RTIfedTime::setZero()
+FedTime::setZero()
 {
     _fedTime = _zero;
 }
 
 // ----------------------------------------------------------------------------
-RTI::Boolean
-RTIfedTime::isZero()
+bool
+FedTime::isZero()
 {
-    return RTI::Boolean(_fedTime == _zero);
+    return bool(_fedTime == _zero);
 }
 
 // ----------------------------------------------------------------------------
 void
-RTIfedTime::setEpsilon()
+FedTime::setEpsilon()
 {
     _fedTime = _epsilon;
 }
 
 // ----------------------------------------------------------------------------
 void
-RTIfedTime::setPositiveInfinity()
+FedTime::setPositiveInfinity()
 {
     _fedTime = _positiveInfinity;
 }
 
 // ----------------------------------------------------------------------------
-inline RTI::Boolean
-RTIfedTime::isPositiveInfinity()
+bool
+FedTime::isPositiveInfinity() const
 {
-    return RTI::Boolean(_fedTime == _positiveInfinity);
+    return bool(_fedTime == _positiveInfinity);
 }
 
 // ----------------------------------------------------------------------------
 int
-RTIfedTime::encodedLength() const
+FedTime::encodedLength() const
 {
-	// current implementation of RTIfedtime takes
+	// current implementation of FedTime takes
 	// four IEEE-754 double values.
 	return (sizeof(_fedTime)+
 			sizeof(_zero)+
@@ -261,20 +121,20 @@
 
 // ----------------------------------------------------------------------------
 void
-RTIfedTime::encode(char *buffer) const
+FedTime::encode(char *buffer) const
 {
-	libhla::HLAfloat64LE encoded_fedTime;
-	encoded_fedTime = _fedTime;
-	strncpy(buffer,(char*)&(encoded_fedTime),encoded_fedTime.__sizeof());
+//	libhla::HLAfloat64LE encoded_fedTime;
+//	encoded_fedTime = _fedTime;
+//	strncpy(buffer,(char*)&(encoded_fedTime),encoded_fedTime.__sizeof());
 }
 
 // ----------------------------------------------------------------------------
 int
-RTIfedTime::getPrintableLength() const
+FedTime::getPrintableLength() const
 {
-    stringstream s ;
+    std::stringstream s ;
 
-    if (is_infinity(*this))
+    if (isPositiveInfinity())
 	s << infinity_str ;
     else
 	s << _fedTime ;
@@ -284,11 +144,11 @@
 
 // ----------------------------------------------------------------------------
 void
-RTIfedTime::getPrintableString(char *str)
+FedTime::getPrintableString(char *str)
 {
-    stringstream s ;
+    std::stringstream s ;
 
-    if (is_infinity(*this))
+    if (isPositiveInfinity())
 	s << infinity_str ;
     else
 	s << _fedTime ;
@@ -299,127 +159,107 @@
 
 // ----------------------------------------------------------------------------
 FedTime &
-RTIfedTime::operator+=(const FedTime &time)
-    throw (RTI::InvalidFederationTime)
+FedTime::operator+=(const FedTime &time)
 {
-    _fedTime += rft(time)._fedTime ;
+    _fedTime += time._fedTime ;
     return *this;
 }
 
 // ----------------------------------------------------------------------------
 FedTime &
-RTIfedTime::operator-=(const FedTime &time)
-    throw (RTI::InvalidFederationTime)
+FedTime::operator-=(const FedTime &time)
 {
-    _fedTime -= rft(time)._fedTime ;
+    _fedTime -= time._fedTime ;
     return *this;
 }
 
 // ----------------------------------------------------------------------------
-RTI::Boolean
-RTIfedTime::operator<=(const FedTime &time) const
-    throw (RTI::InvalidFederationTime)
+bool
+FedTime::operator<=(const FedTime &time) const
 {
     if (const_cast<FedTime &>(time).isPositiveInfinity())
-	return RTI::RTI_TRUE ;
-    else if (is_infinity(*this))
-	return RTI::RTI_FALSE ;
+	return true;
+    else if (isPositiveInfinity())
+	return false;
     else
-	return RTI::Boolean(::fcmp(_fedTime, rft(time)._fedTime, _epsilon) <= 0);
+	return bool(::fcmp(_fedTime, time._fedTime, _epsilon) <= 0);
 }
 
 // ----------------------------------------------------------------------------
-RTI::Boolean
-RTIfedTime::operator<(const FedTime &time) const
-    throw (RTI::InvalidFederationTime)
+bool
+FedTime::operator<(const FedTime &time) const
 {
-    if (is_infinity(*this))
-	return RTI::RTI_FALSE ;
+    if (isPositiveInfinity())
+	return false;
     else
-	return RTI::Boolean(is_infinity(time) || ::fcmp(_fedTime, rft(time)._fedTime, _epsilon) < 0);
+	return bool(time.isPositiveInfinity() || ::fcmp(_fedTime, time._fedTime, _epsilon) < 0);
 }
 
 // ----------------------------------------------------------------------------
-RTI::Boolean
-RTIfedTime::operator>=(const FedTime &time) const
-    throw (RTI::InvalidFederationTime)
+bool
+FedTime::operator>=(const FedTime &time) const
 {
-    if (is_infinity(*this))
-	return RTI::RTI_TRUE ;
-    else if (is_infinity(time))
-	return RTI::RTI_FALSE ;
+    if (isPositiveInfinity())
+	return true;
+    else if (time.isPositiveInfinity())
+	return false;
     else
-	return RTI::Boolean(::fcmp(_fedTime, rft(time)._fedTime, _epsilon) >= 0);
+	return bool(::fcmp(_fedTime, time._fedTime, _epsilon) >= 0);
 }
 
 // ----------------------------------------------------------------------------
-RTI::Boolean
-RTIfedTime::operator>(const FedTime &time) const
-    throw (RTI::InvalidFederationTime)
+bool
+FedTime::operator>(const FedTime &time) const
 {
-    if (is_infinity(time))
-	return RTI::RTI_FALSE ;
+    if (time.isPositiveInfinity())
+	return false;
     else
-	return RTI::Boolean(is_infinity(*this) || ::fcmp(_fedTime, rft(time)._fedTime, _epsilon) > 0);
+	return bool(isPositiveInfinity() || ::fcmp(_fedTime, time._fedTime, _epsilon) > 0);
 }
 
 // ----------------------------------------------------------------------------
-inline RTI::Boolean
-RTIfedTime::operator==(const FedTime &time) const
-    throw (RTI::InvalidFederationTime)
+bool
+FedTime::operator==(const FedTime &time) const
 {
-    if (is_infinity(*this) && is_infinity(time))
-	return RTI::RTI_TRUE ;
-    else if (is_infinity(*this) || is_infinity(time))
-	return RTI::RTI_FALSE ;
+    if (isPositiveInfinity() && time.isPositiveInfinity())
+	return true;
+    else if (isPositiveInfinity() || time.isPositiveInfinity())
+	return false;
     else
-	return RTI::Boolean(::fcmp(_fedTime, rft(time)._fedTime, _epsilon) == 0);
+	return bool(::fcmp(_fedTime, time._fedTime, _epsilon) == 0);
 }
 
 // ----------------------------------------------------------------------------
-FedTime &
-RTIfedTime::operator=(const FedTime &time)
-    throw (RTI::InvalidFederationTime)
-{
-    _fedTime = rft(time)._fedTime ;
-    return *this ;
-}
-
-// ----------------------------------------------------------------------------
-RTI::Double
-RTIfedTime::getTime() const
+double
+FedTime::getTime() const
 {
     return _fedTime ;
 }
 
 // ----------------------------------------------------------------------------
-RTI::Boolean
-RTIfedTime::operator==(const Double &time) const
-    throw (RTI::InvalidFederationTime)
+bool
+FedTime::operator==(const double &time) const
 {
-    return RTI::Boolean(!is_infinity(*this) && ::fcmp(_fedTime, time, _epsilon) == 0);
+    return bool(!isPositiveInfinity() && ::fcmp(_fedTime, time, _epsilon) == 0);
 }
 
 // ----------------------------------------------------------------------------
-RTI::Boolean
-RTIfedTime::operator!=(const FedTime &time) const
-    throw (RTI::InvalidFederationTime)
+bool
+FedTime::operator!=(const FedTime &time) const
 {
-    return RTI::Boolean(::fcmp(_fedTime, rft(time)._fedTime, _epsilon) != 0);
+    return bool(::fcmp(_fedTime, time._fedTime, _epsilon) != 0);
 }
 
 // ----------------------------------------------------------------------------
-RTI::Boolean
-RTIfedTime::operator!=(const Double &time) const
-    throw (RTI::InvalidFederationTime)
+bool
+FedTime::operator!=(const double &time) const
 {
-    return RTI::Boolean(is_infinity(*this) || ::fcmp(_fedTime, time, _epsilon) != 0);
+    return bool(isPositiveInfinity() || ::fcmp(_fedTime, time, _epsilon) != 0);
 }
 
 // ----------------------------------------------------------------------------
 FedTime &
-RTIfedTime::operator=(const RTIfedTime &time)
-    throw (RTI::InvalidFederationTime)
+FedTime::operator=(const FedTime &time)
 {
     _fedTime = time._fedTime ;
     return *this ;
@@ -427,170 +267,159 @@
 
 // ----------------------------------------------------------------------------
 FedTime &
-RTIfedTime::operator=(const Double &time)
-    throw (RTI::InvalidFederationTime)
+FedTime::operator=(const double &time)
 {
     _fedTime = time ;
     return *this ;
 }
 
 FedTime &
-RTIfedTime::operator*=(const RTI::FedTime &time)
-    throw (RTI::InvalidFederationTime)
+FedTime::operator*=(const FedTime &time)
 {
-    _fedTime *= rft(time)._fedTime ;
+    _fedTime *= time._fedTime ;
     return *this ;
 }
 
 FedTime &
-RTIfedTime::operator/=(const RTI::FedTime &time)
-    throw (RTI::InvalidFederationTime)
+FedTime::operator/=(const FedTime &time)
 {
-    _fedTime /= rft(time)._fedTime ;
+    _fedTime /= time._fedTime ;
     return *this ;
 }
 
 FedTime &
-RTIfedTime::operator+=(const RTI::Double &time)
-    throw (RTI::InvalidFederationTime)
+FedTime::operator+=(const double &time)
 {
     _fedTime += time ;
     return *this ;
 }
 
 FedTime &
-RTIfedTime::operator-=(const RTI::Double &time)
-    throw (RTI::InvalidFederationTime)
+FedTime::operator-=(const double &time)
 {
     _fedTime -= time ;
     return *this ;
 }
 
 FedTime &
-RTIfedTime::operator*=(const RTI::Double &time)
-    throw (RTI::InvalidFederationTime)
+FedTime::operator*=(const double &time)
 {
     _fedTime *= time ;
     return *this ;
 }
 
 FedTime &
-RTIfedTime::operator/=(const RTI::Double &time)
-    throw (RTI::InvalidFederationTime)
+FedTime::operator/=(const double &time)
 {
     _fedTime /= time ;
     return *this ;
 }
 
 // ----------------------------------------------------------------------------
-RTIfedTime
-RTIfedTime::operator+(const FedTime &time)
-    throw (RTI::InvalidFederationTime)
+FedTime
+FedTime::operator+(const FedTime &time)
 {
-    RTIfedTime fedtime = _fedTime + rft(time)._fedTime ;
+    FedTime fedtime = _fedTime + time._fedTime ;
     return fedtime ;
 }
 
-RTIfedTime
-RTIfedTime::operator+(const Double &time)
-    throw (RTI::InvalidFederationTime)
+FedTime
+FedTime::operator+(const double &time)
 {
-    RTIfedTime fedtime = _fedTime + time ;
+    FedTime fedtime = _fedTime + time ;
     return fedtime ;
 }
 
 // ----------------------------------------------------------------------------
-RTIfedTime
-RTIfedTime::operator-(const FedTime &time)
-    throw (RTI::InvalidFederationTime)
+FedTime
+FedTime::operator-(const FedTime &time)
 {
-    RTIfedTime fedtime = _fedTime - rft(time)._fedTime ;
+    FedTime fedtime = _fedTime - time._fedTime ;
     return fedtime ;
 }
 
-RTIfedTime
-RTIfedTime::operator-(const Double &time)
-    throw (RTI::InvalidFederationTime)
+FedTime
+FedTime::operator-(const double &time)
 {
-    RTIfedTime fedtime = _fedTime - time ;
+    FedTime fedtime = _fedTime - time ;
     return fedtime ;
 }
 
 // ----------------------------------------------------------------------------
-RTIfedTime
-RTIfedTime::operator*(const FedTime &time)
-    throw (RTI::InvalidFederationTime)
+FedTime
+FedTime::operator*(const FedTime &time)
 {
-    RTIfedTime fedtime = _fedTime * rft(time)._fedTime ;
+    FedTime fedtime = _fedTime * time._fedTime ;
     return fedtime ;
 }
 
-RTIfedTime
-RTIfedTime::operator*(const Double &time)
-    throw (RTI::InvalidFederationTime)
+FedTime
+FedTime::operator*(const double &time)
 {
-    RTIfedTime fedtime = _fedTime * time ;
+    FedTime fedtime = _fedTime * time ;
     return fedtime ;
 }
 
 // ----------------------------------------------------------------------------
-RTIfedTime
-RTIfedTime::operator/(const FedTime &time)
-    throw (RTI::InvalidFederationTime)
+FedTime
+FedTime::operator/(const FedTime &time)
 {
-    RTIfedTime fedtime = _fedTime / rft(time)._fedTime ;
+    FedTime fedtime = _fedTime / time._fedTime ;
     return fedtime ;
 }
 
-RTIfedTime
-RTIfedTime::operator/(const Double &time)
-    throw (RTI::InvalidFederationTime)
+FedTime
+FedTime::operator/(const double &time)
 {
-    RTIfedTime fedtime = _fedTime / time ;
+    FedTime fedtime = _fedTime / time ;
     return fedtime ;
 }
 
 // ----------------------------------------------------------------------------
+namespace certi {
 std::ostream &
 operator<<(std::ostream &s, const FedTime &time)
 {
-    if (is_infinity(time))
+    if (time.isPositiveInfinity())
 	s << infinity_str ;
     else
-	s << rft(time).getTime();
+	s << time.getTime();
     return s ;
 }
-
+}
 // ============================================================================
 
 // ----------------------------------------------------------------------------
-RTIfedTime
-operator+(const Double &d, const FedTime &time)
+FedTime
+operator+(const double &d, const FedTime &time)
 {
-    RTIfedTime fedtime = d + rft(time).getTime();
+    FedTime fedtime = d + time.getTime();
     return fedtime ;
 }
 
 // ----------------------------------------------------------------------------
-RTIfedTime
-operator-(const Double &d, const FedTime &time)
+FedTime
+operator-(const double &d, const FedTime &time)
 {
-    RTIfedTime fedtime = d - rft(time).getTime();
+    FedTime fedtime = d - time.getTime();
     return fedtime ;
 }
 
 // ----------------------------------------------------------------------------
-RTIfedTime
-operator*(const Double &d, const FedTime &time)
+FedTime
+operator*(const double &d, const FedTime &time)
 {
-    RTIfedTime fedtime = d * rft(time).getTime();
+    FedTime fedtime = d * time.getTime();
     return fedtime ;
 }
 
 // ----------------------------------------------------------------------------
-RTIfedTime
-operator/(const Double &d, const FedTime &time)
+FedTime
+operator/(const double &d, const FedTime &time)
 {
-    RTIfedTime fedtime = d / rft(time).getTime();
+    FedTime fedtime = d / time.getTime();
     return fedtime ;
 }
+
+// $Id: FedTime.cc,v 3.15.4.2 2009/01/05 15:22:34 gotthardp Exp $
+
Index: libCERTI/SocketMC.cc
===================================================================
RCS file: /sources/certi/certi/libCERTI/SocketMC.cc,v
retrieving revision 3.16
diff -u -r3.16 SocketMC.cc
--- libCERTI/SocketMC.cc	2 Nov 2008 12:54:40 -0000	3.16
+++ libCERTI/SocketMC.cc	2 Apr 2009 19:56:32 -0000
@@ -32,6 +32,7 @@
 #endif
 #include <cassert>
 #include <cstdlib>
+#include <cstring>
 
 namespace certi {
 
Index: libCERTI/NetworkMessage_RW.cc
===================================================================
RCS file: /sources/certi/certi/libCERTI/NetworkMessage_RW.cc,v
retrieving revision 3.52
diff -u -r3.52 NetworkMessage_RW.cc
--- libCERTI/NetworkMessage_RW.cc	23 Oct 2008 13:46:19 -0000	3.52
+++ libCERTI/NetworkMessage_RW.cc	2 Apr 2009 19:56:32 -0000
@@ -16,8 +16,9 @@
 // License along with this program ; if not, write to the Free Software
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 //
-// $Id: NetworkMessage_RW.cc,v 3.52 2008/10/23 13:46:19 erk Exp $
+// $Id: NetworkMessage_RW.cc,v 3.52.4.1 2009/01/05 13:34:52 gotthardp Exp $
 // ----------------------------------------------------------------------------
+
 #include "NetworkMessage.hh"
 #include "PrettyDebug.hh"
 
@@ -53,8 +54,8 @@
 	 */
 	msgBuffer.write_bool(_isDated);
 	if (_isDated) {
-		msgBuffer.write_double(date);
-		D.Out(pdDebug, "Sent Message date is  <%f>", date);
+		msgBuffer.write_double(date.getTime());
+		D.Out(pdDebug, "Sent Message date is  <%f>", date.getTime());
 	}
 	msgBuffer.write_bool(_isLabelled);
 	if (_isLabelled) {
@@ -74,8 +75,8 @@
 	 */
 	D[pdDebug] << "Deserialize <" << getName().c_str()<<">"<<endl;
 	/* deserialize common part */
-	type        = static_cast<certi::NetworkMessage::Type>(msgBuffer.read_int32());
-	exception   = static_cast<certi::TypeException>(msgBuffer.read_int32());
+	type        = static_cast<NetworkMessage::Type>(msgBuffer.read_int32());
+	exception   = static_cast<TypeException>(msgBuffer.read_int32());
 	federate    = msgBuffer.read_int32();
 	federation  = msgBuffer.read_int32();
 	/*
@@ -87,7 +88,7 @@
 	_isDated = msgBuffer.read_bool();
 	if (_isDated) {
 		date = msgBuffer.read_double();
-		D.Out(pdDebug, "Received Message date is  <%f>", date);
+		D.Out(pdDebug, "Received Message date is  <%f>", date.getTime());
 	}
 	_isLabelled = msgBuffer.read_bool();
 	if (_isLabelled) {
@@ -151,4 +152,4 @@
 
 } // namespace certi
 
-// $Id: NetworkMessage_RW.cc,v 3.52 2008/10/23 13:46:19 erk Exp $
+// $Id: NetworkMessage_RW.cc,v 3.52.4.1 2009/01/05 13:34:52 gotthardp Exp $
Index: RTIG/Federation.cc
===================================================================
RCS file: /sources/certi/certi/RTIG/Federation.cc,v
retrieving revision 3.103
diff -u -r3.103 Federation.cc
--- RTIG/Federation.cc	16 Dec 2008 07:08:29 -0000	3.103
+++ RTIG/Federation.cc	2 Apr 2009 19:56:31 -0000
@@ -712,7 +712,7 @@
     federate.setRegulator(true);
 
     D.Out(pdTerm, "Federation %d: Federate %d is now a regulator(Time=%f).",
-          handle, federate_handle, time);
+          handle, federate_handle, time.getTime());
 
     NM_Set_Time_Regulating msg ;
     msg.exception = e_NO_EXCEPTION ;
@@ -1909,7 +1909,7 @@
     }
 
     D.Out(pdTerm, "Federation %d: Federate %d's new time is %f.",
-          handle, federate_handle, time);
+          handle, federate_handle, time.getTime());
 
     regulators.update(federate_handle, time);
 
Index: RTIG/RTIG.cc
===================================================================
RCS file: /sources/certi/certi/RTIG/RTIG.cc,v
retrieving revision 3.54
diff -u -r3.54 RTIG.cc
--- RTIG/RTIG.cc	7 Dec 2008 20:16:11 -0000	3.54
+++ RTIG/RTIG.cc	2 Apr 2009 19:56:31 -0000
@@ -205,7 +205,7 @@
 
       case NetworkMessage::SET_TIME_REGULATING:
         D.Out(pdTrace, "SetTimeRegulating du federe %u(date=%f).",
-              msg->federate, msg->getDate());
+              msg->federate, msg->getDate().getTime());
         auditServer.setLevel(8);
         processSetTimeRegulating(link, static_cast<NM_Set_Time_Regulating*>(msg));
         break ;
Index: RTIG/RTIG_processing.cc
===================================================================
RCS file: /sources/certi/certi/RTIG/RTIG_processing.cc,v
retrieving revision 3.80
diff -u -r3.80 RTIG_processing.cc
--- RTIG/RTIG_processing.cc	7 Dec 2008 20:16:11 -0000	3.80
+++ RTIG/RTIG_processing.cc	2 Apr 2009 19:56:32 -0000
@@ -520,7 +520,7 @@
   G.Out(pdGendoc,"BEGIN ** SET TIME REGULATING **");
 
   if (msg->isRegulator()) {
-        auditServer << "ON at time " << msg->getDate();
+        auditServer << "ON at time " << msg->getDate().getTime();
 
         federations.createRegulator(msg->federation,
                                      msg->federate,
@@ -561,7 +561,7 @@
   G.Out(pdGendoc,"BEGIN ** SET TIME CONSTRAINED **");
 
   if (msg->isConstrained()) {
-        auditServer << "ON at time " << msg->getDate();
+        auditServer << "ON at time " << msg->getDate().getTime();
 
         federations.addConstrained(msg->federation,
                                     msg->federate);
@@ -597,7 +597,7 @@
 void
 RTIG::processMessageNull(NetworkMessage *msg)
 {
-    auditServer << "Date " << msg->getDate() ;
+    auditServer << "Date " << msg->getDate().getTime();
 
     // Catch all exceptions because RTIA does not expect an answer anyway.
     try {
@@ -919,7 +919,7 @@
     std::vector <AttributeValue_t> ValueArray ;
 
     auditServer << "ObjID = " << req->object
-		<< ", Date = " << req->getDate() ;
+		<< ", Date = " << req->getDate().getTime();
 
     // Get Value Array
     ValueArray = req->getAttribValueArray();
@@ -976,7 +976,7 @@
 
     // Building Value Array
     auditServer << "IntID = " << req->interactionClass
-		<< ", date = " << req->getDate() ;
+		<< ", date = " << req->getDate().getTime();
     values = req->getParamValueArray();
 
     if ( req->isDated() )
Index: libRTI/CMakeLists.txt
===================================================================
RCS file: /sources/certi/certi/libRTI/CMakeLists.txt,v
retrieving revision 1.10
diff -u -r1.10 CMakeLists.txt
--- libRTI/CMakeLists.txt	7 Dec 2008 20:16:16 -0000	1.10
+++ libRTI/CMakeLists.txt	2 Apr 2009 19:56:32 -0000
@@ -4,8 +4,10 @@
 SET(RTI_LIB_SRCS
   RTIambassador.cc
   RTIambPrivateRefs.cc
+  RTIambPrivateRefs.hh
   RTItypes.cc
   RTItypesImp.cc
+  RTItypesImp.hh
   )
   
 SET(RTI_LIB_INCLUDE
@@ -21,7 +23,7 @@
 #SOURCE_GROUP("RTI\\Header" FILES ${RTI_LIB_INCLUDE})
 
 ADD_LIBRARY(RTI ${RTI_LIB_SRCS} ${RTI_LIB_INCLUDE})
-TARGET_LINK_LIBRARIES(RTI CERTI)
+TARGET_LINK_LIBRARIES(RTI CERTI FedTime)
 
 SET_TARGET_PROPERTIES(RTI PROPERTIES OUTPUT_NAME "RTI-NG")
 SET_TARGET_PROPERTIES(RTI PROPERTIES VERSION 1.0.0 SOVERSION 1)
@@ -31,7 +33,44 @@
             DESTINATION lib)
 ENDIF (MINGW)
 
-INSTALL(TARGETS RTI
+##################################################################
+# Lib FedTime 
+# A replacement lib FedTime may be provided by the user
+# CERTI is provided one. The lib FedTime depends on libRTI
+# since it inherits from the RTI::FedTime abstract class.
+##################################################################
+IF(CMAKE_COMPILER_IS_GNUCC)
+    SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-long-long")
+ENDIF(CMAKE_COMPILER_IS_GNUCC)
+IF(CMAKE_COMPILER_IS_GNUCXX)
+    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-long-long")
+ENDIF(CMAKE_COMPILER_IS_GNUCXX)
+
+INCLUDE_DIRECTORIES(../libHLA)
+SET(FEDTIME_SRCS
+    RTIfedTime.cc
+    ${CMAKE_SOURCE_DIR}/include/fedtime.hh
+)
+
+SOURCE_GROUP("Source Files\\FedTime" FILES ${FEDTIME_SRCS})
+
+ADD_LIBRARY(FedTime
+    ${FEDTIME_SRCS}
+)
+
+TARGET_LINK_LIBRARIES(FedTime)
+
+SET_TARGET_PROPERTIES(FedTime PROPERTIES PROJECT_LABEL LibFedTime)
+IF (MINGW)
+    SET_TARGET_PROPERTIES(FedTime PROPERTIES LINK_FLAGS "-Wl,--output-def,${LIBRARY_OUTPUT_PATH}/libFedTime.def")
+    INSTALL(FILES ${LIBRARY_OUTPUT_PATH}/libFedTime.def
+            DESTINATION lib)
+ENDIF (MINGW)
+
+SET_TARGET_PROPERTIES(FedTime PROPERTIES VERSION 1.0.0 SOVERSION 1)
+
+# Install rules for both libRTI-NG and libFedTime
+INSTALL(TARGETS RTI FedTime
     RUNTIME DESTINATION bin
     LIBRARY DESTINATION lib
     ARCHIVE DESTINATION lib)
Index: libRTI/RTItypes.cc
===================================================================
RCS file: /sources/certi/certi/libRTI/RTItypes.cc,v
retrieving revision 1.2
diff -u -r1.2 RTItypes.cc
--- libRTI/RTItypes.cc	7 Dec 2008 20:16:16 -0000	1.2
+++ libRTI/RTItypes.cc	2 Apr 2009 19:56:33 -0000
@@ -16,7 +16,7 @@
 // License along with this program ; if not, write to the Free Software
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 //
-// $Id: RTItypes.cc,v 1.2 2008/12/07 20:16:16 gotthardp Exp $
+// $Id: RTItypes.cc,v 1.2.4.1 2009/02/10 18:25:14 erk Exp $
 // ----------------------------------------------------------------------------
 
 #include "RTItypesImp.hh"
@@ -27,15 +27,6 @@
 #include <cstdlib>
 #include <cstring>
 
-using namespace certi ;
-
-namespace {
-
-static PrettyDebug D("LIBRTI", __FILE__);
-static PrettyDebug G("GENDOC",__FILE__);
-
-}
-
 // static members for HLA Exceptions
 const char *RTI::ArrayIndexOutOfBounds::_ex = "ArrayIndexOutOfBounds" ;
 const char *RTI::AsynchronousDeliveryAlreadyDisabled::_ex = "AsynchronousDeliveryAlreadyDisabled" ;
@@ -198,7 +189,7 @@
 long RTI::ValueCountExceeded::type = certi::e_ValueCountExceeded ;
 long RTI::ValueLengthExceeded::type = certi::e_ValueLengthExceeded ;
 
-static PrettyDebug PD_Exception("RTI_EXCEPTION",__FILE__);
+static PrettyDebug PD_RTIException("RTI_EXCEPTION",__FILE__);
 
 RTI::Exception::~Exception()
 {
@@ -255,7 +246,7 @@
     msg << std::endl;
     msg << std::flush;
 
-    PD_Exception[pdExcept] << msg.str().c_str();
+    PD_RTIException[pdExcept] << msg.str().c_str();
     return msg.str();
 }
 
@@ -273,4 +264,4 @@
     return os<<(*ex);
 }
 
-// $Id: RTItypes.cc,v 1.2 2008/12/07 20:16:16 gotthardp Exp $
+// $Id: RTItypes.cc,v 1.2.4.1 2009/02/10 18:25:14 erk Exp $
Index: libRTI/RTItypesImp.hh
===================================================================
RCS file: /sources/certi/certi/libRTI/RTItypesImp.hh,v
retrieving revision 3.1
diff -u -r3.1 RTItypesImp.hh
--- libRTI/RTItypesImp.hh	7 Dec 2008 20:16:17 -0000	3.1
+++ libRTI/RTItypesImp.hh	2 Apr 2009 19:56:33 -0000
@@ -19,7 +19,7 @@
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
 // USA
 //
-// $Id: RTItypesImp.hh,v 3.1 2008/12/07 20:16:17 gotthardp Exp $
+// $Id: RTItypesImp.hh,v 3.1.4.2 2009/02/10 18:25:14 erk Exp $
 // ----------------------------------------------------------------------------
 
 #ifndef _RTI_TYPESIMP_HH
@@ -31,7 +31,7 @@
 namespace certi {
 
 template<class I>
-struct cast
+struct certi_cast
 {
     template<class R>
     const I& operator()(const R& imp)
@@ -44,6 +44,18 @@
             throw RTI::RTIinternalError("Incompatible object on input.");
         }
     }
+
+    template<class R>
+    I& operator()(R& imp)
+    {
+        try {
+            return dynamic_cast<I&>(imp);
+        }
+        catch (...)
+        {
+            throw RTI::RTIinternalError("Incompatible object on input.");
+        }
+    }
 };
 
 typedef std::pair<AttributeHandle, AttributeValue_t> AttributeHandleValuePair_t;
@@ -251,4 +263,4 @@
 
 #endif // _RTI_TYPESIMP_HH
 
-// $Id: RTItypesImp.hh,v 3.1 2008/12/07 20:16:17 gotthardp Exp $
+// $Id: RTItypesImp.hh,v 3.1.4.2 2009/02/10 18:25:14 erk Exp $
Index: libRTI/RTIambassador.cc
===================================================================
RCS file: /sources/certi/certi/libRTI/RTIambassador.cc,v
retrieving revision 3.101
diff -u -r3.101 RTIambassador.cc
--- libRTI/RTIambassador.cc	7 Dec 2008 20:16:16 -0000	3.101
+++ libRTI/RTIambassador.cc	2 Apr 2009 19:56:33 -0000
@@ -19,11 +19,11 @@
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
 // USA
 //
-// $Id: RTIambassador.cc,v 3.101 2008/12/07 20:16:16 gotthardp Exp $
+// $Id: RTIambassador.cc,v 3.101.4.2 2009/02/10 18:25:15 erk Exp $
 // ----------------------------------------------------------------------------
 
-
-#include "certi.hh"
+#include "RTI.hh"
+#include "fedtime.hh"
 
 #include "RTIambPrivateRefs.hh"
 #include "RTItypesImp.hh"
@@ -612,7 +612,7 @@
 //! Request Federation Save with time.
 void
 RTI::RTIambassador::requestFederationSave(const char *label,
-                                     const FedTime& theTime)
+                                     const RTI::FedTime& theTime)
     throw (RTI::FederationTimeAlreadyPassed,
            RTI::InvalidFederationTime,
            RTI::FederateNotExecutionMember,
@@ -626,7 +626,7 @@
     G.Out(pdGendoc,"enter RTIambassador::requestFederationSave with time");
 
     req.type = Message::REQUEST_FEDERATION_SAVE ;
-    req.setFedTime(theTime);
+    req.setFedTime(certi_cast<RTIfedTime>()(theTime).getTime());
     req.setLabel(label);
     // boolean true means time constrained
     req.setBoolean(true);
@@ -796,7 +796,7 @@
 
     req.type = Message::PUBLISH_OBJECT_CLASS ;
     req.setObjectClass(theClass);
-    req.setAHS(cast<AttributeHandleSetImp>()(attributeList).getAttributeHandles());
+    req.setAHS(certi_cast<AttributeHandleSetImp>()(attributeList).getAttributeHandles());
     G.Out(pdGendoc,"      ====>executeService PUBLISH_OBJECT_CLASS");
     privateRefs->executeService(&req, &rep);
     G.Out(pdGendoc,"exit  RTIambassador::publishObjectClass");
@@ -870,7 +870,7 @@
     G.Out(pdGendoc,"enter RTIambassador::subscribeObjectClassAttributes");
     req.type = Message::SUBSCRIBE_OBJECT_CLASS_ATTRIBUTES ;
     req.setObjectClass(theClass);
-    req.setAHS(cast<AttributeHandleSetImp>()(attributeList).getAttributeHandles());
+    req.setAHS(certi_cast<AttributeHandleSetImp>()(attributeList).getAttributeHandles());
     req.setBoolean(active);
 
     privateRefs->executeService(&req, &rep);
@@ -975,11 +975,11 @@
     @param theTime       Federation time
     @param theTag        User supplied tag
 */
-EventRetractionHandle
+RTI::EventRetractionHandle
 RTI::RTIambassador::
 updateAttributeValues(ObjectHandle theObject,
                       const AttributeHandleValuePairSet& theAttributes,
-                      const FedTime& theTime,
+                      const RTI::FedTime& theTime,
                       const char *theTag)
     throw (RTI::ObjectNotKnown,
            RTI::AttributeNotDefined,
@@ -996,13 +996,13 @@
 
     req.type = Message::UPDATE_ATTRIBUTE_VALUES ;
     req.setObject(theObject);
-    req.setFedTime(theTime);
+    req.setFedTime(certi_cast<RTIfedTime>()(theTime).getTime());
     if ( theTag == NULL)
        {
        throw RTI::RTIinternalError ("Calling updateAttributeValues with Tag NULL");
        }
     req.setTag(theTag);
-    req.setAHVPS(cast<AttributeHandleValuePairSetImp>()(theAttributes).getAttributeHandleValuePairs());
+    req.setAHVPS(certi_cast<AttributeHandleValuePairSetImp>()(theAttributes).getAttributeHandleValuePairs());
     req.setBoolean(true);
 
     privateRefs->executeService(&req, &rep);
@@ -1038,7 +1038,7 @@
        throw RTI::RTIinternalError ("Calling updateAttributeValues with Tag NULL");
        }
     req.setTag(theTag);
-    req.setAHVPS(cast<AttributeHandleValuePairSetImp>()(theAttributes).getAttributeHandleValuePairs());
+    req.setAHVPS(certi_cast<AttributeHandleValuePairSetImp>()(theAttributes).getAttributeHandleValuePairs());
     req.setBoolean(false);
 
     privateRefs->executeService(&req, &rep);
@@ -1054,10 +1054,10 @@
     @param theTime Federation time
     @param theTag User-supplied tag
 */
-EventRetractionHandle
+RTI::EventRetractionHandle
 RTI::RTIambassador::sendInteraction(InteractionClassHandle theInteraction,
                                const ParameterHandleValuePairSet& theParameters,
-                               const FedTime& theTime,
+                               const RTI::FedTime& theTime,
                                const char *theTag)
     throw (RTI::InteractionClassNotDefined,
            RTI::InteractionClassNotPublished,
@@ -1073,13 +1073,13 @@
 
     req.type = Message::SEND_INTERACTION ;
     req.setInteractionClass(theInteraction);
-    req.setFedTime(theTime);
+    req.setFedTime(certi_cast<RTIfedTime>()(theTime).getTime());
     if (theTag == NULL)
        {
        throw RTI::RTIinternalError ("Calling sendInteraction with Tag NULL") ;
        }
     req.setTag((std::string)theTag);
-    req.setPHVPS(cast<ParameterHandleValuePairSetImp>()(theParameters).getParameterHandleValuePairs());
+    req.setPHVPS(certi_cast<ParameterHandleValuePairSetImp>()(theParameters).getParameterHandleValuePairs());
     req.setRegion(0);
     req.setBoolean(true);
 
@@ -1115,7 +1115,7 @@
        throw RTI::RTIinternalError ("Calling sendIntercation with Tag NULL") ;
        }
     req.setTag((std::string)theTag);
-    req.setPHVPS(cast<ParameterHandleValuePairSetImp>()(theParameters).getParameterHandleValuePairs());
+    req.setPHVPS(certi_cast<ParameterHandleValuePairSetImp>()(theParameters).getParameterHandleValuePairs());
     req.setRegion(0);
     req.setBoolean(false);
   
@@ -1130,9 +1130,9 @@
     @param theTime Federation time
     @param theTag user supplied tag
 */
-EventRetractionHandle
+RTI::EventRetractionHandle
 RTI::RTIambassador::deleteObjectInstance(ObjectHandle theObject,
-                                    const FedTime& theTime,
+                                    const RTI::FedTime& theTime,
                                     const char *theTag)
     throw (RTI::ObjectNotKnown,
            RTI::DeletePrivilegeNotHeld,
@@ -1147,7 +1147,7 @@
 
     req.type = Message::DELETE_OBJECT_INSTANCE ;
     req.setObject(theObject);
-    req.setFedTime(theTime);
+    req.setFedTime(certi_cast<RTIfedTime>()(theTime).getTime());
     if (theTag == NULL)
        {
        throw RTI::RTIinternalError ("Calling deleteObjectInstance with Tag NULL") ;
@@ -1222,7 +1222,7 @@
     req.type = Message::CHANGE_ATTRIBUTE_TRANSPORTATION_TYPE ;
     req.setObject(theObject);
     req.setTransportation(theType);
-    req.setAHS(cast<AttributeHandleSetImp>()(theAttributes).getAttributeHandles());
+    req.setAHS(certi_cast<AttributeHandleSetImp>()(theAttributes).getAttributeHandles());
 
     privateRefs->executeService(&req, &rep);
 }
@@ -1262,7 +1262,7 @@
     G.Out(pdGendoc,"enter RTIambassador::requestObjectAttributeValueUpdate");
     req.type = Message::REQUEST_OBJECT_ATTRIBUTE_VALUE_UPDATE ;
     req.setObject(theObject);
-    req.setAHS(cast<AttributeHandleSetImp>()(ahs).getAttributeHandles());
+    req.setAHS(certi_cast<AttributeHandleSetImp>()(ahs).getAttributeHandles());
 
     privateRefs->executeService(&req, &rep);
     G.Out(pdGendoc,"exit  RTIambassador::requestObjectAttributeValueUpdate");
@@ -1283,7 +1283,7 @@
     G.Out(pdGendoc,"enter RTIambassador::requestClassAttributeValueUpdate");
     req.type = Message::REQUEST_CLASS_ATTRIBUTE_VALUE_UPDATE ;
     req.setObjectClass(theClass);
-    req.setAHS(cast<AttributeHandleSetImp>()(attrs).getAttributeHandles());
+    req.setAHS(certi_cast<AttributeHandleSetImp>()(attrs).getAttributeHandles());
 
     privateRefs->executeService(&req, &rep);
     G.Out(pdGendoc,"exit  RTIambassador::requestClassAttributeValueUpdate");
@@ -1308,7 +1308,7 @@
 
     req.type = Message::UNCONDITIONAL_ATTRIBUTE_OWNERSHIP_DIVESTITURE ;
     req.setObject(theObject);
-    req.setAHS(cast<AttributeHandleSetImp>()(attrs).getAttributeHandles());
+    req.setAHS(certi_cast<AttributeHandleSetImp>()(attrs).getAttributeHandles());
 
     privateRefs->executeService(&req, &rep);
 }
@@ -1339,7 +1339,7 @@
        throw RTI::RTIinternalError ("Calling negotiatedAttributeOwnershipDivestiture with Tag NULL") ;
        }
     req.setTag(theTag);
-    req.setAHS(cast<AttributeHandleSetImp>()(attrs).getAttributeHandles());
+    req.setAHS(certi_cast<AttributeHandleSetImp>()(attrs).getAttributeHandles());
 
     privateRefs->executeService(&req, &rep);
 }
@@ -1371,7 +1371,7 @@
        throw RTI::RTIinternalError ("Calling attributeOwnershipAcquisition with Tag NULL") ;
        }
     req.setTag(theTag);
-    req.setAHS(cast<AttributeHandleSetImp>()(desiredAttributes).getAttributeHandles());
+    req.setAHS(certi_cast<AttributeHandleSetImp>()(desiredAttributes).getAttributeHandles());
 
     privateRefs->executeService(&req, &rep);
 }
@@ -1396,7 +1396,7 @@
 
     req.type = Message::ATTRIBUTE_OWNERSHIP_RELEASE_RESPONSE ;
     req.setObject(theObject);
-    req.setAHS(cast<AttributeHandleSetImp>()(attrs).getAttributeHandles());
+    req.setAHS(certi_cast<AttributeHandleSetImp>()(attrs).getAttributeHandles());
 
     privateRefs->executeService(&req, &rep);
 
@@ -1427,7 +1427,7 @@
 
     req.type = Message::CANCEL_NEGOTIATED_ATTRIBUTE_OWNERSHIP_DIVESTITURE ;
     req.setObject(theObject);
-    req.setAHS(cast<AttributeHandleSetImp>()(attrs).getAttributeHandles());
+    req.setAHS(certi_cast<AttributeHandleSetImp>()(attrs).getAttributeHandles());
 
     privateRefs->executeService(&req, &rep);
 }
@@ -1452,7 +1452,7 @@
 
     req.type = Message::CANCEL_ATTRIBUTE_OWNERSHIP_ACQUISITION ;
     req.setObject(theObject);
-    req.setAHS(cast<AttributeHandleSetImp>()(attrs).getAttributeHandles());
+    req.setAHS(certi_cast<AttributeHandleSetImp>()(attrs).getAttributeHandles());
 
     privateRefs->executeService(&req, &rep);
 }
@@ -1479,7 +1479,7 @@
 
     req.type = Message::ATTRIBUTE_OWNERSHIP_ACQUISITION_IF_AVAILABLE ;
     req.setObject(theObject);
-    req.setAHS(cast<AttributeHandleSetImp>()(desired).getAttributeHandles());
+    req.setAHS(certi_cast<AttributeHandleSetImp>()(desired).getAttributeHandles());
 
     privateRefs->executeService(&req, &rep);
 }
@@ -1531,8 +1531,8 @@
 // ----------------------------------------------------------------------------
 // Enable Time Regulation
 void
-RTI::RTIambassador::enableTimeRegulation(const FedTime& theFederateTime,
-                                    const FedTime& theLookahead)
+RTI::RTIambassador::enableTimeRegulation(const RTI::FedTime& theFederateTime,
+                                    const RTI::FedTime& theLookahead)
     throw (RTI::RTIinternalError, RTI::RestoreInProgress, 
 	   RTI::SaveInProgress, RTI::FederateNotExecutionMember, 
 	   RTI::ConcurrentAccessAttempted, RTI::InvalidLookahead, 
@@ -1541,8 +1541,8 @@
 {
     Message req, rep ;
     req.type = Message::ENABLE_TIME_REGULATION ;
-    req.setFedTime(theFederateTime);
-    req.setLookahead(theLookahead);
+    req.setFedTime(certi_cast<RTIfedTime>()(theFederateTime).getTime());
+    req.setLookahead(certi_cast<RTIfedTime>()(theLookahead).getTime());
     req.setBoolean(true);
     privateRefs->executeService(&req, &rep);
 }
@@ -1603,7 +1603,7 @@
 // ----------------------------------------------------------------------------
 // Time Advance Request
 void
-RTI::RTIambassador::timeAdvanceRequest(const FedTime& theTime)
+RTI::RTIambassador::timeAdvanceRequest(const RTI::FedTime& theTime)
     throw (RTI::TimeAdvanceAlreadyInProgress,
            RTI::FederationTimeAlreadyPassed,
            RTI::InvalidFederationTime,
@@ -1618,14 +1618,14 @@
     Message req, rep ;
 
     req.type = Message::TIME_ADVANCE_REQUEST ;
-    req.setFedTime(theTime);
+    req.setFedTime(certi_cast<RTIfedTime>()(theTime).getTime());
     privateRefs->executeService(&req, &rep);
 }
 
 // ----------------------------------------------------------------------------
 // Time Advance Request Available
 void
-RTI::RTIambassador::timeAdvanceRequestAvailable(const FedTime& theTime)
+RTI::RTIambassador::timeAdvanceRequestAvailable(const RTI::FedTime& theTime)
     throw (RTI::RTIinternalError, RTI::RestoreInProgress, RTI::SaveInProgress, 
 	   RTI::ConcurrentAccessAttempted, RTI::FederateNotExecutionMember, 
 	   RTI::EnableTimeConstrainedPending, RTI::EnableTimeRegulationPending, 
@@ -1635,7 +1635,7 @@
     Message req, rep ;
 
     req.type = Message::TIME_ADVANCE_REQUEST_AVAILABLE ;
-    req.setFedTime(theTime);
+    req.setFedTime(certi_cast<RTIfedTime>()(theTime).getTime());
 
     privateRefs->executeService(&req, &rep);
 }
@@ -1643,7 +1643,7 @@
 // ----------------------------------------------------------------------------
 // Next Event Request
 void
-RTI::RTIambassador::nextEventRequest(const FedTime& theTime)
+RTI::RTIambassador::nextEventRequest(const RTI::FedTime& theTime)
     throw (RTI::TimeAdvanceAlreadyInProgress,
            RTI::FederationTimeAlreadyPassed,
            RTI::InvalidFederationTime,
@@ -1658,14 +1658,14 @@
     Message req, rep ;
 
     req.type = Message::NEXT_EVENT_REQUEST ;
-    req.setFedTime(theTime);
+    req.setFedTime(certi_cast<RTIfedTime>()(theTime).getTime());
     privateRefs->executeService(&req, &rep);
 }
 
 // ----------------------------------------------------------------------------
 // Next Event Request Available
 void
-RTI::RTIambassador::nextEventRequestAvailable(const FedTime& theTime)
+RTI::RTIambassador::nextEventRequestAvailable(const RTI::FedTime& theTime)
     throw (RTI::RTIinternalError, RTI::RestoreInProgress, RTI::SaveInProgress, 
 	   RTI::ConcurrentAccessAttempted, RTI::FederateNotExecutionMember, 
 	   RTI::EnableTimeConstrainedPending, RTI::EnableTimeRegulationPending, 
@@ -1675,14 +1675,14 @@
     Message req, rep ;
 
     req.type = Message::NEXT_EVENT_REQUEST_AVAILABLE ;
-    req.setFedTime(theTime);
+    req.setFedTime(certi_cast<RTIfedTime>()(theTime).getTime());
     privateRefs->executeService(&req, &rep);
 }
 
 // ----------------------------------------------------------------------------
 // Flush Queue Request
 void
-RTI::RTIambassador::flushQueueRequest(const FedTime& theTime)
+RTI::RTIambassador::flushQueueRequest(const RTI::FedTime& theTime)
     throw (RTI::TimeAdvanceAlreadyInProgress,
            RTI::FederationTimeAlreadyPassed,
            RTI::InvalidFederationTime,
@@ -1698,7 +1698,7 @@
     Message req, rep ;
 
     req.type = Message::FLUSH_QUEUE_REQUEST ;
-    req.setFedTime(theTime);
+    req.setFedTime(certi_cast<RTIfedTime>()(theTime).getTime());
 
     privateRefs->executeService(&req, &rep);
 }
@@ -1738,7 +1738,7 @@
 // ----------------------------------------------------------------------------
 // Query LBTS
 void
-RTI::RTIambassador::queryLBTS(FedTime& theTime)
+RTI::RTIambassador::queryLBTS(RTI::FedTime& theTime)
     throw (RTI::FederateNotExecutionMember,
            RTI::ConcurrentAccessAttempted,
            RTI::SaveInProgress,
@@ -1750,13 +1750,13 @@
     req.type = Message::QUERY_LBTS ;
     privateRefs->executeService(&req, &rep);
 
-    theTime = rep.getFedTime();
+    certi_cast<RTIfedTime>()(theTime) = rep.getFedTime();
 }
 
 // ----------------------------------------------------------------------------
 // Query Federate Time
 void
-RTI::RTIambassador::queryFederateTime(FedTime& theTime)
+RTI::RTIambassador::queryFederateTime(RTI::FedTime& theTime)
     throw (RTI::FederateNotExecutionMember,
            RTI::ConcurrentAccessAttempted,
            RTI::SaveInProgress,
@@ -1768,13 +1768,13 @@
     req.type = Message::QUERY_FEDERATE_TIME ;
     privateRefs->executeService(&req, &rep);
 
-    theTime = rep.getFedTime();
+    certi_cast<RTIfedTime>()(theTime) = rep.getFedTime();
 }
 
 // ----------------------------------------------------------------------------
 // Query Minimum Next Event Time
 void
-RTI::RTIambassador::queryMinNextEventTime(FedTime& theTime)
+RTI::RTIambassador::queryMinNextEventTime(RTI::FedTime& theTime)
     throw (RTI::FederateNotExecutionMember,
            RTI::ConcurrentAccessAttempted,
            RTI::SaveInProgress,
@@ -1786,13 +1786,13 @@
     req.type = Message::QUERY_MIN_NEXT_EVENT_TIME ;
     privateRefs->executeService(&req, &rep);
 
-    theTime = rep.getFedTime();
+    certi_cast<RTIfedTime>()(theTime) = rep.getFedTime();
 }
 
 // ----------------------------------------------------------------------------
 // Modify Lookahead
 void
-RTI::RTIambassador::modifyLookahead(const FedTime& theLookahead)
+RTI::RTIambassador::modifyLookahead(const RTI::FedTime& theLookahead)
     throw (RTI::RTIinternalError, RTI::RestoreInProgress, RTI::SaveInProgress, 
 	   RTI::ConcurrentAccessAttempted, RTI::FederateNotExecutionMember, 
 	   RTI::InvalidLookahead)
@@ -1800,7 +1800,7 @@
     Message req, rep ;
 
     req.type = Message::MODIFY_LOOKAHEAD ;
-    req.setLookahead(theLookahead);
+    req.setLookahead(certi_cast<RTIfedTime>()(theLookahead).getTime());
 
     privateRefs->executeService(&req, &rep);
 }
@@ -1808,7 +1808,7 @@
 // ----------------------------------------------------------------------------
 // Query Lookahead
 void
-RTI::RTIambassador::queryLookahead(FedTime &theTime)
+RTI::RTIambassador::queryLookahead(RTI::FedTime &theTime)
     throw (RTI::FederateNotExecutionMember,
            RTI::ConcurrentAccessAttempted,
            RTI::SaveInProgress,
@@ -1820,19 +1820,13 @@
     req.type = Message::QUERY_LOOKAHEAD ;
     privateRefs->executeService(&req, &rep);
 
-    try { 
-        RTIfedTime &ret = dynamic_cast<RTIfedTime&>(theTime); 
-        ret = RTIfedTime((Double) rep.getFederationTimeDelta());
-    }
-    catch (std::bad_cast) {
-	throw RTI::RTIinternalError("theTime is not a RTIfedTime object");
-    }
+    certi_cast<RTIfedTime>()(theTime) = rep.getFederationTimeDelta().getTime();
 }
 
 // ----------------------------------------------------------------------------
 // Retract
 void
-RTI::RTIambassador::retract(EventRetractionHandle handle)
+RTI::RTIambassador::retract(RTI::EventRetractionHandle handle)
     throw (RTI::RTIinternalError, RTI::RestoreInProgress, RTI::SaveInProgress, 
 	   RTI::ConcurrentAccessAttempted, RTI::FederateNotExecutionMember, 
 	   RTI::InvalidRetractionHandle)
@@ -1862,7 +1856,7 @@
     req.type = Message::CHANGE_ATTRIBUTE_ORDER_TYPE ;
     req.setObject(theObject);
     req.setOrdering(theType);
-    req.setAHS(cast<AttributeHandleSetImp>()(attrs).getAttributeHandles());
+    req.setAHS(certi_cast<AttributeHandleSetImp>()(attrs).getAttributeHandles());
 
     privateRefs->executeService(&req, &rep);
 }
@@ -2080,7 +2074,7 @@
     req.type = Message::DDM_ASSOCIATE_REGION ;
     req.setObject(object);
     req.setRegion(get_handle(region));
-    req.setAHS(cast<AttributeHandleSetImp>()(attributes).getAttributeHandles());
+    req.setAHS(certi_cast<AttributeHandleSetImp>()(attributes).getAttributeHandles());
 
     privateRefs->executeService(&req, &rep);
     D[pdDebug] << "- Associate Region for Updates" << endl ;
@@ -2146,7 +2140,7 @@
     req.type = Message::DDM_SUBSCRIBE_ATTRIBUTES ;
     req.setObjectClass(object_class);
     req.setRegion(get_handle(region));
-    req.setAHS(cast<AttributeHandleSetImp>()(attributes).getAttributeHandles());
+    req.setAHS(certi_cast<AttributeHandleSetImp>()(attributes).getAttributeHandles());
     req.setBoolean(passive);
 
     privateRefs->executeService(&req, &rep);
@@ -2234,10 +2228,10 @@
 
 // ----------------------------------------------------------------------------
 // Send Interaction With Region
-EventRetractionHandle
+RTI::EventRetractionHandle
 RTI::RTIambassador::sendInteractionWithRegion(InteractionClassHandle interaction,
                                          const ParameterHandleValuePairSet &par,
-                                         const FedTime &time,
+                                         const RTI::FedTime &time,
                                          const char *tag,
                                          const Region &region)
     throw (RTI::InteractionClassNotDefined,
@@ -2256,8 +2250,8 @@
 
     req.setType(Message::SEND_INTERACTION);
     req.setInteractionClass(interaction);
-    req.setPHVPS(cast<ParameterHandleValuePairSetImp>()(par).getParameterHandleValuePairs());
-    req.setFedTime(time);
+    req.setPHVPS(certi_cast<ParameterHandleValuePairSetImp>()(par).getParameterHandleValuePairs());
+    req.setFedTime(certi_cast<RTIfedTime>()(time).getTime());
     if ( tag == NULL )
        {
        throw RTI::RTIinternalError ("Calling sendInteractionWithRegion with Tag NULL");
@@ -2291,7 +2285,7 @@
 
     req.setType(Message::SEND_INTERACTION);
     req.setInteractionClass(interaction);
-    req.setPHVPS(cast<ParameterHandleValuePairSetImp>()(par).getParameterHandleValuePairs());
+    req.setPHVPS(certi_cast<ParameterHandleValuePairSetImp>()(par).getParameterHandleValuePairs());
     if ( tag == NULL )
        {
        throw RTI::RTIinternalError ("Calling sendInteractionWithRegion with Tag NULL");
@@ -2316,7 +2310,7 @@
 
     Message req, rep ;
     req.setType(Message::DDM_REQUEST_UPDATE);
-    req.setAHS(cast<AttributeHandleSetImp>()(attrs).getAttributeHandles());
+    req.setAHS(certi_cast<AttributeHandleSetImp>()(attrs).getAttributeHandles());
     req.setRegion(get_handle(region));
     privateRefs->executeService(&req, &rep);    
 }
@@ -2955,4 +2949,4 @@
     privateRefs->executeService(&req, &rep);
 }
 
-// $Id: RTIambassador.cc,v 3.101 2008/12/07 20:16:16 gotthardp Exp $
+// $Id: RTIambassador.cc,v 3.101.4.2 2009/02/10 18:25:15 erk Exp $
Index: libRTI/RTIambPrivateRefs.hh
===================================================================
RCS file: /sources/certi/certi/libRTI/RTIambPrivateRefs.hh,v
retrieving revision 3.7
diff -u -r3.7 RTIambPrivateRefs.hh
--- libRTI/RTIambPrivateRefs.hh	7 Dec 2008 20:16:16 -0000	3.7
+++ libRTI/RTIambPrivateRefs.hh	2 Apr 2009 19:56:32 -0000
@@ -19,10 +19,11 @@
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
 // USA
 //
-// $Id: RTIambPrivateRefs.hh,v 3.7 2008/12/07 20:16:16 gotthardp Exp $
+// $Id: RTIambPrivateRefs.hh,v 3.7.4.1 2009/01/05 13:34:52 gotthardp Exp $
 // ----------------------------------------------------------------------------
 
 #include "RTI.hh"
+#include "fedtime.hh"
 #include "Message.hh"
 #include "RootObject.hh"
 #include "MessageBuffer.hh"
@@ -59,4 +60,4 @@
     MessageBuffer msgBufSend,msgBufReceive ;
 };
 
-// $Id: RTIambPrivateRefs.hh,v 3.7 2008/12/07 20:16:16 gotthardp Exp $
+// $Id: RTIambPrivateRefs.hh,v 3.7.4.1 2009/01/05 13:34:52 gotthardp Exp $
Index: libRTI/RTIambPrivateRefs.cc
===================================================================
RCS file: /sources/certi/certi/libRTI/RTIambPrivateRefs.cc,v
retrieving revision 3.16
diff -u -r3.16 RTIambPrivateRefs.cc
--- libRTI/RTIambPrivateRefs.cc	7 Dec 2008 20:16:16 -0000	3.16
+++ libRTI/RTIambPrivateRefs.cc	2 Apr 2009 19:56:32 -0000
@@ -19,7 +19,7 @@
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
 // USA
 //
-// $Id: RTIambPrivateRefs.cc,v 3.16 2008/12/07 20:16:16 gotthardp Exp $
+// $Id: RTIambPrivateRefs.cc,v 3.16.4.2 2009/02/10 18:25:14 erk Exp $
 // ----------------------------------------------------------------------------
 
 #include <config.h>
@@ -29,7 +29,7 @@
 #include <sstream>
 
 namespace {
-PrettyDebug D("LIBRTI", __FILE__);
+static PrettyDebug D("LIBRTI", __FILE__);
 static PrettyDebug G("GENDOC",__FILE__);
 }
 
@@ -712,7 +712,7 @@
             if (msg->getBoolean())
                fed_amb->reflectAttributeValues(msg->getObject(),
                                                *attributes,
-                                               msg->getFedTime(),
+                                               RTIfedTime(msg->getFedTime()),
                                                (msg->getTag()).c_str(),
                                                msg->getEventRetraction());
             else
@@ -733,7 +733,7 @@
                 fed_amb->receiveInteraction(
                                         msg->getInteractionClass(),
                                         *parameters,
-                                        msg->getFedTime(),
+                                        RTIfedTime(msg->getFedTime()),
                                         (msg->getTag()).c_str(),
                                         msg->getEventRetraction());
             else
@@ -752,7 +752,7 @@
             if (msg->getBoolean()) {
                 fed_amb->removeObjectInstance(
                                           msg->getObject(),
-                                          msg->getFedTime(),
+                                          RTIfedTime(msg->getFedTime()),
                                           (msg->getTag()).c_str(),
                                           msg->getEventRetraction());
             }
@@ -884,21 +884,21 @@
 
       case Message::TIME_ADVANCE_GRANT:
         try {
-            fed_amb->timeAdvanceGrant(msg->getFedTime());
+            fed_amb->timeAdvanceGrant(RTIfedTime(msg->getFedTime()));
         }
         CATCH_FEDERATE_AMBASSADOR_EXCEPTIONS("timeAdvanceGrant")
         break ;
 
       case Message::TIME_REGULATION_ENABLED:
         try {
-            fed_amb->timeRegulationEnabled(msg->getFedTime());
+            fed_amb->timeRegulationEnabled(RTIfedTime(msg->getFedTime()));
         }
         CATCH_FEDERATE_AMBASSADOR_EXCEPTIONS("timeRegulationEnabled")
         break ;
 
       case Message::TIME_CONSTRAINED_ENABLED:
         try {
-            fed_amb->timeConstrainedEnabled(msg->getFedTime());
+            fed_amb->timeConstrainedEnabled(RTIfedTime(msg->getFedTime()));
         }
         CATCH_FEDERATE_AMBASSADOR_EXCEPTIONS("timeConstrainedEnabled")
         break ;
@@ -908,4 +908,4 @@
     }
 }
 
-// $Id: RTIambPrivateRefs.cc,v 3.16 2008/12/07 20:16:16 gotthardp Exp $
+// $Id: RTIambPrivateRefs.cc,v 3.16.4.2 2009/02/10 18:25:14 erk Exp $
Index: libRTI/RTItypesImp.cc
===================================================================
RCS file: /sources/certi/certi/libRTI/RTItypesImp.cc,v
retrieving revision 3.1
diff -u -r3.1 RTItypesImp.cc
--- libRTI/RTItypesImp.cc	7 Dec 2008 20:16:17 -0000	3.1
+++ libRTI/RTItypesImp.cc	2 Apr 2009 19:56:33 -0000
@@ -16,7 +16,7 @@
 // License along with this program ; if not, write to the Free Software
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 //
-// $Id: RTItypesImp.cc,v 3.1 2008/12/07 20:16:17 gotthardp Exp $
+// $Id: RTItypesImp.cc,v 3.1.4.1 2009/02/10 18:25:14 erk Exp $
 // ----------------------------------------------------------------------------
 
 #include "certi.hh"
@@ -30,12 +30,9 @@
 
 using namespace certi ;
 
-namespace {
-
 static PrettyDebug D("LIBRTI", __FILE__);
 static PrettyDebug G("GENDOC",__FILE__);
 
-}
 
 // ----------------------------------------------------------------------------
 AttributeHandleValuePairSetImp::AttributeHandleValuePairSetImp(ULong size)
@@ -539,4 +536,4 @@
         throw RTI::ArrayIndexOutOfBounds("Extent index above limit");
 }
 
-// $Id: RTItypesImp.cc,v 3.1 2008/12/07 20:16:17 gotthardp Exp $
+// $Id: RTItypesImp.cc,v 3.1.4.1 2009/02/10 18:25:14 erk Exp $
Index: RTIA/TimeManagement.cc
===================================================================
RCS file: /sources/certi/certi/RTIA/TimeManagement.cc,v
retrieving revision 3.45
diff -u -r3.45 TimeManagement.cc
--- RTIA/TimeManagement.cc	18 Sep 2008 14:41:27 -0000	3.45
+++ RTIA/TimeManagement.cc	2 Apr 2009 19:56:31 -0000
@@ -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.45 2008/09/18 14:41:27 gotthardp Exp $
+// $Id: TimeManagement.cc,v 3.45.4.1 2009/01/05 13:34:49 gotthardp Exp $
 // ----------------------------------------------------------------------------
 
 #include <config.h>
@@ -107,11 +107,11 @@
 
         comm->sendMessage(&msg);
         lastNullMessageDate = heure_logique ;
-        D.Out(pdDebug, "NULL message sent (Time = %f).", heure_logique) ;
+        D.Out(pdDebug, "NULL message sent (Time = %f).", heure_logique.getTime()) ;
     }
     else {
         D.Out(pdExcept, "NULL message not sent (Time = %f, Last = %f).",
-              heure_logique, lastNullMessageDate);
+              heure_logique.getTime(), lastNullMessageDate.getTime());
     }
 }
 
@@ -497,11 +497,7 @@
 
         _type_granted_state = AFTER_TAR_OR_NER ;  // will be
 
-        // FIXME Erk-->Pierre 
-        // We were changing lookahead value to epsilon
-        // when doing zero lookahead I'd rather handle
-        // _any_ near-to-zero lookahead as ZERO_LK
-        if (0==RTIfedTime::fcmp(_lookahead_courant,0.0)) {           
+        if (_lookahead_courant == 0.0) {
            _type_granted_state = AFTER_TAR_OR_NER_WITH_ZERO_LK ;
         }
 
@@ -572,7 +568,7 @@
     else
         dateMNET = (_LBTS <= dateTSO ? _LBTS : dateTSO) ;
 
-   D.Out(pdRegister, "Minimum Next Event Time : %f.", dateMNET);
+   D.Out(pdRegister, "Minimum Next Event Time : %f.", dateMNET.getTime());
 
    return dateMNET ;
 }
@@ -597,7 +593,7 @@
         if (_est_regulateur)
             sendNullMessage(_heure_courante);
 
-        D.Out(pdRegister, "New Lookahead : %f.", _lookahead_courant);
+        D.Out(pdRegister, "New Lookahead : %f.", _lookahead_courant.getTime());
     }
 }
 
@@ -680,7 +676,7 @@
     // Modifier lookahead courant 
     _lookahead_courant = the_lookahead;
           D.Out(pdDebug,
-    	        "New lookahead = %f",_lookahead_courant);
+    	        "New lookahead = %f",_lookahead_courant.getTime());
     // faudrait peut etre remplacer heure courante par le temps en parametre      
         msg.setDate(_heure_courante + _lookahead_courant);
 
@@ -722,35 +718,23 @@
 bool
 TimeManagement::testValidTime(FederationTime theTime)
 {
-   int compareResult;
-   // FIXME Erk-->Pierre
-   // We should use RTIfedTime object and not _plain_ double
-   // value
    if (_avancee_en_cours == PAS_D_AVANCEE) {
       if (_type_granted_state == AFTER_TAR_OR_NER_WITH_ZERO_LK) {
-    	 compareResult = RTIfedTime::fcmp(theTime,_heure_courante);
-    	 // if theTime <= _heure_courante
-         if (compareResult==-1 || compareResult==0)
+         if (theTime <= _heure_courante)
             return false;
       }
       else {  // AFTER_TAR_OR_NER or AFTER_TARA_OR_NARA
-    	 compareResult = RTIfedTime::fcmp(theTime,_heure_courante + _lookahead_courant);
-    	 // if theTime  < _heure_courante + _lookahead_courant
-         if (compareResult == -1)
+         if (theTime  < _heure_courante + _lookahead_courant)
             return false;
       }
    }
    else {
       if (_type_granted_state == AFTER_TAR_OR_NER_WITH_ZERO_LK) {
-    	 compareResult = RTIfedTime::fcmp(theTime,date_avancee);
-    	 // if theTime <= date_avancee
-         if (compareResult==-1 || compareResult==0)
+         if (theTime <= date_avancee)
             return false;
       }
       else {  // AFTER_TAR_OR_NER or AFTER_TARA_OR_NARA
-    	 compareResult = RTIfedTime::fcmp(theTime,date_avancee + _lookahead_courant);
-    	 // if (theTime  < date_avancee + _lookahead_courant)
-         if (compareResult == -1)
+         if (theTime  < date_avancee + _lookahead_courant)
             return false;
       }
    }
@@ -838,9 +822,9 @@
     if (_est_contraint) {
         // give a TSO message.
         if (_LBTS == std::numeric_limits<double>::infinity())
-           D.Out(pdDebug, "Logical time : %f, LBTS : infini.", date_avancee);
+           D.Out(pdDebug, "Logical time : %f, LBTS : infini.", date_avancee.getTime());
         else
-           D.Out(pdDebug, "Logical time : %f, LBTS : %lf.", date_avancee, _LBTS);
+           D.Out(pdDebug, "Logical time : %f, LBTS : %lf.", date_avancee.getTime(), _LBTS.getTime());
         min = (_LBTS<date_avancee)?(_LBTS):(date_avancee);
         msg = queues->giveTsoMessage(min, msg_donne, msg_restant);
 
@@ -849,10 +833,10 @@
             // if LBTS allows to give a timeAdvanceGrant.
             if (_LBTS == std::numeric_limits<double>::infinity())
                D.Out(pdDebug, "Logical time : %f, LBTS : infini, lookahead : %f.",
-                     date_avancee, _lookahead_courant);
+                     date_avancee.getTime(), _lookahead_courant.getTime());
             else
                D.Out(pdDebug, "Logical time : %15.12f, LBTS : %15.12f, lookahead : %f.",
-                     date_avancee, _LBTS, _lookahead_courant);
+                     date_avancee.getTime(), _LBTS.getTime(), _lookahead_courant.getTime());
 
             if ((date_avancee < _LBTS) || 
                ((date_avancee == _LBTS) && (_avancee_en_cours == TARA))) {
@@ -895,7 +879,7 @@
     req.setFederationTime(logical_time);
 
     D.Out(pdRegister, "timeAdvanceGrant sent to federate (time = %f).",
-          req.getFederationTime());
+          req.getFederationTime().getTime());
 
     _tick_state = TICK_NEXT;  // indicate the callback was processed
 
@@ -920,15 +904,13 @@
     if (_avancee_en_cours != PAS_D_AVANCEE)
         e = e_TimeAdvanceAlreadyInProgress ;
 
-    /* logical_time <_heure_courante */
-    if (RTIfedTime::fcmp(logical_time ,_heure_courante) < 0)
+    if (logical_time < _heure_courante)
         e = e_FederationTimeAlreadyPassed ;
     
-    /* logical_time < _heure_courante + _lookahead_courant */
-    if (RTIfedTime::fcmp(logical_time , _heure_courante + _lookahead_courant)<0) {
+    if (logical_time < _heure_courante + _lookahead_courant) {
     	
     D.Out(pdDebug,"InvalidFederation time lkahead=%f, current=%f, requested=%f",
-    			_lookahead_courant,_heure_courante,logical_time);
+    			_lookahead_courant.getTime(),_heure_courante.getTime(),logical_time.getTime());
        e = e_InvalidFederationTime ;
     }
 
@@ -936,11 +918,7 @@
 
         _type_granted_state = AFTER_TAR_OR_NER ;  // will be
 
-        // FIXME Erk-->Pierre 
-        // We were changing lookahead value to epsilon
-        // when doing zero lookahead I'd rather handle
-        // _any_ near-to-zero lookahead as ZERO_LK
-        if (0==RTIfedTime::fcmp(_lookahead_courant,0.0)) {         
+        if (_lookahead_courant == 0.0) {         
            _type_granted_state = AFTER_TAR_OR_NER_WITH_ZERO_LK ;
         }
 
@@ -951,7 +929,7 @@
         date_avancee = logical_time ;
 
         D.Out(pdTrace, "timeAdvanceRequest accepted (asked time=%f).",
-              date_avancee);
+              date_avancee.getTime());
     }
     else {
         D.Out(pdExcept, "timeAdvanceRequest refused (exception = %d).", e);
@@ -987,7 +965,7 @@
         date_avancee = logical_time ;
 
         D.Out(pdTrace, "timeAdvanceRequestAvailable accepted (asked time=%f).",
-              date_avancee);
+              date_avancee.getTime());
     }
     else {
         D.Out(pdExcept, "timeAdvanceRequestAvailable refused (exception = %d).", e);
@@ -997,4 +975,4 @@
 
 }} // namespaces
 
-// $Id: TimeManagement.cc,v 3.45 2008/09/18 14:41:27 gotthardp Exp $
+// $Id: TimeManagement.cc,v 3.45.4.1 2009/01/05 13:34:49 gotthardp Exp $
Index: RTIA/RTIA_network.cc
===================================================================
RCS file: /sources/certi/certi/RTIA/RTIA_network.cc,v
retrieving revision 3.30
diff -u -r3.30 RTIA_network.cc
--- RTIA/RTIA_network.cc	20 Nov 2008 18:21:55 -0000	3.30
+++ RTIA/RTIA_network.cc	2 Apr 2009 19:56:31 -0000
@@ -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: RTIA_network.cc,v 3.30 2008/11/20 18:21:55 approx Exp $
+// $Id: RTIA_network.cc,v 3.30.4.1 2009/01/05 13:34:49 gotthardp Exp $
 // ----------------------------------------------------------------------------
 
 #include <config.h>
@@ -52,7 +52,7 @@
       {
           D.Out(pdTrace,
                 "Receving Message from RTIG, type NetworkMessage::MESSAGE_NULL(%f).",
-                msg->getDate());
+                msg->getDate().getTime());
 
           tm->update(msg->federate, msg->getDate());
           delete msg ;
@@ -368,4 +368,4 @@
 
 }} // namespace certi/rtia
 
-// $Id: RTIA_network.cc,v 3.30 2008/11/20 18:21:55 approx Exp $
+// $Id: RTIA_network.cc,v 3.30.4.1 2009/01/05 13:34:49 gotthardp Exp $
Index: include/RTI.hh
===================================================================
RCS file: /sources/certi/certi/include/RTI.hh,v
retrieving revision 3.15
diff -u -r3.15 RTI.hh
--- include/RTI.hh	10 Dec 2008 17:42:43 -0000	3.15
+++ include/RTI.hh	2 Apr 2009 19:56:32 -0000
@@ -16,14 +16,14 @@
 	#else
 		#define RTI_EXPORT __declspec(dllimport)
 	#endif
-    #if !defined(FEDTIME_EXPORT)
-       #define FEDTIME_EXPORT
+    #if defined(FedTime_EXPORTS)
+        #define FEDTIME_EXPORT __declspec(dllexport)
+    #else
+        #define FEDTIME_EXPORT __declspec(dllimport)
     #endif
 #else
 	#define RTI_EXPORT
-    #if !defined(FEDTIME_EXPORT)
-        #define FEDTIME_EXPORT
-    #endif
+    #define FEDTIME_EXPORT
 #endif
 
 #ifdef RTI_USES_STD_FSTREAM
Index: include/certi.hh
===================================================================
RCS file: /sources/certi/certi/include/certi.hh,v
retrieving revision 3.39
diff -u -r3.39 certi.hh
--- include/certi.hh	18 Dec 2008 19:45:47 -0000	3.39
+++ include/certi.hh	2 Apr 2009 19:56:32 -0000
@@ -102,30 +102,29 @@
 
 namespace certi {
 
-// RTI Shortcuts
-typedef RTI::AttributeHandle AttributeHandle ;
-typedef RTI::DimensionHandle DimensionHandle ;
-typedef RTI::EventRetractionHandle EventRetractionHandle ;
-typedef RTI::ExtentIndex ExtentIndex ;
-typedef RTI::FederateHandle FederateHandle ;
-typedef RTI::Handle Handle ;
-typedef RTI::InteractionClassHandle InteractionClassHandle ;
-typedef RTI::ObjectClassHandle ObjectClassHandle ;
-typedef RTI::ObjectHandle ObjectHandle ;
-typedef RTI::OrderType OrderType ;
-typedef RTI::ParameterHandle ParameterHandle ;
-typedef RTI::SpaceHandle SpaceHandle ;
-typedef RTI::TransportType TransportType ;
-typedef RTI::ULong ULong ;
-typedef RTI::UShort UShort ;
+typedef unsigned short UShort;
+typedef unsigned long ULong;
+typedef long Long;
+typedef ULong Handle;
+typedef Handle ObjectClassHandle;
+typedef Handle InteractionClassHandle;
+typedef ULong ExtentIndex;
+typedef Handle AttributeHandle;
+typedef Handle ParameterHandle;
+typedef Handle ObjectHandle;
+typedef Handle DimensionHandle;
+typedef Handle FederateHandle;
+typedef Handle OrderType;
+typedef Long SpaceHandle;
+typedef Handle TransportType;
+
+typedef RTI::EventRetractionHandle EventRetractionHandle;
 
-typedef RTI::Double FederationTime ;
 typedef UShort ObjectHandlecount ;
 typedef std::string ObjectName_t ;
 typedef std::string AttributeValue_t;
 typedef std::string ParameterValue_t;
 
-typedef RTI::Double FederationTimeDelta ;
 enum ObjectRemovalReason {
     OUT_OF_REGION = 1,
     OBJECT_DELETED,
Index: include/baseTypes.hh
===================================================================
RCS file: /sources/certi/certi/include/baseTypes.hh,v
retrieving revision 3.13
diff -u -r3.13 baseTypes.hh
--- include/baseTypes.hh	7 Dec 2008 20:16:12 -0000	3.13
+++ include/baseTypes.hh	2 Apr 2009 19:56:32 -0000
@@ -35,10 +35,10 @@
 };
 
 #define RTI_EXCEPT(A) \
-class RTI_EXPORT A : public Exception { \
+class A : public Exception { \
 public: \
-    static const char *_ex ; \
-    static long type ; \
+    static RTI_EXPORT const char *_ex ; \
+    static RTI_EXPORT long type ; \
     A (const char *reason) : Exception(reason) { _name = #A ; this->displayMe();} \
     A (ULong serial, const char *reason = 0) \
         : Exception(serial, reason) { _name = #A ; this->displayMe(); } \
Index: include/fedtime.hh
===================================================================
RCS file: /sources/certi/certi/include/fedtime.hh,v
retrieving revision 3.12
diff -u -r3.12 fedtime.hh
--- include/fedtime.hh	10 Dec 2008 17:42:43 -0000	3.12
+++ include/fedtime.hh	2 Apr 2009 19:56:32 -0000
@@ -1,35 +1,16 @@
 // HLA 1.3 Header "fedtime.hh"
-// $Id: fedtime.hh,v 3.12 2008/12/10 17:42:43 gotthardp Exp $
+// $Id: fedtime.hh,v 3.12.4.1 2009/01/05 13:34:50 gotthardp Exp $
 
 #ifndef HLA_FEDTIME_HH
 #define HLA_FEDTIME_HH
 
-#ifdef _WIN32
-#include <windows.h>
-#else
+#include "RTI.hh"
 #include <sys/types.h>
 #include <string.h>
-#endif
-
-#if defined(_WIN32)
-    #if defined(FedTime_EXPORTS)
-        #define FEDTIME_EXPORT __declspec(dllexport)
-    #else
-        #define FEDTIME_EXPORT __declspec(dllimport)
-    #endif
-#else
-	#define FEDTIME_EXPORT
-#endif
-
-#include "RTI.hh"
 
 class FEDTIME_EXPORT RTIfedTime : public RTI::FedTime
 {
 public:
-
-	static const double epsilon;
-	static int fcmp(const double x1, const double x2);
-
     RTIfedTime();
     RTIfedTime(const RTI::Double &);
     RTIfedTime(const RTI::FedTime &);
@@ -146,4 +127,4 @@
 
 #endif // HLA_FEDTIME_HH
 
-// $Id: fedtime.hh,v 3.12 2008/12/10 17:42:43 gotthardp Exp $
+// $Id: fedtime.hh,v 3.12.4.1 2009/01/05 13:34:50 gotthardp Exp $
Index: include/RTItypes.hh
===================================================================
RCS file: /sources/certi/certi/include/RTItypes.hh,v
retrieving revision 3.19
diff -u -r3.19 RTItypes.hh
--- include/RTItypes.hh	10 Dec 2008 16:53:24 -0000	3.19
+++ include/RTItypes.hh	2 Apr 2009 19:56:32 -0000
@@ -330,7 +330,7 @@
 	throw (ArrayIndexOutOfBounds) = 0 ;
 } ;
 
-class RTI_EXPORT FedTime
+class FEDTIME_EXPORT FedTime
 {
 public:
     virtual ~FedTime(){};
Index: libHLA/HLAbuffer.hh
===================================================================
RCS file: /sources/certi/certi/libHLA/HLAbuffer.hh,v
retrieving revision 1.8
diff -u -r1.8 HLAbuffer.hh
--- libHLA/HLAbuffer.hh	18 Dec 2008 19:45:47 -0000	1.8
+++ libHLA/HLAbuffer.hh	2 Apr 2009 19:56:32 -0000
@@ -48,7 +48,7 @@
 
 namespace libhla {
 
-std::ostream& __print_buffer(std::ostream& stream, const void *buffer, size_t length);
+HLA_EXPORT std::ostream& __print_buffer(std::ostream& stream, const void *buffer, size_t length);
 
 /* Caution:
  * This implementation assumes that there are no compiler-generated data in
Index: libRTI/RTIfedTime.cc
===================================================================
RCS file: libRTI/RTIfedTime.cc
diff -N libRTI/RTIfedTime.cc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ libRTI/RTIfedTime.cc	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,501 @@
+// ----------------------------------------------------------------------------
+// CERTI - HLA RunTime Infrastructure
+// Copyright (C) 2002-2006  ONERA
+//
+// This file is part of CERTI-libCERTI
+//
+// CERTI-libCERTI is free software ; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public License
+// as published by the Free Software Foundation ; either version 2 of
+// the License, or (at your option) any later version.
+//
+// CERTI-libCERTI is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY ; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this program ; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// ----------------------------------------------------------------------------
+
+#include <math.h>
+
+#include "certi.hh"
+#include "fedtime.hh"
+#include "FedTimeD.hh"
+
+#include <algorithm>
+#include <limits>
+#include <sstream>
+#include <typeinfo>
+
+using std::stringstream ;
+
+namespace
+{
+
+// ----------------------------------------------------------------------------
+/** FedTime to RTIfedTime reference cast
+ */
+inline const RTIfedTime &
+rft(const RTI::FedTime &time)
+    throw (RTI::InvalidFederationTime)
+{
+    try {
+	return dynamic_cast<const RTIfedTime &>(time);
+    }
+    catch (std::bad_cast) {
+	//throw RTI::InvalidFederationTime("Could not cast to RTIfedTime");
+    }
+}
+
+inline bool
+is_infinity(const RTI::FedTime &time)
+{
+    return const_cast<RTI::FedTime &>(time).isPositiveInfinity() == RTI::RTI_TRUE ;
+}
+
+const char *infinity_str = "+inf" ;
+
+} // anonymous namespace
+
+// ----------------------------------------------------------------------------
+// FedTimeFactory
+RTI::FedTime *
+RTI::FedTimeFactory::makeZero()
+    throw (RTI::MemoryExhausted)
+{
+    try {
+        return new RTIfedTime();
+    }
+    catch (std::bad_alloc) {		
+        //throw RTI::MemoryExhausted("Cannot allocate RTI::FedTime.");
+    }
+}
+
+RTI::FedTime *
+RTI::FedTimeFactory::decode(const char *buf)
+    throw (RTI::MemoryExhausted)
+{
+    try {
+        return new RTIfedTime(*(const RTI::Double*)buf);
+    }
+    catch (std::bad_alloc) {
+        //throw RTI::MemoryExhausted("Cannot allocate RTI::FedTime.");
+    }
+}
+
+// ----------------------------------------------------------------------------
+// RTIfedTime
+RTIfedTime::RTIfedTime()
+    : _fedTime(0),
+      _zero(0),
+      _epsilon(std::numeric_limits<double>::epsilon()),
+      _positiveInfinity(std::numeric_limits<double>::infinity()) { }
+
+RTIfedTime::RTIfedTime(const RTI::Double &time)
+    : _fedTime(time),
+      _zero(0),
+      _epsilon(std::numeric_limits<double>::epsilon()),
+      _positiveInfinity(std::numeric_limits<double>::infinity()) { }
+
+RTIfedTime::RTIfedTime(const RTI::FedTime &time)
+    : _fedTime(rft(time).getTime()),
+      _zero(0),
+      _epsilon(std::numeric_limits<double>::epsilon()),
+      _positiveInfinity(std::numeric_limits<double>::infinity()) { }
+
+// ----------------------------------------------------------------------------
+RTIfedTime::RTIfedTime(const RTIfedTime &time)
+    : FedTime(),
+      _fedTime(time._fedTime),
+      _zero(time._zero),
+      _epsilon(time._epsilon),
+      _positiveInfinity(time._positiveInfinity) { }
+
+// ----------------------------------------------------------------------------
+RTIfedTime::~RTIfedTime()
+{
+}
+
+// ----------------------------------------------------------------------------
+void
+RTIfedTime::setZero()
+{
+    _fedTime = _zero;
+}
+
+// ----------------------------------------------------------------------------
+RTI::Boolean
+RTIfedTime::isZero()
+{
+    return RTI::Boolean(_fedTime == _zero);
+}
+
+// ----------------------------------------------------------------------------
+void
+RTIfedTime::setEpsilon()
+{
+    _fedTime = _epsilon;
+}
+
+// ----------------------------------------------------------------------------
+void
+RTIfedTime::setPositiveInfinity()
+{
+    _fedTime = _positiveInfinity;
+}
+
+// ----------------------------------------------------------------------------
+RTI::Boolean
+RTIfedTime::isPositiveInfinity()
+{
+    return RTI::Boolean(_fedTime == _positiveInfinity);
+}
+
+// ----------------------------------------------------------------------------
+int
+RTIfedTime::encodedLength() const
+{
+	// current implementation of RTIfedtime takes
+	// four IEEE-754 double values.
+	return (sizeof(_fedTime)+
+			sizeof(_zero)+
+			sizeof(_epsilon)+
+			sizeof(_positiveInfinity));
+}
+
+// ----------------------------------------------------------------------------
+void
+RTIfedTime::encode(char *buffer) const
+{
+    memcpy(buffer, &_fedTime, sizeof(RTI::Double));
+}
+
+// ----------------------------------------------------------------------------
+int
+RTIfedTime::getPrintableLength() const
+{
+    stringstream s ;
+
+    if (is_infinity(*this))
+	s << infinity_str ;
+    else
+	s << _fedTime ;
+
+    return s.str().length() + 1 ;
+}
+
+// ----------------------------------------------------------------------------
+void
+RTIfedTime::getPrintableString(char *str)
+{
+    stringstream s ;
+
+    if (is_infinity(*this))
+	s << infinity_str ;
+    else
+	s << _fedTime ;
+
+    s >> str ;
+    str[s.str().length()] = 0 ;
+}
+
+// ----------------------------------------------------------------------------
+RTI::FedTime &
+RTIfedTime::operator+=(const RTI::FedTime &time)
+    throw (RTI::InvalidFederationTime)
+{
+    _fedTime += rft(time)._fedTime ;
+    return *this;
+}
+
+// ----------------------------------------------------------------------------
+RTI::FedTime &
+RTIfedTime::operator-=(const RTI::FedTime &time)
+    throw (RTI::InvalidFederationTime)
+{
+    _fedTime -= rft(time)._fedTime ;
+    return *this;
+}
+
+// ----------------------------------------------------------------------------
+RTI::Boolean
+RTIfedTime::operator<=(const RTI::FedTime &time) const
+    throw (RTI::InvalidFederationTime)
+{
+    if (const_cast<RTI::FedTime &>(time).isPositiveInfinity())
+	return RTI::RTI_TRUE ;
+    else if (is_infinity(*this))
+	return RTI::RTI_FALSE ;
+    else
+	return RTI::Boolean(certi::fcmp(_fedTime, rft(time)._fedTime, _epsilon) <= 0);
+}
+
+// ----------------------------------------------------------------------------
+RTI::Boolean
+RTIfedTime::operator<(const RTI::FedTime &time) const
+    throw (RTI::InvalidFederationTime)
+{
+    if (is_infinity(*this))
+	return RTI::RTI_FALSE ;
+    else
+	return RTI::Boolean(is_infinity(time) || certi::fcmp(_fedTime, rft(time)._fedTime, _epsilon) < 0);
+}
+
+// ----------------------------------------------------------------------------
+RTI::Boolean
+RTIfedTime::operator>=(const RTI::FedTime &time) const
+    throw (RTI::InvalidFederationTime)
+{
+    if (is_infinity(*this))
+	return RTI::RTI_TRUE ;
+    else if (is_infinity(time))
+	return RTI::RTI_FALSE ;
+    else
+	return RTI::Boolean(certi::fcmp(_fedTime, rft(time)._fedTime, _epsilon) >= 0);
+}
+
+// ----------------------------------------------------------------------------
+RTI::Boolean
+RTIfedTime::operator>(const RTI::FedTime &time) const
+    throw (RTI::InvalidFederationTime)
+{
+    if (is_infinity(time))
+	return RTI::RTI_FALSE ;
+    else
+	return RTI::Boolean(is_infinity(*this) || certi::fcmp(_fedTime, rft(time)._fedTime, _epsilon) > 0);
+}
+
+// ----------------------------------------------------------------------------
+inline RTI::Boolean
+RTIfedTime::operator==(const RTI::FedTime &time) const
+    throw (RTI::InvalidFederationTime)
+{
+    if (is_infinity(*this) && is_infinity(time))
+	return RTI::RTI_TRUE ;
+    else if (is_infinity(*this) || is_infinity(time))
+	return RTI::RTI_FALSE ;
+    else
+	return RTI::Boolean(certi::fcmp(_fedTime, rft(time)._fedTime, _epsilon) == 0);
+}
+
+// ----------------------------------------------------------------------------
+RTI::FedTime &
+RTIfedTime::operator=(const RTI::FedTime &time)
+    throw (RTI::InvalidFederationTime)
+{
+    _fedTime = rft(time)._fedTime ;
+    return *this ;
+}
+
+// ----------------------------------------------------------------------------
+RTI::Double
+RTIfedTime::getTime() const
+{
+    return _fedTime ;
+}
+
+// ----------------------------------------------------------------------------
+RTI::Boolean
+RTIfedTime::operator==(const RTI::Double &time) const
+    throw (RTI::InvalidFederationTime)
+{
+    return RTI::Boolean(!is_infinity(*this) && certi::fcmp(_fedTime, time, _epsilon) == 0);
+}
+
+// ----------------------------------------------------------------------------
+RTI::Boolean
+RTIfedTime::operator!=(const RTI::FedTime &time) const
+    throw (RTI::InvalidFederationTime)
+{
+    return RTI::Boolean(certi::fcmp(_fedTime, rft(time)._fedTime, _epsilon) != 0);
+}
+
+// ----------------------------------------------------------------------------
+RTI::Boolean
+RTIfedTime::operator!=(const RTI::Double &time) const
+    throw (RTI::InvalidFederationTime)
+{
+    return RTI::Boolean(is_infinity(*this) || certi::fcmp(_fedTime, time, _epsilon) != 0);
+}
+
+// ----------------------------------------------------------------------------
+RTI::FedTime &
+RTIfedTime::operator=(const RTIfedTime &time)
+    throw (RTI::InvalidFederationTime)
+{
+    _fedTime = time._fedTime ;
+    return *this ;
+}
+
+// ----------------------------------------------------------------------------
+RTI::FedTime &
+RTIfedTime::operator=(const RTI::Double &time)
+    throw (RTI::InvalidFederationTime)
+{
+    _fedTime = time ;
+    return *this ;
+}
+
+RTI::FedTime &
+RTIfedTime::operator*=(const RTI::FedTime &time)
+    throw (RTI::InvalidFederationTime)
+{
+    _fedTime *= rft(time)._fedTime ;
+    return *this ;
+}
+
+RTI::FedTime &
+RTIfedTime::operator/=(const RTI::FedTime &time)
+    throw (RTI::InvalidFederationTime)
+{
+    _fedTime /= rft(time)._fedTime ;
+    return *this ;
+}
+
+RTI::FedTime &
+RTIfedTime::operator+=(const RTI::Double &time)
+    throw (RTI::InvalidFederationTime)
+{
+    _fedTime += time ;
+    return *this ;
+}
+
+RTI::FedTime &
+RTIfedTime::operator-=(const RTI::Double &time)
+    throw (RTI::InvalidFederationTime)
+{
+    _fedTime -= time ;
+    return *this ;
+}
+
+RTI::FedTime &
+RTIfedTime::operator*=(const RTI::Double &time)
+    throw (RTI::InvalidFederationTime)
+{
+    _fedTime *= time ;
+    return *this ;
+}
+
+RTI::FedTime &
+RTIfedTime::operator/=(const RTI::Double &time)
+    throw (RTI::InvalidFederationTime)
+{
+    _fedTime /= time ;
+    return *this ;
+}
+
+// ----------------------------------------------------------------------------
+RTIfedTime
+RTIfedTime::operator+(const RTI::FedTime &time)
+    throw (RTI::InvalidFederationTime)
+{
+    RTIfedTime fedtime = _fedTime + rft(time)._fedTime ;
+    return fedtime ;
+}
+
+RTIfedTime
+RTIfedTime::operator+(const RTI::Double &time)
+    throw (RTI::InvalidFederationTime)
+{
+    RTIfedTime fedtime = _fedTime + time ;
+    return fedtime ;
+}
+
+// ----------------------------------------------------------------------------
+RTIfedTime
+RTIfedTime::operator-(const RTI::FedTime &time)
+    throw (RTI::InvalidFederationTime)
+{
+    RTIfedTime fedtime = _fedTime - rft(time)._fedTime ;
+    return fedtime ;
+}
+
+RTIfedTime
+RTIfedTime::operator-(const RTI::Double &time)
+    throw (RTI::InvalidFederationTime)
+{
+    RTIfedTime fedtime = _fedTime - time ;
+    return fedtime ;
+}
+
+// ----------------------------------------------------------------------------
+RTIfedTime
+RTIfedTime::operator*(const RTI::FedTime &time)
+    throw (RTI::InvalidFederationTime)
+{
+    RTIfedTime fedtime = _fedTime * rft(time)._fedTime ;
+    return fedtime ;
+}
+
+RTIfedTime
+RTIfedTime::operator*(const RTI::Double &time)
+    throw (RTI::InvalidFederationTime)
+{
+    RTIfedTime fedtime = _fedTime * time ;
+    return fedtime ;
+}
+
+// ----------------------------------------------------------------------------
+RTIfedTime
+RTIfedTime::operator/(const RTI::FedTime &time)
+    throw (RTI::InvalidFederationTime)
+{
+    RTIfedTime fedtime = _fedTime / rft(time)._fedTime ;
+    return fedtime ;
+}
+
+RTIfedTime
+RTIfedTime::operator/(const RTI::Double &time)
+    throw (RTI::InvalidFederationTime)
+{
+    RTIfedTime fedtime = _fedTime / time ;
+    return fedtime ;
+}
+
+// ----------------------------------------------------------------------------
+std::ostream &
+operator<<(std::ostream &s, const RTI::FedTime &time)
+{
+    if (is_infinity(time))
+	s << infinity_str ;
+    else
+	s << rft(time).getTime();
+    return s ;
+}
+
+// ============================================================================
+
+// ----------------------------------------------------------------------------
+RTIfedTime
+operator+(const RTI::Double &d, const RTI::FedTime &time)
+{
+    RTIfedTime fedtime = d + rft(time).getTime();
+    return fedtime ;
+}
+
+// ----------------------------------------------------------------------------
+RTIfedTime
+operator-(const RTI::Double &d, const RTI::FedTime &time)
+{
+    RTIfedTime fedtime = d - rft(time).getTime();
+    return fedtime ;
+}
+
+// ----------------------------------------------------------------------------
+RTIfedTime
+operator*(const RTI::Double &d, const RTI::FedTime &time)
+{
+    RTIfedTime fedtime = d * rft(time).getTime();
+    return fedtime ;
+}
+
+// ----------------------------------------------------------------------------
+RTIfedTime
+operator/(const RTI::Double &d, const RTI::FedTime &time)
+{
+    RTIfedTime fedtime = d / rft(time).getTime();
+    return fedtime ;
+}
Index: libCERTI/FedTimeD.hh
===================================================================
RCS file: libCERTI/FedTimeD.hh
diff -N libCERTI/FedTimeD.hh
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ libCERTI/FedTimeD.hh	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,187 @@
+// ----------------------------------------------------------------------------
+// CERTI - HLA RunTime Infrastructure
+// Copyright (C) 2002-2005  ONERA
+//
+// This file is part of CERTI-libCERTI
+//
+// CERTI-libCERTI is free software ; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public License
+// as published by the Free Software Foundation ; either version 2 of
+// the License, or (at your option) any later version.
+//
+// CERTI-libCERTI is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY ; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this program ; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA
+//
+// $Id: FedTimeD.hh,v 1.1.2.2 2009/01/07 10:39:57 gotthardp Exp $
+// ----------------------------------------------------------------------------
+
+#ifndef CERTI_FEDTIMED_HH
+#define CERTI_FEDTIMED_HH
+
+#include "certi.hh"
+
+#include <math.h>
+#include <ostream>
+
+namespace certi {
+
+/*
+ fcmp
+ Copyright (c) 1998-2000 Theodore C. Belding
+ University of Michigan Center for the Study of Complex Systems
+ <mailto:Ted.Belding@umich.edu>
+ <http://fcmp.sourceforge.net>
+
+ This file is part of the fcmp distribution. fcmp is free software;
+ you can redistribute and modify it under the terms of the GNU Library
+ General Public License (LGPL), version 2 or later.  This software
+ comes with absolutely no warranty. See the file COPYING for details
+ and terms of copying.
+
+ Description:
+
+ Knuth's floating point comparison operators, from:
+ Knuth, D. E. (1998). The Art of Computer Programming.
+ Volume 2: Seminumerical Algorithms. 3rd ed. Addison-Wesley.
+ Section 4.2.2, p. 233. ISBN 0-201-89684-2.
+
+ Input parameters:
+ x1, x2: numbers to be compared
+ epsilon: determines tolerance
+
+ epsilon should be carefully chosen based on the machine's precision,
+ the observed magnitude of error, the desired precision, and the
+ magnitude of the numbers to be compared. See the fcmp README file for
+ more information.
+
+ This routine may be used for both single-precision (float) and
+ double-precision (double) floating-point numbers.
+
+ Returns:
+ -1 if x1 < x2
+  0 if x1 == x2
+  1 if x1 > x2
+*/
+
+inline int
+fcmp(double x1,double x2, double epsilon)
+{
+    int exponent;
+    double delta;
+    double difference;
+
+    /* Get exponent(max(fabs(x1), fabs(x2))) and store it in exponent. */
+
+    /* If neither x1 nor x2 is 0, */
+    /* this is equivalent to max(exponent(x1), exponent(x2)). */
+
+    /* If either x1 or x2 is 0, its exponent returned by frexp would be 0, */
+    /* which is much larger than the exponents of numbers close to 0 in */
+    /* magnitude. But the exponent of 0 should be less than any number */
+    /* whose magnitude is greater than 0. */
+
+    /* So we only want to set exponent to 0 if both x1 and */
+    /* x2 are 0. Hence, the following works for all x1 and x2. */
+
+    frexp(fabs(x1) > fabs(x2) ? x1 : x2, &exponent);
+
+    /* Do the comparison. */
+
+    /* delta = epsilon * pow(2, exponent) */
+
+    /* Form a neighborhood around x2 of size delta in either direction. */
+    /* If x1 is within this delta neighborhood of x2, x1 == x2. */
+    /* Otherwise x1 > x2 or x1 < x2, depending on which side of */
+    /* the neighborhood x1 is on. */
+
+    delta = ldexp(epsilon, exponent);
+
+    difference = x1 - x2;
+
+    if (difference > delta)
+        return 1; /* x1 > x2 */
+    else if (difference < -delta)
+        return -1;  /* x1 < x2 */
+    else /* -delta <= difference <= delta */
+        return 0;  /* x1 == x2 */
+}
+
+class CERTI_EXPORT FedTime
+{
+public:
+    static const double epsilon;
+    static int fcmp(const double x1, const double x2);
+
+    FedTime();
+    FedTime(const double &);
+    FedTime(const FedTime &);
+    ~FedTime();
+
+public:
+    void setZero();
+    bool isZero();
+    void setEpsilon();
+    void setPositiveInfinity();
+    bool isPositiveInfinity() const;
+    int encodedLength() const;
+    void encode(char *) const;
+    int getPrintableLength() const;
+    void getPrintableString(char *);
+    double getTime() const;
+
+    FedTime& operator+=(const FedTime &);
+    FedTime& operator-=(const FedTime &);
+    bool operator<=(const FedTime &) const;
+    bool operator<(const FedTime &) const;
+    bool operator>=(const FedTime &) const;
+    bool operator>(const FedTime &) const;
+    bool operator==(const FedTime &) const;
+    bool operator==(const double &) const;
+    bool operator!=(const FedTime &) const;
+    bool operator!=(const double &) const;
+    FedTime &operator=(const FedTime &);
+    FedTime &operator=(const double &);
+    FedTime &operator*=(const FedTime &);
+    FedTime &operator/=(const FedTime &);
+    FedTime &operator+=(const double &);
+    FedTime &operator-=(const double &);
+    FedTime &operator*=(const double &);
+    FedTime &operator/=(const double &);
+    FedTime operator+(const FedTime &);
+    FedTime operator+(const double &);
+    FedTime operator-(const FedTime &);
+    FedTime operator-(const double &);
+    FedTime operator*(const FedTime &);
+    FedTime operator*(const double &);
+    FedTime operator/(const FedTime &);
+    FedTime operator/(const double &);
+
+    friend std::ostream CERTI_EXPORT &operator<<(std::ostream&, const FedTime &time);
+
+private:
+    double _fedTime ;
+    double _zero ;
+    double _epsilon ;
+    double _positiveInfinity ;
+};
+
+FedTime operator+(const double &, const FedTime &);
+FedTime operator-(const double &, const FedTime &);
+FedTime operator*(const double &, const FedTime &);
+FedTime operator/(const double &, const FedTime &);
+
+typedef FedTime FederationTime;
+typedef FedTime FederationTimeDelta;
+
+} // namespace certi
+
+#endif // CERTI_FEDTIMED_HH
+
+// $Id: FedTimeD.hh,v 1.1.2.2 2009/01/07 10:39:57 gotthardp Exp $
