MAK RTIspy API Documentation for HLA 4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
LogicalTime.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 their
12 // own representation for logical time and logical time interval. The federation
13 // is responsible to inherit from the abstract classes declared below. The
14 // encoded time classes are used to hold the arbitrary bit representation of the
15 // logical time and logical time intervals.
16 
17 namespace rti1516_2025
18 {
19  class LogicalTimeInterval;
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 ~LogicalTime () noexcept = default;
35 
36  // Basic accessors/mutators
37 
38  virtual void setInitial () = 0;
39 
40  virtual bool isInitial () const = 0;
41 
42  virtual void setFinal () = 0;
43 
44  virtual bool isFinal () const = 0;
45 
46  // Operators
47 
51  virtual LogicalTime & operator= (
52  LogicalTime const & value) = 0;
53 
57  virtual LogicalTime & operator+= (
58  LogicalTimeInterval const & addend) = 0;
59 
63  virtual LogicalTime & operator-= (
64  LogicalTimeInterval const & subtrahend) = 0;
65 
69  virtual bool operator> (
70  LogicalTime const & value) const = 0;
71 
75  virtual bool operator< (
76  LogicalTime const & value) const = 0;
77 
81  virtual bool operator== (
82  LogicalTime const & value) const = 0;
83 
87  virtual bool operator>= (
88  LogicalTime const & value) const = 0;
89 
93  virtual bool operator<= (
94  LogicalTime const & value) const = 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
104  virtual size_t encode (
105  void* buffer,
106  size_t bufferSize) const = 0;
107 
108  // The length of the encoded data
109  virtual size_t encodedLength () const = 0;
110 
111  // Decode encodedLogicalTime into self
116  virtual void decode (
117  VariableLengthData const & encodedLogicalTime) = 0;
118 
119  // Alternate decode that reads directly from a buffer
124  virtual void decode (
125  const void* buffer,
126  size_t bufferSize) = 0;
127 
128  // Diagnostic string representation of time
129  virtual std::wstring toString () const = 0;
130 
131  // Return the name of the implementation, as needed by
132  // createFederationExecution.
133  virtual std::wstring implementationName () const = 0;
134  };
135 
136  // Output operator for LogicalTime
137  std::wostream RTI_EXPORT & operator << (
138  std::wostream &,
139  LogicalTime const &);
140 }
141 
142 
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 Wed Jul 8 16:20:32 EDT 2026 from SVN revision 291616
Copyright © 2005-2025 MAK Technologies Inc. All Rights Reserved (www.mak.com)