75 mPriv(std::exchange(
rhs.mPriv,
nullptr))
87 *mPriv = *(
rhs.mPriv);
95 std::swap(mPriv,
rhs.mPriv);
102 return mPriv->sequenceNumber;
107 return mPriv->timeStamp;
112 return mPriv->frameId;
117 return mPriv->sequenceNumber !=
npos;
132 mPriv->frameId = std::move(
frameId);
137 return mPriv->
read(connection);
142 return mPriv->
write(connection);
void update(yarp::conf::float64_t time)
Private(StampWithFrame::count_t _count, yarp::conf::float64_t _time, const std::string &_frameId)
A mini-server for performing network communication in the background.
T * read(bool shouldWait=true) override
Read an available object from the port.
void write(bool forceStrict=false)
Write the current object being returned by BufferedPort::prepare.
An interface for reading from a network connection.
An interface for writing to a network connection.
Holds a time stamp and/or sequence number.
std::int32_t sequenceNumber
An abstraction for a sequence number, time stamp and/or frame id.
static constexpr count_t npos
Maximum sequence number, after which an incrementing sequence should return to zero.
std::string frameId() const
Get the frame id.
void setFrameId(std::string frameId)
Set the frame id for this StampWithFrame.
bool write(ConnectionWriter &connection) const override
Write this object to a network connection.
bool isValid() const
Check if this StampWithFrame is valid.
yarp::conf::float64_t timeStamp() const
Get the time stamp.
void update()
Set the timestamp to the current time, and increment the sequence number (wrapping to 0 if the sequen...
~StampWithFrame() override
Destructor.
StampWithFrame()
Construct an invalid StampWithFrame.
count_t count() const
Get the sequence number.
bool read(ConnectionReader &connection) override
Read this object from a network connection.
StampWithFrame & operator=(const StampWithFrame &rhs)
Copy assignment operator.
#define yCAssert(component, x)
#define YARP_OS_LOG_COMPONENT(name, name_string)
double now()
Return the current time in seconds, relative to an arbitrary starting point.