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

#include <yarp/os/NetworkClock.h>

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

Detailed Description

Definition at line 26 of file NetworkClock.h.

Public Member Functions

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

Private Member Functions

 YARP_SUPPRESS_DLL_INTERFACE_WARNING_ARG (std::string) clockName
 
- Private Member Functions inherited from yarp::os::PortReader
virtual ~PortReader ()
 Destructor. More...
 
virtual Type getReadType () const
 

Private Attributes

void * pwaiters
 
Port port
 
Mutex listMutex
 
Mutex timeMutex
 
std::int32_t sec
 
std::int32_t nsec
 
double _time
 
bool closing
 
bool initted
 

Constructor & Destructor Documentation

◆ NetworkClock()

NetworkClock::NetworkClock ( )

Definition at line 27 of file NetworkClock.cpp.

◆ ~NetworkClock()

NetworkClock::~NetworkClock ( )
virtual

Definition at line 37 of file NetworkClock.cpp.

Member Function Documentation

◆ delay()

void NetworkClock::delay ( double  seconds)
overridevirtual

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 116 of file NetworkClock.cpp.

◆ isValid()

bool NetworkClock::isValid ( ) const
overridevirtual

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 141 of file NetworkClock.cpp.

◆ now()

double NetworkClock::now ( )
overridevirtual

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

Returns
the time in seconds

Implements yarp::os::Clock.

Definition at line 109 of file NetworkClock.cpp.

◆ open()

bool NetworkClock::open ( const std::string &  clockSourcePortName,
std::string  localPortName = "" 
)

Definition at line 67 of file NetworkClock.cpp.

◆ read()

bool NetworkClock::read ( ConnectionReader reader)
overridevirtual

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 145 of file NetworkClock.cpp.

◆ YARP_SUPPRESS_DLL_INTERFACE_WARNING_ARG()

yarp::os::NetworkClock::YARP_SUPPRESS_DLL_INTERFACE_WARNING_ARG ( std::string  )
private

Member Data Documentation

◆ _time

double yarp::os::NetworkClock::_time
private

Definition at line 51 of file NetworkClock.h.

◆ closing

bool yarp::os::NetworkClock::closing
private

Definition at line 52 of file NetworkClock.h.

◆ initted

bool yarp::os::NetworkClock::initted
private

Definition at line 53 of file NetworkClock.h.

◆ listMutex

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

Definition at line 46 of file NetworkClock.h.

◆ nsec

std::int32_t yarp::os::NetworkClock::nsec
private

Definition at line 50 of file NetworkClock.h.

◆ port

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

Definition at line 44 of file NetworkClock.h.

◆ pwaiters

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

Definition at line 43 of file NetworkClock.h.

◆ sec

std::int32_t yarp::os::NetworkClock::sec
private

Definition at line 49 of file NetworkClock.h.

◆ timeMutex

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

Definition at line 47 of file NetworkClock.h.


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