|
YARP
Yet Another Robot Platform
|
|
Go to the documentation of this file.
22 sequenceNumber = count;
34 return sequenceNumber;
44 return sequenceNumber >= 0;
50 std::string stampStr = connection.
expectText();
53 int ret = std::sscanf(stampStr.c_str(),
"%d %lg\n", &seqNum, &ts);
59 sequenceNumber = seqNum;
94 std::snprintf(buf, 512,
"%d %.*g", sequenceNumber, DBL_DIG, timeStamp);
110 return std::numeric_limits<int>::max();
118 if (sequenceNumber > getMaxCount() || sequenceNumber < 0) {
127 if (sequenceNumber > getMaxCount() || sequenceNumber < 0) {
133 #ifndef YARP_NO_DEPRECATED // Since YARP 3.0.0
138 #endif // YARP_NO_DEPRECATED
#define YARP_WARNING_PUSH
Starts a temporary alteration of the enabled warnings.
virtual void appendFloat64(yarp::conf::float64_t data)=0
Send a representation of a 64-bit floating point number to the network connection.
double now()
Return the current time in seconds, relative to an arbitrary starting point.
virtual yarp::conf::float64_t expectFloat64()=0
Read a 64-bit floating point number from the network connection.
virtual bool isError() const =0
virtual std::int32_t expectInt32()=0
Read a 32-bit integer from the network connection.
An interface for writing to a network connection.
double getTime() const
Get the time stamp.
virtual bool isError() const =0
bool read(ConnectionReader &connection) override
Read this object from a network connection.
virtual bool convertTextMode()=0
Reads in a standard description in text mode, and converts it to a standard description in binary.
int getCount() const
Get the sequence number.
virtual bool convertTextMode()=0
Converts a standard description in binary into a textual description, if the connection is in text-mo...
#define YARP_WARNING_POP
Ends a temporary alteration of the enabled warnings.
virtual void appendInt32(std::int32_t data)=0
Send a representation of a 32-bit integer to the network connection.
bool write(ConnectionWriter &connection) const override
Write this object to a network connection.
An interface for reading from a network connection.
#define BOTTLE_TAG_FLOAT64
void update()
Set the timestamp to the current time, and increment the sequence number (wrapping to 0 if the sequen...
virtual bool isTextMode() const =0
Check if the connection is text mode.
virtual std::string expectText(const char terminatingChar='\n')=0
Read some text from the network connection.
virtual bool isTextMode() const =0
Check if the connection is text mode.
Stamp()
Construct an invalid Stamp.
bool isValid() const
Check if this Stamp is valid.
virtual ~Stamped()
Destructor.
#define YARP_DISABLE_DEPRECATED_WARNING
Disable deprecated warnings in the following code.
virtual void appendText(const std::string &str, const char terminate='\n')=0
Send a terminated string to the network connection.
int getMaxCount() const
Get the maximum sequence number, after which an incrementing sequence should return to zero.