MAK RTIspy API Documentation for HLA Evolved
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
LogicalTimeInterval.h
Go to the documentation of this file.
1 /***********************************************************************
2  The IEEE hereby grants a general, royalty-free license to copy, distribute,
3  display and make derivative works from this material, for all purposes,
4  provided that any use of the material contains the following
5  attribution: "Reprinted with permission from IEEE 1516.1(TM)-2010".
6  Should you require additional information, contact the Manager, Standards
7  Intellectual Property, IEEE Standards Association (stds-ipr@ieee.org).
8 ***********************************************************************/
9 /***********************************************************************
10  IEEE 1516.1 High Level Architecture Interface Specification C++ API
11  File: RTI/LogicalTimeInterval.h
12 ***********************************************************************/
13 
14 #ifndef RTI_LogicalTimeInterval_h
15 #define RTI_LogicalTimeInterval_h
16 
17 // The classes associated with logical time allow a federation to provide
18 // their own representation for logical time and logical time interval. The
19 // federation is responsible to inherit from the abstract classes declared
20 // below. The encoded time classes are used to hold the arbitrary bit
21 // representation of the logical time and logical time intervals.
22 
23 namespace rti1516e
24 {
25  class LogicalTime;
26 }
27 
28 #include <RTI/SpecificConfig.h>
29 #include <RTI/Exception.h>
30 #include <string>
31 #include <RTI/VariableLengthData.h>
32 
33 namespace rti1516e
34 {
36  {
37  public:
38  // Destructor
39  virtual ~LogicalTimeInterval ()
40  throw () = 0;
41 
42  // Basic accessors/mutators
43 
44  virtual void setZero () = 0;
45 
46  virtual bool isZero () const = 0;
47 
48  virtual void setEpsilon () = 0;
49 
50  virtual bool isEpsilon () const = 0;
51 
52  // Operators
53 
54  virtual LogicalTimeInterval & operator= (
55  LogicalTimeInterval const & value)
56  throw (
57  InvalidLogicalTimeInterval) = 0;
58 
59  virtual LogicalTimeInterval & operator+= (
60  LogicalTimeInterval const & addend)
61  throw (
62  IllegalTimeArithmetic,
63  InvalidLogicalTimeInterval) = 0;
64 
65  virtual LogicalTimeInterval & operator-= (
66  LogicalTimeInterval const & subtrahend)
67  throw (
68  IllegalTimeArithmetic,
69  InvalidLogicalTimeInterval) = 0;
70 
71  virtual bool operator> (
72  LogicalTimeInterval const & value) const
73  throw (
74  InvalidLogicalTimeInterval) = 0;
75 
76  virtual bool operator< (
77  LogicalTimeInterval const & value) const
78  throw (
79  InvalidLogicalTimeInterval) = 0;
80 
81  virtual bool operator== (
82  LogicalTimeInterval const & value) const
83  throw (
84  InvalidLogicalTimeInterval) = 0;
85 
86  virtual bool operator>= (
87  LogicalTimeInterval const & value) const
88  throw (
89  InvalidLogicalTimeInterval) = 0;
90 
91  virtual bool operator<= (
92  LogicalTimeInterval const & value) const
93  throw (
94  InvalidLogicalTimeInterval) = 0;
95 
96  // Set self to the difference between two LogicalTimes
97  virtual void setToDifference (
98  LogicalTime const & minuend,
99  LogicalTime const& subtrahend)
100  throw (
101  IllegalTimeArithmetic,
102  InvalidLogicalTime) = 0;
103 
104  // Generates an encoded value that can be used to send
105  // LogicalTimeIntervals to other federates in updates or interactions
106  virtual VariableLengthData encode () const = 0;
107 
108  // Alternate encode for directly filling a buffer
109  virtual size_t encode (
110  void* buffer,
111  size_t bufferSize) const
112  throw (
113  CouldNotEncode) = 0;
114 
115  // The length of the encoded data
116  virtual size_t encodedLength () const = 0;
117 
118  // Decode encodedValue into self
119  virtual void decode (
120  VariableLengthData const & encodedValue)
121  throw (
122  InternalError,
123  CouldNotDecode) = 0;
124 
125  // Alternate decode that reads directly from a buffer
126  virtual void decode (
127  void* buffer,
128  size_t bufferSize)
129  throw (
130  InternalError,
131  CouldNotDecode) = 0;
132 
133  // Diagnostic string representation of time interval
134  virtual std::wstring toString () const = 0;
135 
136  // Return the name of the implementation, as needed by
137  // createFederationExecution.
138  virtual std::wstring implementationName () const = 0;
139  };
140 
141  // Output operator for LogicalTimeInterval
142  std::wostream RTI_EXPORT & operator << (
143  std::wostream &,
144  LogicalTimeInterval const &);
145 }
146 #endif // RTI_LogicalTimeInterval_h
Definition: LogicalTimeInterval.h:35
#define RTI_EXPORT
Definition: SpecificConfig.h:63
Definition: LogicalTime.h:35
std::string toString(const std::wstring &inString)
Definition: objParams13.h:16
Definition: VariableLengthData.h:34
his file contains a class to hold an arbitrary array of bytes for encoded values, attribute values...
std::wostream RTI_EXPORT & operator<<(std::wostream &, Exception const &)
This file contains definitions that are used to isolate platform-specific elements of the API...

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)