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 
12 #include <RTI/LogicalTimeInterval.h>
13 
14 #if !WIN32 && !VXWORKS && !VMS && !__darwin__
15 #include <values.h>
16 #else
17 #if VMS
18 #include <limits>
19 #define MAXDOUBLE numeric_limits<double>::max()
20 #else
21 #define MAXDOUBLE 1.7976931348623157e+308
22 #endif
23 #endif
24 #define POSITIVE_INFINITY (MAXDOUBLE)
25 #define EPSILON (0.000000001)
26 
29 {
30 public:
31  static std::wstring theImplementationName;
32 
33 public:
34 
35  // Constructors
37  LogicalTimeIntervalImplFloat(const double&);
40 
41  // Destructor
43  throw ();
44 
45  // Basic accessors/mutators
46  virtual void setZero();
47  virtual bool isZero() const;
48 
49  virtual void setEpsilon();
50  virtual bool isEpsilon() const;
51 
52  // Assignment
53  virtual
54  rti1516::LogicalTimeInterval&
55  operator= (rti1516::LogicalTimeInterval const & value)
56  throw (
57  rti1516::InvalidLogicalTimeInterval);
58 
59  // Set self to the difference between two LogicalTimes
60  virtual
61  void
62  setToDifference(rti1516::LogicalTime const & minuend,
63  rti1516::LogicalTime const& subtrahend)
64  throw (rti1516::InvalidLogicalTime);
65 
66  virtual
67  rti1516::LogicalTimeInterval&
68  operator+= (rti1516::LogicalTimeInterval const & addend)
69  throw (
70  rti1516::InvalidLogicalTimeInterval);
71 
72  virtual
73  rti1516::LogicalTimeInterval&
74  operator-= (rti1516::LogicalTimeInterval const & subtrahend)
75  throw (
76  rti1516::InvalidLogicalTimeInterval);
77 
78  virtual
79  bool
80  operator> (rti1516::LogicalTimeInterval const & value) const
81  throw (
82  rti1516::InvalidLogicalTimeInterval);
83 
84  virtual
85  bool
86  operator< (rti1516::LogicalTimeInterval const & value) const
87  throw (
88  rti1516::InvalidLogicalTimeInterval);
89 
90  virtual
91  bool
92  operator== (rti1516::LogicalTimeInterval const & value) const
93  throw (
94  rti1516::InvalidLogicalTimeInterval);
95 
96  virtual
97  bool
98  operator>= (rti1516::LogicalTimeInterval const & value) const
99  throw (
100  rti1516::InvalidLogicalTimeInterval);
101 
102  virtual
103  bool
104  operator<= (rti1516::LogicalTimeInterval const & value) const
105  throw (
106  rti1516::InvalidLogicalTimeInterval);
107 
108  // Generates an encoded value that can be used to send
109  // LogicalTimeIntervals to other federates in updates or interactions
110  virtual rti1516::VariableLengthData encode() const;
111 
112  // Alternate encode for directly filling a buffer
113  virtual unsigned long encodedLength() const;
114  virtual unsigned long encode(void* buffer, unsigned long bufferSize) const
115  throw (rti1516::CouldNotEncode);
116 
117  // Decode encodedValue into self
118  virtual void decode(rti1516::VariableLengthData const & encodedValue)
119  throw (
120  rti1516::InternalError,
121  rti1516::CouldNotDecode);
122 
123  // Alternate decode that reads directly from a buffer
124  virtual void decode(void* buffer, unsigned long bufferSize)
125  throw (
126  rti1516::InternalError,
127  rti1516::CouldNotDecode);
128 
129  virtual std::wstring toString() const;
130 
131  // Returns the name of the Implementation, as needed by
132  // createFederationExecution.
133  virtual std::wstring implementationName() const;
134 
135 public:
136  //-----------------------------------------------------------------
137  // Implementation functions
138  //-----------------------------------------------------------------
139  virtual double getInterval() const;
140 
141  //-----------------------------------------------------------------
142  // Implementation operators
143  //-----------------------------------------------------------------
144  virtual bool operator== (const double&) const
145  throw (rti1516::InvalidLogicalTimeInterval);
146 
147  virtual bool operator!= (rti1516::LogicalTimeInterval const & value) const
148  throw (
149  rti1516::InvalidLogicalTimeInterval);
150 
151  virtual bool operator!= (LogicalTimeIntervalImplFloat const & value) const
152  throw (
153  rti1516::InvalidLogicalTimeInterval);
154 
155  virtual bool operator!= (const double&) const
156  throw (rti1516::InvalidLogicalTimeInterval);
157 
158  virtual LogicalTimeIntervalImplFloat& operator= (
159  const LogicalTimeIntervalImplFloat& value)
160  throw (rti1516::InvalidLogicalTimeInterval);
161 
162  virtual rti1516::LogicalTimeInterval& operator= (const double&)
163  throw (rti1516::InvalidLogicalTimeInterval);
164 
165  virtual rti1516::LogicalTimeInterval& operator+= (const double&)
166  throw (rti1516::InvalidLogicalTimeInterval);
167 
168  virtual rti1516::LogicalTimeInterval& operator-= (const double&)
169  throw (rti1516::InvalidLogicalTimeInterval);
170 
171 private:
172  //-----------------------------------------------------------------
173  // Implementation member variables
174  //-----------------------------------------------------------------
175  double myInterval;
176  double myZero;
177  double myEpsilon;
178  double myPositiveInfinity;
179 };
180 
181 #endif // RTI_LogicalTimeIntervalImplFloat_H_
182 

Document ID: Generated on Wed Mar 11 20:26:49 EDT 2015 from SVN revision 150939
Copyright © 2005-2015 VT MÄK Inc. All Rights Reserved (www.mak.com)