Robot Raconteur Companion C++ Library
Loading...
Searching...
No Matches
DateTimeUtil.h File Reference

Go to the source code of this file.

Functions

com::robotraconteur::datetime::DateTimeUTC RobotRaconteur::Companion::Util::UtcNow (const RobotRaconteur::RobotRaconteurNodePtr &node, const com::robotraconteur::device::DeviceInfoPtr &info)
 Get the current DateTimeUTC from the node.
com::robotraconteur::datetime::TimeSpec2 RobotRaconteur::Companion::Util::TimeSpec2Now (const RobotRaconteur::RobotRaconteurNodePtr &node, const com::robotraconteur::device::DeviceInfoPtr &info)
 Get the current TimeSpec from the node, stored as TimeSpec2.
com::robotraconteur::datetime::TimeSpec3 RobotRaconteur::Companion::Util::TimeSpec3Now (const RobotRaconteur::RobotRaconteurNodePtr &node)
 Get the current TimeSpec from the node, stored as TimeSpec3.
com::robotraconteur::device::clock::DeviceTime RobotRaconteur::Companion::Util::FillDeviceTime (const RobotRaconteur::RobotRaconteurNodePtr &node, const com::robotraconteur::device::DeviceInfoPtr &device_info, uint64_t seqno)
 Fill a DeviceTime structure with the current time.

Detailed Description

Author
John Wason, PhD
License
Software License Agreement (Apache License)
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Function Documentation

◆ FillDeviceTime()

com::robotraconteur::device::clock::DeviceTime RobotRaconteur::Companion::Util::FillDeviceTime ( const RobotRaconteur::RobotRaconteurNodePtr & node,
const com::robotraconteur::device::DeviceInfoPtr & device_info,
uint64_t seqno )

Fill a DeviceTime structure with the current time.

Parameters
nodeThe node to use. If null, the default node is used
device_infoThe device info to use. If null, the default clock is used
seqnoThe current sequence number of the device
Returns
com::robotraconteur::device::clock::DeviceTime

◆ TimeSpec2Now()

com::robotraconteur::datetime::TimeSpec2 RobotRaconteur::Companion::Util::TimeSpec2Now ( const RobotRaconteur::RobotRaconteurNodePtr & node,
const com::robotraconteur::device::DeviceInfoPtr & info )

Get the current TimeSpec from the node, stored as TimeSpec2.

TimeSpec is based on the performance counter, and is not guaranteed to be synchronized between nodes or with the system real-time clock. It is expected to be close to the system real-time clock, but may drift over time and is guaranteed to remain stable even if the system real-time clock is changed.

Parameters
nodeThe node to use. If null, the default node is used
infoThe device info to use. If null, the default clock is used
Returns
com::robotraconteur::datetime::TimeSpec2 The current TimeSpec as TimeSpec2

◆ TimeSpec3Now()

com::robotraconteur::datetime::TimeSpec3 RobotRaconteur::Companion::Util::TimeSpec3Now ( const RobotRaconteur::RobotRaconteurNodePtr & node)

Get the current TimeSpec from the node, stored as TimeSpec3.

The TimeSpec3 is a 64-bit integer representing microseconds since the epoch of the real-time clock. It is intended to be a compact representation of the current time that can be used for timestamping data.

TimeSpec is based on the performance counter, and is not guaranteed to be synchronized between nodes or with the system real-time clock. It is expected to be close to the system real-time clock, but may drift over time and is guaranteed to remain stable even if the system real-time clock is changed.

Parameters
nodeThe node to use. If null, the default node is used
Returns
com::robotraconteur::datetime::TimeSpec3 The current TimeSpec as TimeSpec3

◆ UtcNow()

com::robotraconteur::datetime::DateTimeUTC RobotRaconteur::Companion::Util::UtcNow ( const RobotRaconteur::RobotRaconteurNodePtr & node,
const com::robotraconteur::device::DeviceInfoPtr & info )

Get the current DateTimeUTC from the node.

Parameters
nodeThe node to use. If null, the default node is used
infoThe device info to use. If null, the default clock is used
Returns
com::robotraconteur::datetime::DateTimeUTC The current UTC time