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 ( )
virtual

Definition at line 26 of file NetworkClock.cpp.

Member Function Documentation

◆ delay()

void NetworkClock::delay ( double  seconds)
virtual

Wait for a certain number of seconds.

This may be fractional.

Parameters
secondsthe duration of the delay, in seconds

Implements yarp::os::Clock.

Definition at line 78 of file NetworkClock.cpp.

◆ isValid()

bool NetworkClock::isValid ( ) const
virtual

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 ( )
virtual

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

Returns
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)
virtual

Read this object from a network connection.

Override this for your particular class.

Parameters
readeran interface to the network connection for reading
Returns
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
private

Definition at line 46 of file NetworkClock.h.

◆ listMutex

Mutex yarp::os::NetworkClock::listMutex
private

Definition at line 40 of file NetworkClock.h.

◆ nsec

YARP_INT32 yarp::os::NetworkClock::nsec
private

Definition at line 44 of file NetworkClock.h.

◆ port

Port yarp::os::NetworkClock::port
private

Definition at line 38 of file NetworkClock.h.

◆ pwaiters

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

Definition at line 37 of file NetworkClock.h.

◆ sec

YARP_INT32 yarp::os::NetworkClock::sec
private

Definition at line 43 of file NetworkClock.h.

◆ t

double yarp::os::NetworkClock::t
private

Definition at line 45 of file NetworkClock.h.

◆ timeMutex

Mutex yarp::os::NetworkClock::timeMutex
private

Definition at line 41 of file NetworkClock.h.


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