YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
MonitorBinding.h
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#ifndef MONITORBINDING_INC
7#define MONITORBINDING_INC
8
10#include <yarp/os/Property.h>
11#include <yarp/os/Things.h>
13
14#include "MonitorEvent.h"
15
16template<typename T>
18public:
19 MonitorTrigger(T* monitor, double period)
20 : yarp::os::PeriodicThread(period) {
21 MonitorTrigger::monitor = monitor;
22 }
23 virtual ~MonitorTrigger() { }
24
25 // inherited from the yarp::os::RateThread
26 void run () override {
27 monitor->peerTrigged();
28 }
29
30private:
31 T* monitor;
32};
33
35{
36
37public:
38 virtual ~MonitorBinding();
39 virtual bool load(const yarp::os::Property& options) = 0;
40 virtual bool setParams(const yarp::os::Property& params) = 0;
41 virtual bool getParams(yarp::os::Property& params) = 0;
42
43 virtual bool hasAccept() = 0;
44 virtual bool acceptData(yarp::os::Things& thing) = 0;
45
46 virtual bool hasUpdate() = 0;
48
49 virtual bool hasUpdateReply() = 0;
51
52 virtual bool peerTrigged() = 0;
53 virtual bool setAcceptConstraint(const char* constraint) = 0;
54 virtual const char* getAcceptConstraint() = 0;
55 virtual bool canAccept() = 0;
56
60 static MonitorBinding *create(const char* script_type);
61
62};
63
64#endif //MONITORBINDING_INC_
virtual bool hasAccept()=0
virtual ~MonitorBinding()
Class MonitorBinding.
virtual bool hasUpdate()=0
virtual bool hasUpdateReply()=0
virtual bool acceptData(yarp::os::Things &thing)=0
static MonitorBinding * create(const char *script_type)
factory method
virtual const char * getAcceptConstraint()=0
virtual bool canAccept()=0
virtual bool getParams(yarp::os::Property &params)=0
virtual yarp::os::Things & updateData(yarp::os::Things &thing)=0
virtual yarp::os::Things & updateReply(yarp::os::Things &thing)=0
virtual bool setParams(const yarp::os::Property &params)=0
virtual bool peerTrigged()=0
virtual bool load(const yarp::os::Property &options)=0
virtual bool setAcceptConstraint(const char *constraint)=0
MonitorTrigger(T *monitor, double period)
virtual ~MonitorTrigger()
void run() override
Loop function.
An abstraction for a periodic thread.
PeriodicThread(double period, ShouldUseSystemClock useSystemClock=ShouldUseSystemClock::No, PeriodicThreadClock clockAccuracy=PeriodicThreadClock::Relative)
Constructor.
A class for storing options and configuration information.
Definition Property.h:33
Base class for generic things.
Definition Things.h:18
The main, catch-all namespace for YARP.
Definition dirs.h:16