39 static std::mutex mutex;
45 yCError(
TIME,
"Warning an issue has been found, please update the code.");
47 yCError(
TIME,
" This means YARP framework has not been properly initialized.");
48 yCError(
TIME,
" The clock can be initialized with one of the following methods:");
49 yCError(
TIME,
" - Create yarp::os::Network object or call yarp::os::Network::init()");
51 yCError(
TIME,
" otherwise use yarp::os::SystemClock::nowSystem() and yarp::os::SystemClock::delaySystem() instead of Time::now() and Time::delay()");
188 yCFatal(
TIME,
"failed creating NetworkClock client");
199 yCFatal(
TIME,
"failed creating NetworkClock client, cannot open input port");
213 yCInfo(
TIME,
"Waiting for clock server to start broadcasting data ...");
222 if (
clock ==
nullptr) {
223 yCFatal(
TIME,
"failed configuring CustomClock client");
227 if (!
clock->isValid()) {
296 clockTypeString =
"Clock has not been initialized yet: This should never happen. Is the object yarp::os::Network been initialized?";
300 clockTypeString =
"Unknown clock: This should never happen. Is the object yarp::os::Network been initialized?";
A mini-server for performing network communication in the background.
bool open(const std::string &name) override
Start port operation, with a specific name, with automatically-chosen network parameters.
static double nowSystem()
static void delaySystem(double seconds)
static void yield()
Reschedule the execution of current thread, allowing other threads to run.
#define yCInfo(component,...)
#define yCError(component,...)
#define yCAssert(component, x)
#define yCFatal(component,...)
#define YARP_OS_LOG_COMPONENT(name, name_string)
yarpClockType getClockType()
bool isNetworkClock()
Check if YARP is providing network time.
void useSystemClock()
Configure YARP to use system time (this is the default).
bool isClockInitialized()
Check if YARP clock is initialized.
bool isValid()
Check if time is valid (non-zero).
void yield()
The calling thread releases its remaining quantum upon calling this function.
double now()
Return the current time in seconds, relative to an arbitrary starting point.
void useNetworkClock(const std::string &clock, const std::string &localPortName="")
Configure YARP to read time from a specified topic.
void delay(double seconds)
Wait for a certain number of seconds.
void useCustomClock(Clock *clock)
Configure YARP clients to use a custom clock source provided by the user.
bool isCustomClock()
Check if YARP is using a user-defined custom time.
bool isSystemClock()
Check if YARP is providing system time.
std::string clockTypeToString(yarpClockType type)
Converts clock type enum into string.
void startTurboBoost()
For OS where it makes sense sets the scheduler to be called more often.
An interface to the operating system, including Port based communication.
@ YARP_CLOCK_UNINITIALIZED