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