YARP
Yet Another Robot Platform
scriptbroker.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_SCRIPT_BROKER
7 #define YARP_MANAGER_SCRIPT_BROKER
8 
9 #include <string>
10 
11 #include <yarp/os/Log.h>
12 
15 
16 namespace yarp {
17 namespace manager {
18 
20 {
21 
22 public:
23  ScriptLocalBroker(const char* sc) : LocalBroker() {
24  yAssert(sc);
25  script = sc;
26  }
27  virtual ~ScriptLocalBroker() {}
28  using LocalBroker::init;
29  bool init(const char* szcmd, const char* szparam,
30  const char* szhost, const char* szstdio,
31  const char* szworkdir, const char* szenv) override;
32 private:
33  std::string script;
34 };
35 
36 
38 {
39 
40 public:
41  ScriptYarprunBroker(const char* sc) : YarpBroker() {
42  yAssert(sc);
43  script = sc;
44  }
45  virtual ~ScriptYarprunBroker() {}
46  using YarpBroker::init;
47  bool init(const char* szcmd, const char* szparam,
48  const char* szhost, const char* szstdio,
49  const char* szworkdir, const char* szenv) override;
50 private:
51  bool whichFile(const char* server, const char* filename, std::string& filenameWithPath);
52  std::string script;
53 };
54 
55 } // namespace yarp
56 } // namespace manager
57 
58 
59 #endif // __YARP_MANAGER_SCRIPT_BROKER__
#define yAssert(x)
Definition: Log.h:294
Class LocalBroker.
Definition: localbroker.h:34
bool init() override
Definition: yarpbroker.cpp:61
The main, catch-all namespace for YARP.
Definition: dirs.h:16