An abstraction for a time stamp and/or sequence number.
More...
#include <yarp/os/Stamp.h>
An abstraction for a time stamp and/or sequence number.
Definition at line 24 of file Stamp.h.
◆ Stamp() [1/2]
yarp::os::Stamp::Stamp |
( |
| ) |
|
|
explicit |
◆ Stamp() [2/2]
yarp::os::Stamp::Stamp |
( |
int |
count, |
|
|
double |
time |
|
) |
| |
Construct a Stamp with a given sequence number and time.
- Parameters
-
count | the sequence number. |
time | the time stamp (in seconds, relative to an arbitrary. zero time) |
Definition at line 20 of file Stamp.cpp.
◆ getCount()
int yarp::os::Stamp::getCount |
( |
| ) |
const |
Get the sequence number.
- Returns
- the sequence number.
Definition at line 32 of file Stamp.cpp.
◆ getMaxCount()
int yarp::os::Stamp::getMaxCount |
( |
| ) |
const |
Get the maximum sequence number, after which an incrementing sequence should return to zero.
- Returns
- the maximum sequence number.
Definition at line 108 of file Stamp.cpp.
◆ getTime()
double yarp::os::Stamp::getTime |
( |
| ) |
const |
Get the time stamp.
- Returns
- the time stamp
Definition at line 37 of file Stamp.cpp.
◆ isValid()
bool yarp::os::Stamp::isValid |
( |
| ) |
const |
Check if this Stamp is valid.
- Returns
- true if this is a valid Stamp
Definition at line 42 of file Stamp.cpp.
◆ read()
Read this object from a network connection.
Override this for your particular class.
- Parameters
-
reader | an interface to the network connection for reading |
- Returns
- true iff the object is successfully read
Implements yarp::os::Portable.
Definition at line 47 of file Stamp.cpp.
◆ update() [1/2]
void yarp::os::Stamp::update |
( |
| ) |
|
Set the timestamp to the current time, and increment the sequence number (wrapping to 0 if the sequence number exceeds Stamp::getMaxCount())
Definition at line 113 of file Stamp.cpp.
◆ update() [2/2]
void yarp::os::Stamp::update |
( |
double |
time | ) |
|
Set the timestamp to a given time, and increments the sequence number (wrapping to 0 if the sequence exceeds Stamp::getMaxCount())
Definition at line 124 of file Stamp.cpp.
◆ write()
Write this object to a network connection.
Override this for your particular class. Be aware that depending on the nature of the connections a port has, and what protocol they use, and how efficient the YARP implementation is, this method may be called once, twice, or many times, as the result of a single call to Port::write
- Parameters
-
writer | an interface to the network connection for writing |
- Returns
- true iff the object is successfully written
Implements yarp::os::Portable.
Definition at line 90 of file Stamp.cpp.
The documentation for this class was generated from the following files: