MAK RTIspy API Documentation for HLA 4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
LogicalTimeInterval.h
Go to the documentation of this file.
1 #pragma once
2 /***********************************************************************
3  The IEEE hereby grants a general, royalty-free license to copy, distribute,
4  display and make derivative works from this material, for all purposes,
5  provided that any use of the material contains the following
6  attribution: "Reprinted with permission from IEEE 1516.1(TM)-2025".
7  Should you require additional information, contact the Manager, Standards
8  Intellectual Property, IEEE Standards Association (stds-ipr@ieee.org).
9 ***********************************************************************/
10 
11 // The classes associated with logical time allow a federation to provide
12 // their own representation for logical time and logical time interval. The
13 // federation is responsible to inherit from the abstract classes declared
14 // below. The encoded time classes are used to hold the arbitrary bit
15 // representation of the logical time and logical time intervals.
16 
17 namespace rti1516_2025
18 {
19  class LogicalTime;
20 }
21 
22 #include <RTI/SpecificConfig.h>
23 #include <RTI/Exception.h>
24 #include <string>
25 #include <ostream>
26 #include <RTI/VariableLengthData.h>
27 
28 namespace rti1516_2025
29 {
31  {
32  public:
33  // Destructor
34  virtual ~LogicalTimeInterval ()
35  noexcept = default;
36 
37  // Basic accessors/mutators
38 
39  virtual void setZero () = 0;
40 
41  virtual bool isZero () const = 0;
42 
43  virtual void setEpsilon () = 0;
44 
45  virtual bool isEpsilon () const = 0;
46 
47  // Operators
48 
52  virtual LogicalTimeInterval & operator= (
53  LogicalTimeInterval const & value) = 0;
54 
58  virtual LogicalTimeInterval & operator+= (
59  LogicalTimeInterval const & addend) = 0;
60 
64  virtual LogicalTimeInterval & operator-= (
65  LogicalTimeInterval const & subtrahend) = 0;
66 
70  virtual bool operator> (
71  LogicalTimeInterval const & value) const = 0;
72 
76  virtual bool operator< (
77  LogicalTimeInterval const & value) const = 0;
78 
82  virtual bool operator== (
83  LogicalTimeInterval const & value) const = 0;
84 
88  virtual bool operator>= (
89  LogicalTimeInterval const & value) const = 0;
90 
94  virtual bool operator<= (
95  LogicalTimeInterval const & value) const = 0;
96 
102  virtual void setToDifference (
103  LogicalTime const & minuend,
104  LogicalTime const& subtrahend) = 0;
105 
106  // Generates an encoded value that can be used to send
107  // LogicalTimeIntervals to other federates in updates or interactions
108  virtual VariableLengthData encode () const = 0;
109 
114  virtual size_t encode (
115  void* buffer,
116  size_t bufferSize) const = 0;
117 
118  // The length of the encoded data
119  virtual size_t encodedLength () const = 0;
120 
126  virtual void decode (
127  VariableLengthData const & encodedValue) = 0;
128 
134  virtual void decode (
135  const void* buffer,
136  size_t bufferSize) = 0;
137 
138  // Diagnostic string representation of time interval
139  virtual std::wstring toString () const = 0;
140 
141  // Return the name of the implementation, as needed by
142  // createFederationExecution.
143  virtual std::wstring implementationName () const = 0;
144  };
145 
146  // Output operator for LogicalTimeInterval
147  std::wostream RTI_EXPORT & operator << (
148  std::wostream &,
149  LogicalTimeInterval const &);
150 }
151 
Definition: LogicalTime.h:30
#define RTI_EXPORT
Definition: SpecificConfig.h:45
std::string toString(const std::wstring &inString)
Definition: objParams13.h:16
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...
std::wostream RTI_EXPORT & operator<<(std::wostream &, Exception const &)
Definition: VariableLengthData.h:28
Definition: LogicalTimeInterval.h:30

Document ID: Generated on Sun Jul 20 16:15:30 EDT 2025 from SVN revision 277985
Copyright © 2005-2025 MAK Technologies Inc. All Rights Reserved (www.mak.com)