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