YARP
Yet Another Robot Platform
logicresource.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 YARP_MANAGER_LOGICRESOURCE
10 #define YARP_MANAGER_LOGICRESOURCE
11 
12 #include <yarp/manager/ymm-types.h>
13 #include <yarp/manager/node.h>
14 #include <yarp/manager/utility.h>
15 #include <yarp/manager/resource.h>
16 #include <yarp/conf/api.h>
17 
18 namespace yarp {
19 namespace manager {
20 
21 
22 class Platform : public GenericResource
23 {
24 public:
25  Platform();
26  Platform(const char* szName);
27  ~Platform() override;
28  Node* clone() override;
29  bool satisfy(GenericResource* resource) override;
30 
31  void setDistribution(const char* str) { if(str) { strDistrib = str; } }
32  void setRelease(const char* str) { if(str) { strRelease = str; } }
33  const char* getDistribution() { return strDistrib.c_str(); }
34  const char* getRelease() { return strRelease.c_str(); }
35 
36 protected:
37 
38 private:
39  std::string strDistrib;
40  std::string strRelease;
41  bool satisfy_platform(Platform* os);
42 
43 };
44 
45 
47 {
48 public:
49  ResYarpPort();
50  ResYarpPort(const char* szName);
51  ~ResYarpPort() override;
52  void setPort(const char* szPort) { if(szPort) { strPort = szPort; } }
53  const char* getPort() { return strPort.c_str(); }
54  void setRequest(const char* szReq) { if(szReq) { strRequest = szReq; } }
55  void setReply(const char* szRep) { if(szRep) { strReply = szRep; } }
56  const char* getRequest() { return strRequest.c_str(); }
57  const char* getReply() { return strReply.c_str(); }
58  void setTimeout(double t) { timeout = t; }
59  double getTimeout() { return timeout; }
60  Node* clone() override;
61  bool satisfy(GenericResource* resource) override;
62 
63 protected:
64 
65 private:
66  std::string strPort;
67  std::string strRequest;
68  std::string strReply;
69  double timeout;
70 };
71 
72 } // namespace yarp
73 } // namespace manager
74 
75 
76 #endif // __YARP_MANAGER_LOGICRESOURCE__
t
float t
Definition: FfmpegWriter.cpp:74
yarp::manager::ResYarpPort::clone
Node * clone() override
Definition: logicresource.cpp:75
yarp::manager::Platform::clone
Node * clone() override
Definition: logicresource.cpp:30
yarp::manager::ResYarpPort::setReply
void setReply(const char *szRep)
Definition: logicresource.h:55
yarp::manager::ResYarpPort::setTimeout
void setTimeout(double t)
Definition: logicresource.h:58
yarp::manager::ResYarpPort::ResYarpPort
ResYarpPort()
Class ResYarpPort.
Definition: logicresource.cpp:63
utility.h
yarp::manager::ResYarpPort::getReply
const char * getReply()
Definition: logicresource.h:57
yarp::manager::Platform
Definition: logicresource.h:23
yarp::manager::ResYarpPort::~ResYarpPort
~ResYarpPort() override
yarp::manager::Platform::getRelease
const char * getRelease()
Definition: logicresource.h:34
node.h
yarp::manager::Node
a Node of a Graph
Definition: node.h:68
yarp::manager::Platform::setRelease
void setRelease(const char *str)
Definition: logicresource.h:32
resource.h
yarp::manager::Platform::satisfy
bool satisfy(GenericResource *resource) override
Definition: logicresource.cpp:36
ymm-types.h
yarp::manager::ResYarpPort::satisfy
bool satisfy(GenericResource *resource) override
Definition: logicresource.cpp:81
yarp::manager::ResYarpPort
Definition: logicresource.h:47
yarp::manager::Platform::Platform
Platform()
Class Platform.
Definition: logicresource.cpp:21
yarp::manager::Platform::~Platform
~Platform() override
yarp::manager::Platform::setDistribution
void setDistribution(const char *str)
Definition: logicresource.h:31
yarp::manager::ResYarpPort::setPort
void setPort(const char *szPort)
Definition: logicresource.h:52
yarp::manager::GenericResource
Definition: resource.h:21
yarp::manager::ResYarpPort::getTimeout
double getTimeout()
Definition: logicresource.h:59
yarp::manager::ResYarpPort::setRequest
void setRequest(const char *szReq)
Definition: logicresource.h:54
yarp
The main, catch-all namespace for YARP.
Definition: environment.h:18
yarp::manager::ResYarpPort::getPort
const char * getPort()
Definition: logicresource.h:53
yarp::manager::Platform::getDistribution
const char * getDistribution()
Definition: logicresource.h:33
api.h
yarp::manager::ResYarpPort::getRequest
const char * getRequest()
Definition: logicresource.h:56