AGX Dynamics  2.37.3.2
Date.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_DATE_H
18 #define AGX_DATE_H
19 
20 #include <agx/String.h>
21 #include <agx/Object.h>
22 
23 
24 namespace agx
25 {
28  {
29  public:
39  struct TimeVal {
40  long tv_sec; /* seconds */
41  long tv_usec; /* and microseconds */
42  };
43  Date();
44  Date(UInt seconds, UInt microSeconds = 0);
45 
46 
48  agx::String toStringDateAndTime() const;
49 
51  agx::String toStringTime() const;
52 
53  tm& getTmTime();
54  const tm& getTmTime() const;
55 
56  TimeVal& getTimevalTime();
57  const TimeVal& getTimevalTime() const;
58 
59  long long getMilliseconds() const;
60 
61  bool operator>(const Date& other) const;
62 
63  void update();
64 
65 
72  static bool convertDateToISO(const agx::String& compileDate, agx::String& isoDate);
73 
74 
75  protected:
76  virtual ~Date();
77 
78 
79  private:
80  TimeVal m_timevalTime;
81  tm m_tmTime;
82  };
83 
84 
85  /* Implementation */
86  AGX_FORCE_INLINE tm& Date::getTmTime() { return m_tmTime; }
87  AGX_FORCE_INLINE const tm& Date::getTmTime() const { return m_tmTime; }
88 
90  AGX_FORCE_INLINE const Date::TimeVal& Date::getTimevalTime() const { return m_timevalTime; }
91 
92 }
93 
94 
95 #endif /* AGX_DATE_H */
A copy of struct &#39;timeval&#39; from BSD file sys/time.h.
Definition: Date.h:39
tm & getTmTime()
Definition: Date.h:86
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:254
#define AGX_FORCE_INLINE
Definition: Object.h:59
long tv_usec
Definition: Date.h:41
uint32_t UInt
Definition: Integer.h:34
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
Definition: Date.h:27
TimeVal & getTimevalTime()
Definition: Date.h:89
#define AGXCORE_EXPORT
agx::Object is a refcounted object with a name.
Definition: Object.h:58