MAK RTIspy API Documentation for HLA 1516
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
LogicalTime.h
Go to the documentation of this file.
1 /***********************************************************************
2  IEEE 1516.1 High Level Architecture Interface Specification C++ API
3  File: RTI/LogicalTime.h
4 ***********************************************************************/
5 
6 #ifndef RTI_LogicalTime_h
7 #define RTI_LogicalTime_h
8 
9 // The classes associated with logical time allow a federation to provide their
10 // own representation for logical time and logical time interval. The federation
11 // is responsible to inherit from the abstract classes declared below. The
12 // encoded time classes are used to hold the arbitrary bit representation of the
13 // logical time and logical time intervals.
14 
15 namespace rti1516
16 {
17  class LogicalTimeInterval;
18 }
19 
20 #include <RTI/SpecificConfig.h>
21 #include <RTI/Exception.h>
22 #include <string>
23 #include <RTI/VariableLengthData.h>
24 
25 namespace rti1516
26 {
28  {
29  public:
30  virtual
31  ~LogicalTime()
32  throw () = 0;
33 
34  virtual
35  void
36  setInitial() = 0;
37 
38  virtual
39  bool
40  isInitial() const = 0;
41 
42  virtual
43  void
44  setFinal() = 0;
45 
46  virtual
47  bool
48  isFinal() const = 0;
49 
50  virtual
51  LogicalTime &
52  operator=(LogicalTime const & value)
53  throw (InvalidLogicalTime) = 0;
54 
55  virtual
56  LogicalTime &
57  operator+=(LogicalTimeInterval const & addend)
58  throw (IllegalTimeArithmetic, InvalidLogicalTimeInterval) = 0;
59 
60  virtual
61  LogicalTime &
62  operator-=(LogicalTimeInterval const & subtrahend)
63  throw (IllegalTimeArithmetic, InvalidLogicalTimeInterval) = 0;
64 
65  virtual
66  bool
67  operator>(LogicalTime const & value) const
68  throw (InvalidLogicalTime) = 0;
69 
70  virtual
71  bool
72  operator<(LogicalTime const & value) const
73  throw (InvalidLogicalTime) = 0;
74 
75  virtual
76  bool
77  operator==(LogicalTime const & value) const
78  throw (InvalidLogicalTime) = 0;
79 
80  virtual
81  bool
82  operator>=(LogicalTime const & value) const
83  throw (InvalidLogicalTime) = 0;
84 
85  virtual
86  bool
87  operator<=(LogicalTime const & value) const
88  throw (InvalidLogicalTime) = 0;
89 
90  // Generates an encoded value that can be used to send
91  // LogicalTimes to other federates in updates or interactions
92  virtual VariableLengthData encode() const = 0;
93 
94  // Alternate encode for directly filling a buffer
95  virtual unsigned long encodedLength() const = 0;
96  virtual unsigned long encode(void* buffer, unsigned long bufferSize) const
97  throw (CouldNotEncode) = 0;
98 
99  // Decode encodedLogicalTime into self
100  virtual void decode(VariableLengthData const & encodedLogicalTime)
101  throw (InternalError,
102  CouldNotDecode) = 0;
103 
104  // Alternate decode that reads directly from a buffer
105  virtual void decode(void* buffer, unsigned long bufferSize)
106  throw (InternalError,
107  CouldNotDecode) = 0;
108 
109  virtual std::wstring toString() const = 0;
110 
111  // Returns the name of the implementation, as needed by
112  // createFederationExecution.
113  virtual std::wstring implementationName() const = 0;
114  };
115 
116  // Output operator for LogicalTime
117  std::wostream RTI_EXPORT &
118  operator << (std::wostream &, LogicalTime const &);
119 }
120 
121 #endif // RTI_LogicalTime_h
#define RTI_EXPORT
Definition: SpecificConfig.h:55
std::string toString(const std::wstring &inString)
Definition: objParams13.h:16
Definition: LogicalTimeInterval.h:27
his file contains a class to hold an arbitrary array of bytes for encoded values, attribute values...
This file contains definitions that are used to isolate platform-specific elements of the API...
Definition: VariableLengthData.h:22
Definition: LogicalTime.h:27
std::wostream RTI_EXPORT & operator<<(std::wostream &, Exception const &)

Document ID: Generated on Thu May 11 15:55:32 EDT 2023 from SVN revision 254743
Copyright © 2005-2020 MAK Technologies Inc. All Rights Reserved (www.mak.com)