MAK RTIspy API Documentation for HLA Evolved
 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  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/LogicalTime.h
12 ***********************************************************************/
13 
14 #ifndef RTI_LogicalTime_h
15 #define RTI_LogicalTime_h
16 
17 // The classes associated with logical time allow a federation to provide their
18 // own representation for logical time and logical time interval. The federation
19 // is responsible to inherit from the abstract classes declared below. The
20 // encoded time classes are used to hold the arbitrary bit representation of the
21 // logical time and logical time intervals.
22 
23 namespace rti1516e
24 {
25  class LogicalTimeInterval;
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 ~LogicalTime ()
40  throw () = 0;
41 
42  // Basic accessors/mutators
43 
44  virtual void setInitial () = 0;
45 
46  virtual bool isInitial () const = 0;
47 
48  virtual void setFinal () = 0;
49 
50  virtual bool isFinal () const = 0;
51 
52  // Operators
53 
54  virtual LogicalTime & operator= (
55  LogicalTime const & value)
56  throw (
57  InvalidLogicalTime) = 0;
58 
59  virtual LogicalTime & operator+= (
60  LogicalTimeInterval const & addend)
61  throw (
62  IllegalTimeArithmetic,
63  InvalidLogicalTimeInterval) = 0;
64 
65  virtual LogicalTime & operator-= (
66  LogicalTimeInterval const & subtrahend)
67  throw (
68  IllegalTimeArithmetic,
69  InvalidLogicalTimeInterval) = 0;
70 
71  virtual bool operator> (
72  LogicalTime const & value) const
73  throw (
74  InvalidLogicalTime) = 0;
75 
76  virtual bool operator< (
77  LogicalTime const & value) const
78  throw (
79  InvalidLogicalTime) = 0;
80 
81  virtual bool operator== (
82  LogicalTime const & value) const
83  throw (
84  InvalidLogicalTime) = 0;
85 
86  virtual bool operator>= (
87  LogicalTime const & value) const
88  throw (
89  InvalidLogicalTime) = 0;
90 
91  virtual bool operator<= (
92  LogicalTime const & value) const
93  throw (
94  InvalidLogicalTime) = 0;
95 
96  // Generates an encoded value that can be used to send
97  // LogicalTimes to other federates in updates or interactions
98  virtual VariableLengthData encode () const = 0;
99 
100  // Alternate encode for directly filling a buffer
101  virtual size_t encode (
102  void* buffer,
103  size_t bufferSize) const
104  throw (
105  CouldNotEncode) = 0;
106 
107  // The length of the encoded data
108  virtual size_t encodedLength () const = 0;
109 
110  // Decode encodedLogicalTime into self
111  virtual void decode (
112  VariableLengthData const & encodedLogicalTime)
113  throw (
114  InternalError,
115  CouldNotDecode) = 0;
116 
117  // Alternate decode that reads directly from a buffer
118  virtual void decode (
119  void* buffer,
120  size_t bufferSize)
121  throw (
122  InternalError,
123  CouldNotDecode) = 0;
124 
125  // Diagnostic string representation of time
126  virtual std::wstring toString () const = 0;
127 
128  // Return the name of the implementation, as needed by
129  // createFederationExecution.
130  virtual std::wstring implementationName () const = 0;
131  };
132 
133  // Output operator for LogicalTime
134  std::wostream RTI_EXPORT & operator << (
135  std::wostream &,
136  LogicalTime const &);
137 }
138 
139 #endif // RTI_LogicalTime_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 Mon Sep 7 15:40:32 EDT 2020 from SVN revision 217499
Copyright © 2005-2020 MAK Technologies Inc. All Rights Reserved (www.mak.com)