![]() |
MAK RTIspy API Documentation for HLA 1.3
|
00001 /******************************************************************************* 00002 ** Copyright (c) 2003 MaK Technologies, Inc. 00003 ** All rights reserved. 00004 *******************************************************************************/ 00005 /******************************************************************************* 00006 ** $RCSfile: logicalTimeImpl.h,v $ $Revision: 1.1 $ $State: Exp $ 00007 *******************************************************************************/ 00008 00009 #ifndef RTI_LogicalTimeImpl_H_ 00010 #define RTI_LogicalTimeImpl_H_ 00011 00012 #include <RTI/LogicalTime.h> 00013 #include "logicalTimeIntervalImpl.h" 00014 00015 // Depreciated: Use specific implementation 00016 class RTI_EXPORT_FEDTIME LogicalTimeImpl : public rti1516::LogicalTime 00017 { 00018 public: 00019 // Constructors 00020 LogicalTimeImpl(); 00021 LogicalTimeImpl(double const & value); 00022 LogicalTimeImpl(rti1516::LogicalTime const & value); 00023 LogicalTimeImpl(LogicalTimeImpl const & value); 00024 00025 // Destructor 00026 virtual ~LogicalTimeImpl() 00027 throw (); 00028 00029 // Basic accessors/mutators 00030 virtual void setInitial(); 00031 virtual bool isInitial() const; 00032 00033 virtual void setFinal(); 00034 virtual bool isFinal() const; 00035 00036 // Assignment 00037 virtual rti1516::LogicalTime& operator= (rti1516::LogicalTime const & value) 00038 throw ( 00039 rti1516::InvalidLogicalTime); 00040 00041 virtual 00042 rti1516::LogicalTime& 00043 operator+= (rti1516::LogicalTimeInterval const & addend) 00044 throw ( 00045 rti1516::IllegalTimeArithmetic, 00046 rti1516::InvalidLogicalTimeInterval); 00047 00048 virtual 00049 rti1516::LogicalTime& 00050 operator-= (rti1516::LogicalTimeInterval const & subtrahend) 00051 throw ( 00052 rti1516::IllegalTimeArithmetic, 00053 rti1516::InvalidLogicalTimeInterval); 00054 00055 virtual 00056 bool 00057 operator> (rti1516::LogicalTime const & value) const 00058 throw ( 00059 rti1516::InvalidLogicalTime); 00060 00061 virtual 00062 bool 00063 operator< (rti1516::LogicalTime const & value) const 00064 throw ( 00065 rti1516::InvalidLogicalTime); 00066 00067 virtual 00068 bool 00069 operator== (rti1516::LogicalTime const & value) const 00070 throw ( 00071 rti1516::InvalidLogicalTime); 00072 00073 virtual 00074 bool 00075 operator>= (rti1516::LogicalTime const & value) const 00076 throw ( 00077 rti1516::InvalidLogicalTime); 00078 00079 virtual 00080 bool 00081 operator<= (rti1516::LogicalTime const & value) const 00082 throw ( 00083 rti1516::InvalidLogicalTime); 00084 00085 // Generates an encoded value that can be used to send 00086 // LogicalTimes to other federates in updates or interactions 00087 virtual rti1516::VariableLengthData encode() const; 00088 00089 // Alternate encode for directly filling a buffer 00090 virtual unsigned long encodedLength() const; 00091 virtual unsigned long encode(void* buffer, unsigned long bufferSize) const 00092 throw (rti1516::CouldNotEncode); 00093 00094 // Decode VariableLengthData into self 00095 virtual void decode(rti1516::VariableLengthData const & VariableLengthData) 00096 throw ( 00097 rti1516::InternalError, 00098 rti1516::CouldNotDecode); 00099 00100 // Alternate decode that reads directly from a buffer 00101 virtual void decode(void* buffer, unsigned long bufferSize) 00102 throw ( 00103 rti1516::InternalError, 00104 rti1516::CouldNotDecode); 00105 00106 virtual std::wstring toString() const; 00107 00108 // Returns the name of the implementation, as needed by 00109 // createFederationExecution. 00110 virtual std::wstring implementationName() const; 00111 00112 public: 00113 //----------------------------------------------------------------- 00114 // Implementation functions 00115 //----------------------------------------------------------------- 00116 virtual double getTime() const; 00117 00118 //----------------------------------------------------------------- 00119 // Implementation operators 00120 //----------------------------------------------------------------- 00121 virtual LogicalTimeImpl& operator= (const LogicalTimeImpl&) 00122 throw (rti1516::InvalidLogicalTime); 00123 00124 virtual rti1516::LogicalTime& operator= (double const & value) 00125 throw (rti1516::InvalidLogicalTime); 00126 00127 virtual rti1516::LogicalTime& operator+= (double const & value) 00128 throw (rti1516::InvalidLogicalTime); 00129 00130 virtual rti1516::LogicalTime& operator-= (double const & value) 00131 throw (rti1516::InvalidLogicalTime); 00132 00133 virtual bool operator== (double const & value) const 00134 throw (rti1516::InvalidLogicalTime); 00135 00136 virtual bool operator!= (double const & value) const 00137 throw (rti1516::InvalidLogicalTime); 00138 00139 virtual bool operator!= (rti1516::LogicalTime const & value) const 00140 throw (rti1516::InvalidLogicalTime); 00141 00142 virtual bool operator> (double const & value) const 00143 throw (rti1516::InvalidLogicalTime); 00144 00145 virtual bool operator< (double const & value) const 00146 throw (rti1516::InvalidLogicalTime); 00147 00148 virtual bool operator>= (double const & value) const 00149 throw (rti1516::InvalidLogicalTime); 00150 00151 virtual bool operator<= (double const & value) const 00152 throw (rti1516::InvalidLogicalTime); 00153 00154 private: 00155 00156 friend class LogicalTimeIntervalImpl; 00157 00158 //----------------------------------------------------------------- 00159 // Implementation member variables 00160 //----------------------------------------------------------------- 00161 double myLogicalTime; 00162 double myZero; 00163 double myEpsilon; 00164 double myPositiveInfinity; 00165 }; 00166 00167 #endif // RTI_LogicalTimeImpl_H_