|
YARP
Yet Another Robot Platform
|
|
Go to the documentation of this file.
15 #ifndef YARP_ROSMSG_TickDuration_h
16 #define YARP_ROSMSG_TickDuration_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(
"TickDuration::TickDuration(): 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(
"TickDuration::operator=(): Timestamp exceeded the 32 bit representation, resetting it to 0");
72 if (
nsec > 1000000000UL) {
73 yWarning(
"TickDuration::operator double(): Check on nsec > 1000000000UL failed");
75 return sec +
nsec * 1000000000.0;
163 static constexpr
const char*
typeName =
"TickDuration";
166 static constexpr
const char*
typeChecksum =
"4771ad66fef816d2e4bead2f45a1cde6";
185 #endif // YARP_ROSMSG_TickDuration_h
TickDuration(double timestamp)
yarp::os::Type getType() const override
virtual bool read(yarp::os::idl::WireReader &reader)
yarp::os::idl::BareStyle< yarp::rosmsg::TickDuration > rosStyle
virtual bool isBareMode() const =0
Check if the connection is bare mode.
bool writeBare(yarp::os::ConnectionWriter &connection) const override
TickDuration & operator=(const double timestamp)
bool writeBottle(yarp::os::ConnectionWriter &connection) const override
static constexpr const char * typeName
virtual bool isError() const =0
static Type byName(const char *name)
virtual std::int32_t expectInt32()=0
Read a 32-bit integer from the network connection.
yarp::os::idl::BottleStyle< yarp::rosmsg::TickDuration > bottleStyle
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.
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...
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.
bool readBottle(yarp::os::ConnectionReader &connection) override
std::int32_t expectInt32()
The main, catch-all namespace for YARP.
static constexpr const char * typeText
static constexpr const char * typeChecksum
A single value (typically within a Bottle).
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
bool readBare(yarp::os::ConnectionReader &connection) override
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
virtual bool write(const yarp::os::idl::WireWriter &writer) const