AGX Dynamics  2.37.2.0
TimeStamp.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2024. Algoryx Simulation AB.
3 
4 All AGX source code, intellectual property, documentation, sample code,
5 tutorials, scene files and technical white papers, are copyrighted, proprietary
6 and confidential material of Algoryx Simulation AB. You may not download, read,
7 store, distribute, publish, copy or otherwise disseminate, use or expose this
8 material unless having a written signed agreement with Algoryx Simulation AB, or having been
9 advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10 valid commercial license from Algoryx Simulation AB.
11 
12 Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13 from using this software, unless otherwise stated in written agreements with
14 Algoryx Simulation AB.
15 */
16 
17 #ifndef AGX_TIMESTAMP_H
18 #define AGX_TIMESTAMP_H
19 
20 #include <agx/agxPhysics_export.h>
21 
22 #include <agx/agx.h>
23 
24 
25 namespace agx {
27 
28 #if 0
29 
42  class AGXPHYSICS_EXPORT TimeStamp {
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 
93  TimeStamp operator+ (Real r);
94  const TimeStamp& operator+ (Real r) const;
95 
99  TimeStamp operator+ (const TimeStamp& t);
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
bool operator==(T val, InvalidIndexStruct)
Definition: agx.h:194
#define AGXPHYSICS_EXPORT
agx::Real TimeStamp
Definition: TimeStamp.h:26
AgXString< T > operator+(const Indentation &indentation, const AgXString< T > &str)
Definition: Indentation.h:66
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
std::ostream & operator<<(std::ostream &os, const agx::AddedMassInteraction::Matrix6x6 &m)
bool operator!=(T val, InvalidIndexStruct)
Definition: agx.h:200
double Real
Definition: Real.h:42
AGXCABLE_EXPORT SegmentDamage & operator+=(SegmentDamage &lhs, const SegmentDamage &rhs)