MAK RTIspy API Documentation for HLA 1516
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
logicalTimeIntervalImplFloat.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2005 MaK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 /*******************************************************************************
6 ** $RCSfile: logicalTimeIntervalImplFloat.h,v $ $Revision: 1.1 $ $State: Exp $
7 *******************************************************************************/
8 
9 #ifndef RTI_LogicalTimeIntervalImplFloat_H_
10 #define RTI_LogicalTimeIntervalImplFloat_H_
11 
13 
14 // Old deprecated stuff, keeping it here in case we support these platforms again
15 // #if !WIN32 && !VXWORKS && !VMS && !__darwin__
16 // #include <values.h>
17 // #else
18 // #if VMS
19 // #include <limits>
20 // #define MAXDOUBLE numeric_limits<double>::max()
21 // #endif
22 
23 #include <float.h>
24 #define POSITIVE_INFINITY (DBL_MAX)
25 #define NEGATIVE_INFINITY (-DBL_MAX)
26 #define EPSILON (DBL_MIN)
27 #ifdef _WIN32
28 #define nextafter _nextafter
29 #endif
30 
33 {
34 public:
35  static std::wstring theImplementationName;
36 
37 public:
38 
39  // Constructors
41  LogicalTimeIntervalImplFloat(const double&);
44 
45  // Destructor
47  throw ();
48 
49  // Basic accessors/mutators
50  virtual void setZero();
51  virtual bool isZero() const;
52 
53  virtual void setEpsilon();
54  virtual bool isEpsilon() const;
55 
56  // Assignment
57  virtual
58  rti1516::LogicalTimeInterval&
59  operator= (rti1516::LogicalTimeInterval const & value)
60  throw (
61  rti1516::InvalidLogicalTimeInterval);
62 
63  // Set self to the difference between two LogicalTimes
64  virtual
65  void
66  setToDifference(rti1516::LogicalTime const & minuend,
67  rti1516::LogicalTime const& subtrahend)
68  throw (rti1516::InvalidLogicalTime);
69 
70  virtual
71  rti1516::LogicalTimeInterval&
72  operator+= (rti1516::LogicalTimeInterval const & addend)
73  throw (
74  rti1516::InvalidLogicalTimeInterval);
75 
76  virtual
77  rti1516::LogicalTimeInterval&
78  operator-= (rti1516::LogicalTimeInterval const & subtrahend)
79  throw (
80  rti1516::InvalidLogicalTimeInterval);
81 
82  virtual
83  bool
84  operator> (rti1516::LogicalTimeInterval const & value) const
85  throw (
86  rti1516::InvalidLogicalTimeInterval);
87 
88  virtual
89  bool
90  operator< (rti1516::LogicalTimeInterval const & value) const
91  throw (
92  rti1516::InvalidLogicalTimeInterval);
93 
94  virtual
95  bool
96  operator== (rti1516::LogicalTimeInterval const & value) const
97  throw (
98  rti1516::InvalidLogicalTimeInterval);
99 
100  virtual
101  bool
102  operator>= (rti1516::LogicalTimeInterval const & value) const
103  throw (
104  rti1516::InvalidLogicalTimeInterval);
105 
106  virtual
107  bool
108  operator<= (rti1516::LogicalTimeInterval const & value) const
109  throw (
110  rti1516::InvalidLogicalTimeInterval);
111 
112  // Generates an encoded value that can be used to send
113  // LogicalTimeIntervals to other federates in updates or interactions
114  virtual rti1516::VariableLengthData encode() const;
115 
116  // Alternate encode for directly filling a buffer
117  virtual unsigned long encodedLength() const;
118  virtual unsigned long encode(void* buffer, unsigned long bufferSize) const
119  throw (rti1516::CouldNotEncode);
120 
121  // Decode encodedValue into self
122  virtual void decode(rti1516::VariableLengthData const & encodedValue)
123  throw (
124  rti1516::InternalError,
125  rti1516::CouldNotDecode);
126 
127  // Alternate decode that reads directly from a buffer
128  virtual void decode(void* buffer, unsigned long bufferSize)
129  throw (
130  rti1516::InternalError,
131  rti1516::CouldNotDecode);
132 
133  virtual std::wstring toString() const;
134 
135  // Returns the name of the Implementation, as needed by
136  // createFederationExecution.
137  virtual std::wstring implementationName() const;
138 
139 public:
140  //-----------------------------------------------------------------
141  // Implementation functions
142  //-----------------------------------------------------------------
143  virtual double getInterval() const;
144 
145  //-----------------------------------------------------------------
146  // Implementation operators
147  //-----------------------------------------------------------------
148  virtual bool operator== (const double&) const
149  throw (rti1516::InvalidLogicalTimeInterval);
150 
151  virtual bool operator!= (rti1516::LogicalTimeInterval const & value) const
152  throw (
153  rti1516::InvalidLogicalTimeInterval);
154 
155  virtual bool operator!= (LogicalTimeIntervalImplFloat const & value) const
156  throw (
157  rti1516::InvalidLogicalTimeInterval);
158 
159  virtual bool operator!= (const double&) const
160  throw (rti1516::InvalidLogicalTimeInterval);
161 
162  virtual LogicalTimeIntervalImplFloat& operator= (
163  const LogicalTimeIntervalImplFloat& value)
164  throw (rti1516::InvalidLogicalTimeInterval);
165 
166  virtual rti1516::LogicalTimeInterval& operator= (const double&)
167  throw (rti1516::InvalidLogicalTimeInterval);
168 
169  virtual rti1516::LogicalTimeInterval& operator+= (const double&)
170  throw (rti1516::InvalidLogicalTimeInterval);
171 
172  virtual rti1516::LogicalTimeInterval& operator-= (const double&)
173  throw (rti1516::InvalidLogicalTimeInterval);
174 
175 private:
176  //-----------------------------------------------------------------
177  // Implementation member variables
178  //-----------------------------------------------------------------
179  double myInterval;
180  double myZero;
181  double myEpsilon;
182  double myPositiveInfinity;
183 };
184 
185 #endif // RTI_LogicalTimeIntervalImplFloat_H_
186 

Document ID: Generated on Mon Jul 9 10:30:41 EDT 2018 from SVN revision 190224
Copyright © 2005-2018 VT MÄK Inc. All Rights Reserved (www.mak.com)