YARP
Yet Another Robot Platform
Nop.cpp
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3  * SPDX-License-Identifier: BSD-3-Clause
4  */
5 
6 #include "Nop.h"
7 
8 #include <yarp/os/Log.h>
9 #include <yarp/os/LogStream.h>
10 #include <yarp/os/Time.h>
11 
12 
13 namespace {
14 YARP_LOG_COMPONENT(NOP, "yarp.device.test_nop")
15 }
16 
18  PeriodicThread(1.0)
19 {
20 }
21 
23 {
24 }
25 
27 {
28  if (config.check("period")) {
29  period = config.find("period").asFloat64();
30  }
31  setPeriod(period);
32 
33  yCInfo(NOP) << "Starting thread";
34  start();
35  yCInfo(NOP) << "Thread started";
36 
37  return true;
38 }
39 
40 bool Nop::close()
41 {
42  return true;
43 }
44 
45 void Nop::run()
46 {
47  yCInfo(NOP) << "Doing nothing";
48 }
void run() override
Loop function.
Definition: Nop.cpp:45
bool open(yarp::os::Searchable &config) override
Open the DeviceDriver.
Definition: Nop.cpp:26
bool close() override
Close the DeviceDriver.
Definition: Nop.cpp:40
~Nop() override
Definition: Nop.cpp:22
Nop()
Definition: Nop.cpp:17
bool setPeriod(double period)
Set the (new) period of the thread.
bool start()
Call this to start the thread.
A base class for nested structures that can be searched.
Definition: Searchable.h:66
virtual Value & find(const std::string &key) const =0
Gets a value corresponding to a given keyword.
virtual bool check(const std::string &key) const =0
Check if there exists a property of the given name.
virtual yarp::conf::float64_t asFloat64() const
Get 64-bit floating point value.
Definition: Value.cpp:222
#define yCInfo(component,...)
Definition: LogComponent.h:132
#define YARP_LOG_COMPONENT(name,...)
Definition: LogComponent.h:77