datetime.h
Go to the documentation of this file.
1 
11 #ifndef __OPC_UA_BINARY_DATE_TIME__H__
12 #define __OPC_UA_BINARY_DATE_TIME__H__
13 
14 #include <stdint.h>
15 #include <time.h>
16 
17 namespace OpcUa
18 {
19 
20 struct DateTime
21 {
23  : Value(0)
24  {
25  }
26 
27  explicit DateTime(int64_t value)
28  : Value(value)
29  {
30  }
31 
32  static DateTime Current();
33  static DateTime FromTimeT(time_t t, unsigned usec = 0);
34  static time_t ToTimeT(DateTime dateTime);
35 
36  DateTime(const DateTime &) = default;
37  DateTime & operator=(const DateTime &) = default;
38  DateTime & operator+=(const DateTime & val)
39  {
40  Value += val.Value;
41  return *this;
42  }
43 
44  operator int64_t() const
45  {
46  return Value;
47  }
48 
49  int64_t Value;
50 };
51 
52 
53 typedef double Duration; // Time duration in miliseconds.
54 
55 } // OpcUa
56 
57 
58 #endif // __OPC_UA_BINARY_DATE_TIME__H__
59 
static DateTime FromTimeT(time_t t, unsigned usec=0)
DateTime & operator+=(const DateTime &val)
Definition: datetime.h:38
static time_t ToTimeT(DateTime dateTime)
OPC UA Address space part. GNU LGPL.
DateTime & operator=(const DateTime &)=default
int64_t Value
Definition: datetime.h:49
static DateTime Current()
DateTime(int64_t value)
Definition: datetime.h:27


ros_opcua_impl_freeopcua
Author(s): Denis Štogl
autogenerated on Tue Jan 19 2021 03:06:04