AGX Dynamics 2.41.2.0
Loading...
Searching...
No Matches
TimeStamp.h
Go to the documentation of this file.
1/*
2Copyright 2007-2025. Algoryx Simulation AB.
3
4All AGX source code, intellectual property, documentation, sample code,
5tutorials, scene files and technical white papers, are copyrighted, proprietary
6and confidential material of Algoryx Simulation AB. You may not download, read,
7store, distribute, publish, copy or otherwise disseminate, use or expose this
8material unless having a written signed agreement with Algoryx Simulation AB, or having been
9advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10valid commercial license from Algoryx Simulation AB.
11
12Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13from using this software, unless otherwise stated in written agreements with
14Algoryx Simulation AB.
15*/
16
17#ifndef AGX_TIMESTAMP_H
18#define AGX_TIMESTAMP_H
19
21
22#include <agx/agx.h>
23
24
25namespace agx {
27
28#if 0
29
43 public:
47 TimeStamp( Real t=0.0 );
48
52 TimeStamp( const TimeStamp &t );
53
57 Real operator() () const ;
62 bool operator< (const TimeStamp & t) const;
67 bool operator> (const TimeStamp & t) const;
72 bool operator<= (const TimeStamp & t) const;
77 bool operator>= (const TimeStamp & t) const;
78
83 bool operator== (const TimeStamp & t) const;
88 bool operator!= (const TimeStamp & t) const;
89
94 const TimeStamp& operator+ (Real r) const;
95
100
104 TimeStamp& operator+= (Real r);
105
109 TimeStamp& operator+= (const TimeStamp& t);
110
111 friend std::ostream& operator <<(std::ostream& os, const TimeStamp& t);
112
113 operator double() const { return m_time; }
114
115 private:
116 Real m_time;
117 };
118
119
120
121 inline TimeStamp::TimeStamp( Real t ) : m_time(t) {}
122
123 inline TimeStamp::TimeStamp( const TimeStamp &t )
124 {
125 if (this == &t)
126 return;
127
128 m_time = t.m_time;
129 }
130
131 inline Real TimeStamp::operator() () const { return m_time; }
132
133 inline bool TimeStamp::operator< (const TimeStamp & t) const { return m_time < t.m_time; }
134
135 inline bool TimeStamp::operator> (const TimeStamp & t) const { return m_time > t.m_time; }
136
137 inline bool TimeStamp::operator<= (const TimeStamp & t) const { return m_time <= t.m_time; }
138
139 inline bool TimeStamp::operator>= (const TimeStamp & t) const { return m_time >= t.m_time; }
140
141 inline bool TimeStamp::operator== (const TimeStamp & t) const { return m_time == t.m_time; }
142
143 inline bool TimeStamp::operator!= (const TimeStamp & t) const { return m_time != t.m_time; }
144
145 inline TimeStamp TimeStamp::operator+ (const TimeStamp & t) { return TimeStamp( m_time +t.m_time ); }
146 inline TimeStamp TimeStamp::operator+ (Real t) { return TimeStamp( m_time+t ); }
147
148 inline TimeStamp& TimeStamp::operator+= (const TimeStamp & t) { m_time += t.m_time; return *this; }
149 inline TimeStamp& TimeStamp::operator+= (Real t) { m_time += t; return *this; }
150
151 inline std::ostream& operator <<(std::ostream& os, const TimeStamp& t) { os << t.m_time; return os; }
152#endif
153
154} // namespace agx
155#endif
AGXCORE_EXPORT agx::String operator+(const std::string &str, const agx::Name &name)
std::ostream & operator<<(std::ostream &o, const agx::Vec6 &v)
Definition: Vec6.h:230
#define AGXPHYSICS_EXPORT
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
double Real
Definition: Real.h:42
agx::Real TimeStamp
Definition: TimeStamp.h:26