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