YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
Simulated_network_delay.cpp
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2025-2025 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-License-Identifier: BSD-3-Clause
4 */
5
7#include <yarp/os/Value.h>
8#include <yarp/os/Time.h>
9#include <vector>
10
11#include <iostream>
12
13using namespace yarp::os;
14
15namespace {
16
17} //anonymous namespace
18
20{
21 //parse the user parameters
22 std::string debugs = options.toString();
24
25 if (options.check("delay_ms"))
26 {
27 m_delay = options.find("delay_ms").asFloat32();
28 m_delay /= 1000.0;
29 }
30
31 return true;
32}
33
37
39{
40 return false;
41}
42
44{
45 return false;
46}
47
49{
50 return true;
51}
52
58
bool create(const yarp::os::Property &options) override
This will be called when the dll is properly loaded by the portmonitor carrier.
bool accept(yarp::os::Things &thing) override
This will be called when the data reach the portmonitor object.
void trig() override
This will be called when one of the peer connections to the same import port receives data.
bool getparam(yarp::os::Property &params) override
This will be called when the portmonitor carrier parameters are requested via YARP admin port.
void destroy() override
This will be called when the portmonitor object destroyes.
yarp::os::Things & update(yarp::os::Things &thing) override
After data get accpeted in the accept() callback, an instance of that is given to the update function...
bool setparam(const yarp::os::Property &params) override
This will be called when the portmonitor carrier parameters are set via YARP admin port.
A mini-server for performing network communication in the background.
A class for storing options and configuration information.
Definition Property.h:33
Value & find(const std::string &key) const override
Gets a value corresponding to a given keyword.
std::string toString() const override
Return a standard text representation of the content of the object.
bool check(const std::string &key) const override
Check if there exists a property of the given name.
Base class for generic things.
Definition Things.h:18
virtual yarp::conf::float32_t asFloat32() const
Get 32-bit floating point value.
Definition Value.cpp:222
void delay(double seconds)
Wait for a certain number of seconds.
Definition Time.cpp:111
An interface to the operating system, including Port based communication.
Definition OSTestMsg.cpp:13
#define YARP_UNUSED(var)
Definition api.h:162