|
YARP
Yet Another Robot Platform
|
|
Go to the documentation of this file.
15 #ifndef YARP_ROSMSG_TickTime_h
16 #define YARP_ROSMSG_TickTime_h
45 uint64_t time = (uint64_t) (timestamp * 1000000000UL);
46 uint64_t sec_part = (time / 1000000000UL);
47 uint64_t nsec_part = (time % 1000000000UL);
48 if (
sec > UINT32_MAX) {
49 yWarning(
"TickTime::TickTime(): Timestamp exceeded the 32 bit representation, resetting it to 0");
58 uint64_t time = (uint64_t) (timestamp * 1000000000UL);
59 uint64_t sec_part = (time / 1000000000UL);
60 uint64_t nsec_part = (time % 1000000000UL);
61 if (
sec > UINT32_MAX) {
62 yWarning(
"TickTime::operator=(): Timestamp exceeded the 32 bit representation, resetting it to 0");
72 if (
nsec > 1000000000UL) {
73 yWarning(
"TickTime::operator double(): Check on nsec > 1000000000UL failed");
75 return sec +
nsec * 1000000000.0;
163 static constexpr
const char*
typeName =
"TickTime";
166 static constexpr
const char*
typeChecksum =
"4771ad66fef816d2e4bead2f45a1cde6";
185 #endif // YARP_ROSMSG_TickTime_h
bool writeBottle(yarp::os::ConnectionWriter &connection) const override
TickTime & operator=(const double timestamp)
yarp::os::idl::BottleStyle< yarp::rosmsg::TickTime > bottleStyle
bool readBottle(yarp::os::ConnectionReader &connection) override
virtual bool read(yarp::os::idl::WireReader &reader)
virtual bool isBareMode() const =0
Check if the connection is bare mode.
yarp::os::Type getType() const override
static constexpr const char * typeChecksum
virtual bool isError() const =0
static constexpr const char * typeName
static Type byName(const char *name)
virtual std::int32_t expectInt32()=0
Read a 32-bit integer from the network connection.
Type & addProperty(const char *key, const Value &val)
An interface for writing to a network connection.
std::uint32_t NetUint32
Definition of the NetUint32 type.
bool readBare(yarp::os::ConnectionReader &connection) override
virtual bool isError() const =0
virtual bool convertTextMode()=0
Reads in a standard description in text mode, and converts it to a standard description in binary.
A "tamed" Portable, that promises to serialize itself in an IDL-friendly way.
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...
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
virtual void appendInt32(std::int32_t data)=0
Send a representation of a 32-bit integer to the network connection.
IDL-friendly connection reader.
An interface for reading from a network connection.
std::int32_t expectInt32()
The main, catch-all namespace for YARP.
TickTime(double timestamp)
static constexpr const char * typeText
yarp::os::idl::BareStyle< yarp::rosmsg::TickTime > rosStyle
A single value (typically within a Bottle).
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
bool writeBare(yarp::os::ConnectionWriter &connection) const override
virtual bool write(const yarp::os::idl::WireWriter &writer) const