YARP
Yet Another Robot Platform
MonitorSharedLib.h
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 #ifndef MONITOR_SHAREDLIB_INC
10 #define MONITOR_SHAREDLIB_INC
11 
12 #include "MonitorBinding.h"
13 
14 #include <yarp/os/MonitorObject.h>
16 #include <yarp/os/SharedLibrary.h>
17 #include <yarp/os/YarpPlugin.h>
18 
19 #include <string>
20 
22 {
23 
24 public:
26  ~MonitorSharedLib() override;
27 
28  bool load(const yarp::os::Property &options) override;
29  bool setParams(const yarp::os::Property& params) override;
30  bool getParams(yarp::os::Property& params) override;
31 
32  bool acceptData(yarp::os::Things &thing) override;
35 
36  bool peerTrigged() override;
37  bool canAccept() override;
38 
39  bool setAcceptConstraint(const char* constraint) override {
40  if(!constraint) {
41  return false;
42  }
43  MonitorSharedLib::constraint = constraint;
44  return true;
45  }
46 
47  const char* getAcceptConstraint() override {
48  return constraint.c_str();
49  }
50 
51  bool hasAccept() override { return true; }
52  bool hasUpdate() override { return true; }
53  bool hasUpdateReply() override { return true; }
54 
55 private:
56  std::string constraint;
60 };
61 
62 #endif //_MONITOR_SHAREDLIB_INC_
MonitorSharedLib::hasAccept
bool hasAccept() override
Definition: MonitorSharedLib.h:51
MonitorBinding
Definition: MonitorBinding.h:19
MonitorSharedLib
Definition: MonitorSharedLib.h:22
SharedLibrary.h
MonitorSharedLib::load
bool load(const yarp::os::Property &options) override
Definition: MonitorSharedLib.cpp:41
yarp::os::Things
Base class for generic things.
Definition: Things.h:22
MonitorSharedLib::updateReply
yarp::os::Things & updateReply(yarp::os::Things &thing) override
Definition: MonitorSharedLib.cpp:89
MonitorSharedLib::getParams
bool getParams(yarp::os::Property &params) override
Definition: MonitorSharedLib.cpp:73
MonitorSharedLib::acceptData
bool acceptData(yarp::os::Things &thing) override
Definition: MonitorSharedLib.cpp:78
MonitorSharedLib::peerTrigged
bool peerTrigged() override
Definition: MonitorSharedLib.cpp:95
MonitorSharedLib::MonitorSharedLib
MonitorSharedLib()
Class MonitorSharedLib.
Definition: MonitorSharedLib.cpp:30
MonitorSharedLib::getAcceptConstraint
const char * getAcceptConstraint() override
Definition: MonitorSharedLib.h:47
MonitorSharedLib::~MonitorSharedLib
~MonitorSharedLib() override
Definition: MonitorSharedLib.cpp:34
YarpPlugin.h
MonitorSharedLib::hasUpdate
bool hasUpdate() override
Definition: MonitorSharedLib.h:52
yarp::os::YarpPluginSettings
Collect hints for finding a particular plugin.
Definition: YarpPluginSettings.h:25
MonitorSharedLib::canAccept
bool canAccept() override
Definition: MonitorSharedLib.cpp:101
MonitorSharedLib::setParams
bool setParams(const yarp::os::Property &params) override
Definition: MonitorSharedLib.cpp:68
yarp::os::YarpPlugin< yarp::os::MonitorObject >
MonitorSharedLib::hasUpdateReply
bool hasUpdateReply() override
Definition: MonitorSharedLib.h:53
MonitorObject.h
yarp::os::SharedLibraryClass< yarp::os::MonitorObject >
MonitorSharedLib::updateData
yarp::os::Things & updateData(yarp::os::Things &thing) override
Definition: MonitorSharedLib.cpp:84
MonitorBinding.h
SharedLibraryClass.h
yarp::os::Property
A class for storing options and configuration information.
Definition: Property.h:37
MonitorSharedLib::setAcceptConstraint
bool setAcceptConstraint(const char *constraint) override
Definition: MonitorSharedLib.h:39