YARP
Yet Another Robot Platform
logicresource.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2021 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__
float t
a Node of a Graph
Definition: node.h:68
Node * clone() override
Platform()
Class Platform.
const char * getDistribution()
Definition: logicresource.h:33
const char * getRelease()
Definition: logicresource.h:34
void setDistribution(const char *str)
Definition: logicresource.h:31
void setRelease(const char *str)
Definition: logicresource.h:32
bool satisfy(GenericResource *resource) override
bool satisfy(GenericResource *resource) override
void setPort(const char *szPort)
Definition: logicresource.h:52
void setReply(const char *szRep)
Definition: logicresource.h:55
ResYarpPort()
Class ResYarpPort.
void setRequest(const char *szReq)
Definition: logicresource.h:54
The main, catch-all namespace for YARP.
Definition: dirs.h:19