YARP  2.3.70
Yet Another Robot Platform
yarp::os::NetworkClock Class Reference

#include <yarp/os/NetworkClock.h>

+ Inheritance diagram for yarp::os::NetworkClock:

Public Member Functions

 NetworkClock ()
virtual ~NetworkClock ()
bool open (const ConstString &name)
virtual double now () YARP_OVERRIDE
 Return the current time in seconds, relative to an arbitrary starting point. More...
virtual void delay (double seconds) YARP_OVERRIDE
 Wait for a certain number of seconds. More...
virtual bool isValid () const YARP_OVERRIDE
 Check if time is valid (non-zero). More...
virtual bool read (ConnectionReader &reader) YARP_OVERRIDE
 Read this object from a network connection. More...
- Public Member Functions inherited from yarp::os::Clock
virtual ~Clock ()
 Destructor. More...

Private Attributes

void * pwaiters
Port port
Mutex listMutex
Mutex timeMutex
YARP_INT32 sec
YARP_INT32 nsec
double t
bool closing

Additional Inherited Members

- Private Member Functions inherited from yarp::os::PortReader
virtual ~PortReader ()
 Destructor. More...
virtual Type getReadType ()

Detailed Description

Definition at line 24 of file NetworkClock.h.

Constructor & Destructor Documentation

◆ NetworkClock()

NetworkClock::NetworkClock ( )

Definition at line 20 of file NetworkClock.cpp.

◆ ~NetworkClock()

NetworkClock::~NetworkClock ( )

Definition at line 26 of file NetworkClock.cpp.

Member Function Documentation

◆ delay()

void NetworkClock::delay ( double  seconds)

Wait for a certain number of seconds.

This may be fractional.

secondsthe duration of the delay, in seconds

Implements yarp::os::Clock.

Definition at line 78 of file NetworkClock.cpp.

◆ isValid()

bool NetworkClock::isValid ( ) const

Check if time is valid (non-zero).

For example, for a network clock, if no timestamp has yet been received, this method will return false.

Implements yarp::os::Clock.

Definition at line 105 of file NetworkClock.cpp.

◆ now()

double NetworkClock::now ( )

Return the current time in seconds, relative to an arbitrary starting point.

the time in seconds

Implements yarp::os::Clock.

Definition at line 71 of file NetworkClock.cpp.

◆ open()

bool NetworkClock::open ( const ConstString name)

Definition at line 53 of file NetworkClock.cpp.

◆ read()

bool NetworkClock::read ( ConnectionReader reader)

Read this object from a network connection.

Override this for your particular class.

readeran interface to the network connection for reading
true iff the object is successfully read

Implements yarp::os::PortReader.

Definition at line 109 of file NetworkClock.cpp.

Member Data Documentation

◆ closing

bool yarp::os::NetworkClock::closing

Definition at line 46 of file NetworkClock.h.

◆ listMutex

Mutex yarp::os::NetworkClock::listMutex

Definition at line 40 of file NetworkClock.h.

◆ nsec

YARP_INT32 yarp::os::NetworkClock::nsec

Definition at line 44 of file NetworkClock.h.

◆ port

Port yarp::os::NetworkClock::port

Definition at line 38 of file NetworkClock.h.

◆ pwaiters

void* yarp::os::NetworkClock::pwaiters

Definition at line 37 of file NetworkClock.h.

◆ sec

YARP_INT32 yarp::os::NetworkClock::sec

Definition at line 43 of file NetworkClock.h.

◆ t

double yarp::os::NetworkClock::t

Definition at line 45 of file NetworkClock.h.

◆ timeMutex

Mutex yarp::os::NetworkClock::timeMutex

Definition at line 41 of file NetworkClock.h.

The documentation for this class was generated from the following files: