node.h
Go to the documentation of this file.
1 // Launch configuration for a single Node
2 // Author: Max Schwarz <max.schwarz@uni-bonn.de>
3 
4 #ifndef ROSMON_LAUNCH_NODE_H
5 #define ROSMON_LAUNCH_NODE_H
6 
7 #include <string>
8 #include <map>
9 #include <memory>
10 #include <vector>
11 
12 #include <ros/time.h>
13 
14 namespace rosmon
15 {
16 
17 namespace launch
18 {
19 
20 class Node
21 {
22 public:
23  typedef std::shared_ptr<Node> Ptr;
24  typedef std::shared_ptr<const Node> ConstPtr;
25 
26  Node(std::string name, std::string package, std::string type);
27 
28  void setRemappings(const std::map<std::string, std::string>& remappings);
29  void addExtraArguments(const std::string& argString);
30  void setNamespace(const std::string& ns);
31  void setExtraEnvironment(const std::map<std::string, std::string>& env);
32  void setCoredumpsEnabled(bool on);
33 
34  void setRespawn(bool respawn);
36 
37  void setLaunchPrefix(const std::string& launchPrefix);
38 
39  void setWorkingDirectory(const std::string& workingDirectory);
40 
41  void setClearParams(bool on);
42 
43  void setStopTimeout(double timeout);
44 
45  void setMemoryLimit(uint64_t memoryLimitByte);
46 
47  void setCPULimit(float cpuLimit);
48 
49  std::string name() const
50  { return m_name; }
51 
52  std::string package() const
53  { return m_package; }
54 
55  std::string type() const
56  { return m_type; }
57 
58  std::string executable() const
59  { return m_executable; }
60 
61  std::string namespaceString() const
62  { return m_namespace; }
63 
64  std::map<std::string, std::string> remappings() const
65  { return m_remappings; }
66 
67  std::vector<std::string> extraArguments() const
68  { return m_extraArgs; }
69 
70  std::map<std::string, std::string> extraEnvironment() const
71  { return m_extraEnvironment; }
72 
73  bool respawn() const
74  { return m_respawn; }
75 
77  { return m_respawnDelay; }
78 
79  void setRequired(bool required);
80 
81  bool required() const
82  { return m_required; }
83 
84  std::vector<std::string> launchPrefix() const
85  { return m_launchPrefix; }
86 
87  bool coredumpsEnabled() const
88  { return m_coredumpsEnabled; }
89 
90  std::string workingDirectory() const
91  { return m_workingDirectory; }
92 
93  bool clearParams() const
94  { return m_clearParams; }
95 
96  double stopTimeout() const
97  { return m_stopTimeout; }
98 
99  uint64_t memoryLimitByte()const
100  { return m_memoryLimitByte;}
101 
102  float cpuLimit()const
103  { return m_cpuLimit; }
104 private:
105  std::string m_name;
106  std::string m_package;
107  std::string m_type;
108 
109  std::string m_executable;
110 
111  std::string m_namespace;
112 
113  std::map<std::string, std::string> m_remappings;
114  std::vector<std::string> m_extraArgs;
115 
116  std::map<std::string, std::string> m_extraEnvironment;
117 
118  bool m_respawn;
120 
122 
123  std::vector<std::string> m_launchPrefix;
124 
126 
127  std::string m_workingDirectory;
128 
130 
132 
134  float m_cpuLimit;
135 };
136 
137 }
138 
139 }
140 
141 #endif
Node(std::string name, std::string package, std::string type)
Definition: node.cpp:28
std::shared_ptr< const Node > ConstPtr
Definition: node.h:24
std::string namespaceString() const
Definition: node.h:61
std::string m_name
Definition: node.h:105
float m_cpuLimit
Definition: node.h:134
double stopTimeout() const
Definition: node.h:96
bool respawn() const
Definition: node.h:73
std::string m_type
Definition: node.h:107
void setCoredumpsEnabled(bool on)
Definition: node.cpp:128
std::string executable() const
Definition: node.h:58
std::string m_namespace
Definition: node.h:111
float cpuLimit() const
Definition: node.h:102
std::map< std::string, std::string > m_remappings
Definition: node.h:113
ros::WallDuration respawnDelay() const
Definition: node.h:76
uint64_t memoryLimitByte() const
Definition: node.h:99
std::shared_ptr< Node > Ptr
Definition: node.h:23
std::string m_executable
Definition: node.h:109
void setStopTimeout(double timeout)
Definition: node.cpp:143
std::map< std::string, std::string > m_extraEnvironment
Definition: node.h:116
bool clearParams() const
Definition: node.h:93
void setMemoryLimit(uint64_t memoryLimitByte)
Definition: node.cpp:148
std::string package() const
Definition: node.h:52
std::string name() const
Definition: node.h:49
std::string m_workingDirectory
Definition: node.h:127
ros::WallDuration m_respawnDelay
Definition: node.h:119
void setLaunchPrefix(const std::string &launchPrefix)
Definition: node.cpp:103
std::string workingDirectory() const
Definition: node.h:90
bool m_clearParams
Definition: node.h:129
void setRemappings(const std::map< std::string, std::string > &remappings)
Definition: node.cpp:48
std::string type() const
Definition: node.h:55
void setRequired(bool required)
Definition: node.cpp:88
bool m_coredumpsEnabled
Definition: node.h:125
std::string env(const std::string &name)
void setClearParams(bool on)
Definition: node.cpp:138
std::map< std::string, std::string > extraEnvironment() const
Definition: node.h:70
bool required() const
Definition: node.h:81
std::vector< std::string > m_extraArgs
Definition: node.h:114
bool coredumpsEnabled() const
Definition: node.h:87
void addExtraArguments(const std::string &argString)
Definition: node.cpp:53
std::string m_package
Definition: node.h:106
std::vector< std::string > extraArguments() const
Definition: node.h:67
std::map< std::string, std::string > remappings() const
Definition: node.h:64
void setCPULimit(float cpuLimit)
Definition: node.cpp:153
uint64_t m_memoryLimitByte
Definition: node.h:133
void setExtraEnvironment(const std::map< std::string, std::string > &env)
Definition: node.cpp:83
void setWorkingDirectory(const std::string &workingDirectory)
Definition: node.cpp:133
void setNamespace(const std::string &ns)
Definition: node.cpp:78
void setRespawn(bool respawn)
Definition: node.cpp:93
std::vector< std::string > launchPrefix() const
Definition: node.h:84
std::vector< std::string > m_launchPrefix
Definition: node.h:123
double m_stopTimeout
Definition: node.h:131
void setRespawnDelay(const ros::WallDuration &respawnDelay)
Definition: node.cpp:98


rosmon_core
Author(s): Max Schwarz
autogenerated on Wed Jul 10 2019 03:10:12