12#ifndef YARP_ROSMSG_TickTime_h
13#define YARP_ROSMSG_TickTime_h
42 uint64_t time = (uint64_t) (timestamp * 1000000000UL);
43 uint64_t sec_part = (time / 1000000000UL);
44 uint64_t nsec_part = (time % 1000000000UL);
45 if (
sec > UINT32_MAX) {
46 yWarning(
"TickTime::TickTime(): Timestamp exceeded the 32 bit representation, resetting it to 0");
55 uint64_t time = (uint64_t) (timestamp * 1000000000UL);
56 uint64_t sec_part = (time / 1000000000UL);
57 uint64_t nsec_part = (time % 1000000000UL);
58 if (
sec > UINT32_MAX) {
59 yWarning(
"TickTime::operator=(): Timestamp exceeded the 32 bit representation, resetting it to 0");
69 if (
nsec > 1000000000UL) {
70 yWarning(
"TickTime::operator double(): Check on nsec > 1000000000UL failed");
72 return sec +
nsec * 1000000000.0;
160 static constexpr const char*
typeName =
"TickTime";
163 static constexpr const char*
typeChecksum =
"4771ad66fef816d2e4bead2f45a1cde6";
An interface for reading from a network connection.
virtual bool isBareMode() const =0
Check if the connection is bare mode.
virtual std::int32_t expectInt32()=0
Read a 32-bit integer from the network connection.
virtual bool convertTextMode()=0
Reads in a standard description in text mode, and converts it to a standard description in binary.
virtual bool isError() const =0
An interface for writing to a network connection.
virtual bool isError() const =0
virtual bool isBareMode() const =0
Check if the connection is bare mode.
virtual bool convertTextMode()=0
Converts a standard description in binary into a textual description, if the connection is in text-mo...
virtual void appendInt32(std::int32_t data)=0
Send a representation of a 32-bit integer to the network connection.
static Type byName(const char *name)
Type & addProperty(const char *key, const Value &val)
A single value (typically within a Bottle).
A "tamed" Portable, that promises to serialize itself in an IDL-friendly way.
virtual bool read(yarp::os::idl::WireReader &reader)
virtual bool write(const yarp::os::idl::WireWriter &writer) const
IDL-friendly connection reader.
std::int32_t expectInt32()
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
yarp::os::Type getType() const override
bool readBottle(yarp::os::ConnectionReader &connection) override
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
bool readBare(yarp::os::ConnectionReader &connection) override
TickTime(double timestamp)
yarp::os::idl::BareStyle< yarp::rosmsg::TickTime > rosStyle
static constexpr const char * typeText
bool writeBare(yarp::os::ConnectionWriter &connection) const override
static constexpr const char * typeChecksum
yarp::os::idl::BottleStyle< yarp::rosmsg::TickTime > bottleStyle
static constexpr const char * typeName
bool writeBottle(yarp::os::ConnectionWriter &connection) const override
TickTime & operator=(const double timestamp)
std::uint32_t NetUint32
Definition of the NetUint32 type.
The main, catch-all namespace for YARP.