45 using Waiters = std::list<std::pair<double, Semaphore*>>;
90 bool ok = bot.
read(reader);
97 if (!ok && !closing) {
106 _time = sec + (nsec * 1
e-9);
182 yCError(
NETWORKCLOCK,
"Cannot find time port \"%s\" or a time topic \"%s@\"\n", mPriv->clockName.c_str(), mPriv->clockName.c_str());
191 mPriv->timeMutex.lock();
192 double result = mPriv->_time;
193 mPriv->timeMutex.unlock();
203 mPriv->listMutex.lock();
204 if (mPriv->closing) {
207 mPriv->listMutex.unlock();
213 mPriv->waiters->push_back(
waiter);
214 mPriv->listMutex.unlock();
223 return mPriv->initted;
std::list< std::pair< double, Semaphore * > > Waiters
bool read(ConnectionReader &reader) override
Read this object from a network connection.
A simple collection of objects that can be described and transmitted in a portable way.
bool read(ConnectionReader &reader) override
Set the bottle's value based on input from a network connection.
Value & get(size_type index) const
Reads a Value v from a certain part of the list.
A mini-server for performing network communication in the background.
An interface for reading from a network connection.
static bool connect(const std::string &src, const std::string &dest, const std::string &carrier="", bool quiet=true)
Request that an output port connect to an input port.
static Contact queryName(const std::string &name)
Find out information about a registered name.
static bool disconnect(const std::string &src, const std::string &dest, bool quiet)
Request that an output port disconnect from an input port.
void delay(double seconds) override
Wait for a certain number of seconds.
bool isValid() const override
Check if time is valid (non-zero).
bool open(const std::string &clockSourcePortName, std::string localPortName="")
double now() override
Return the current time in seconds, relative to an arbitrary starting point.
Interface implemented by all objects that can read themselves from the network, such as Bottle object...
A mini-server for network communication.
void setReader(PortReader &reader) override
Set an external reader for port data.
bool open(const std::string &name) override
Start port operation, with a specific name, with automatically-chosen network parameters.
A class for thread synchronization and mutual exclusion.
static void delaySystem(double seconds)
static ProcessInfo getProcessInfo(int pid=0)
gets the operating system process information given by its PID.
virtual std::int32_t asInt32() const
Get 32-bit integer value.
#define yCError(component,...)
#define yCWarning(component,...)
#define YARP_OS_LOG_COMPONENT(name, name_string)
The components from which ports and connections are built.
An interface to the operating system, including Port based communication.
std::string gethostname()
Portable wrapper for the gethostname() function.
The ProcessInfo struct provides the operating system process information.