![]() |
MAK RTIspy API Documentation for HLA 1516
|
00001 /*********************************************************************** 00002 IEEE 1516.1 High Level Architecture Interface Specification C++ API 00003 File: RTI/LogicalTimeInterval.h 00004 ***********************************************************************/ 00005 00006 #ifndef RTI_LogicalTimeInterval_h 00007 #define RTI_LogicalTimeInterval_h 00008 00009 // The classes associated with logical time allow a federation to provide 00010 // their own representation for logical time and logical time interval. The 00011 // federation is responsible to inherit from the abstract classes declared 00012 // below. The encoded time classes are used to hold the arbitrary bit 00013 // representation of the logical time and logical time intervals. 00014 00015 namespace rti1516 00016 { 00017 class LogicalTime; 00018 } 00019 00020 #include <RTI/SpecificConfig.h> 00021 #include <RTI/Exception.h> 00022 #include <string> 00023 #include <RTI/VariableLengthData.h> 00024 00025 namespace rti1516 00026 { 00027 class RTI_EXPORT LogicalTimeInterval 00028 { 00029 public: 00030 virtual 00031 ~LogicalTimeInterval() 00032 throw () = 0; 00033 00034 virtual 00035 void 00036 setZero() = 0; 00037 00038 virtual 00039 bool 00040 isZero() const = 0; 00041 00042 virtual 00043 void 00044 setEpsilon() = 0; 00045 00046 virtual 00047 bool 00048 isEpsilon() const = 0; 00049 00050 virtual 00051 LogicalTimeInterval & 00052 operator=(LogicalTimeInterval const & value) 00053 throw (InvalidLogicalTimeInterval) = 0; 00054 00055 // Set self to the difference between two LogicalTimes 00056 virtual 00057 void 00058 setToDifference(LogicalTime const & minuend, 00059 LogicalTime const& subtrahend) 00060 throw (InvalidLogicalTime) = 0; 00061 00062 virtual 00063 LogicalTimeInterval & 00064 operator+=(LogicalTimeInterval const & addend) 00065 throw (InvalidLogicalTimeInterval) = 0; 00066 00067 virtual 00068 LogicalTimeInterval & 00069 operator-=(LogicalTimeInterval const & subtrahend) 00070 throw (InvalidLogicalTimeInterval) = 0; 00071 00072 virtual 00073 bool 00074 operator>(LogicalTimeInterval const & value) const 00075 throw (InvalidLogicalTimeInterval) = 0; 00076 00077 virtual 00078 bool 00079 operator<(LogicalTimeInterval const & value) const 00080 throw (InvalidLogicalTimeInterval) = 0; 00081 00082 virtual 00083 bool 00084 operator==(LogicalTimeInterval const & value) const 00085 throw (InvalidLogicalTimeInterval) = 0; 00086 00087 virtual 00088 bool 00089 operator>=(LogicalTimeInterval const & value) const 00090 throw (InvalidLogicalTimeInterval) = 0; 00091 00092 virtual 00093 bool 00094 operator<=(LogicalTimeInterval const & value) const 00095 throw (InvalidLogicalTimeInterval) = 0; 00096 00097 // Generates an encoded value that can be used to send 00098 // LogicalTimeIntervals to other federates in updates or interactions 00099 virtual VariableLengthData encode() const = 0; 00100 00101 // Alternate encode for directly filling a buffer 00102 virtual unsigned long encodedLength() const = 0; 00103 virtual unsigned long encode(void* buffer, unsigned long bufferSize) const 00104 throw (CouldNotEncode) = 0; 00105 00106 // Decode encodedValue into self 00107 virtual void decode(VariableLengthData const & encodedValue) 00108 throw (InternalError, 00109 CouldNotDecode) = 0; 00110 00111 // Alternate decode that reads directly from a buffer 00112 virtual void decode(void* buffer, unsigned long bufferSize) 00113 throw (InternalError, 00114 CouldNotDecode) = 0; 00115 00116 virtual std::wstring toString() const = 0; 00117 00118 // Returns the name of the implementation, as needed by 00119 // createFederationExecution. 00120 virtual std::wstring implementationName() const = 0; 00121 }; 00122 00123 // Output operator for LogicalTimeInterval 00124 std::wostream RTI_EXPORT & 00125 operator << (std::wostream &, LogicalTimeInterval const &); 00126 } 00127 #endif // RTI_LogicalTimeInterval_h