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);
38 
39  void setLaunchPrefix(const std::string& launchPrefix);
40 
41  void setWorkingDirectory(const std::string& workingDirectory);
42 
43  void setClearParams(bool on);
44 
45  void setStopTimeout(double timeout);
46 
47  void setMemoryLimit(uint64_t memoryLimitByte);
48 
49  void setCPULimit(double cpuLimit);
50 
51  void setMuted(bool muted);
52  void setStdoutDisplayed(bool showStdout);
53 
54  std::string name() const
55  { return m_name; }
56 
57  std::string package() const
58  { return m_package; }
59 
60  std::string type() const
61  { return m_type; }
62 
63  std::string executable() const
64  { return m_executable; }
65 
66  std::string namespaceString() const
67  { return m_namespace; }
68 
69  std::map<std::string, std::string> remappings() const
70  { return m_remappings; }
71 
72  std::vector<std::string> extraArguments() const
73  { return m_extraArgs; }
74 
75  std::map<std::string, std::string> extraEnvironment() const
76  { return m_extraEnvironment; }
77 
78  bool respawn() const
79  { return m_respawn; }
80 
82  { return m_respawnDelay; }
83 
84  int numRespawnsAllowed() const
85  { return m_numRespawnsAllowed; }
86 
88  { return m_spawnDelay; }
89 
90  void setRequired(bool required);
91 
92  bool required() const
93  { return m_required; }
94 
95  std::vector<std::string> launchPrefix() const
96  { return m_launchPrefix; }
97 
98  bool coredumpsEnabled() const
99  { return m_coredumpsEnabled; }
100 
101  std::string workingDirectory() const
102  { return m_workingDirectory; }
103 
104  bool clearParams() const
105  { return m_clearParams; }
106 
107  double stopTimeout() const
108  { return m_stopTimeout; }
109 
110  uint64_t memoryLimitByte() const
111  { return m_memoryLimitByte;}
112 
113  double cpuLimit() const
114  { return m_cpuLimit; }
115 
116  bool isMuted() const
117  { return m_muted; }
118 
119  bool stdoutDisplayed() const
120  { return m_stdoutDisplayed; }
121 private:
122  std::string m_name;
123  std::string m_package;
124  std::string m_type;
125 
126  std::string m_executable;
127 
128  std::string m_namespace;
129 
130  std::map<std::string, std::string> m_remappings;
131  std::vector<std::string> m_extraArgs;
132 
133  std::map<std::string, std::string> m_extraEnvironment;
134 
135  bool m_respawn;
137  int m_numRespawnsAllowed = 0; // Will warn on any respawn by default
139 
141 
142  std::vector<std::string> m_launchPrefix;
143 
145 
146  std::string m_workingDirectory;
147 
149 
151 
153  double m_cpuLimit;
154 
155  bool m_muted;
157 };
158 
159 }
160 
161 }
162 
163 #endif
rosmon::launch::Node::setRemappings
void setRemappings(const std::map< std::string, std::string > &remappings)
Definition: node.cpp:50
rosmon::launch::Node::m_remappings
std::map< std::string, std::string > m_remappings
Definition: node.h:130
rosmon::launch::Node::setNumRespawnsAllowed
void setNumRespawnsAllowed(int numRespawnsAllowed)
Definition: node.cpp:105
rosmon
Definition: diagnostics_publisher.cpp:34
rosmon::launch::Node::setSpawnDelay
void setSpawnDelay(const ros::WallDuration &spawnDelay)
Definition: node.cpp:110
rosmon::launch::Node::setStopTimeout
void setStopTimeout(double timeout)
Definition: node.cpp:155
rosmon::launch::Node::respawnDelay
ros::WallDuration respawnDelay() const
Definition: node.h:81
rosmon::launch::Node::setMuted
void setMuted(bool muted)
Definition: node.cpp:170
rosmon::launch::Node::setNamespace
void setNamespace(const std::string &ns)
Definition: node.cpp:80
rosmon::launch::Node::clearParams
bool clearParams() const
Definition: node.h:104
time.h
rosmon::launch::Node::setClearParams
void setClearParams(bool on)
Definition: node.cpp:150
rosmon::launch::Node::m_coredumpsEnabled
bool m_coredumpsEnabled
Definition: node.h:144
rosmon::launch::Node::m_extraEnvironment
std::map< std::string, std::string > m_extraEnvironment
Definition: node.h:133
rosmon::launch::Node::isMuted
bool isMuted() const
Definition: node.h:116
rosmon::launch::Node::m_stopTimeout
double m_stopTimeout
Definition: node.h:150
rosmon::launch::Node::m_respawnDelay
ros::WallDuration m_respawnDelay
Definition: node.h:136
rosmon::launch::Node::respawn
bool respawn() const
Definition: node.h:78
rosmon::launch::Node::setRespawnDelay
void setRespawnDelay(const ros::WallDuration &respawnDelay)
Definition: node.cpp:100
rosmon::launch::Node::m_name
std::string m_name
Definition: node.h:122
rosmon::launch::Node::setExtraEnvironment
void setExtraEnvironment(const std::map< std::string, std::string > &env)
Definition: node.cpp:85
rosmon::launch::Node::package
std::string package() const
Definition: node.h:57
rosmon::launch::Node::m_numRespawnsAllowed
int m_numRespawnsAllowed
Definition: node.h:137
rosmon::launch::Node::spawnDelay
ros::WallDuration spawnDelay() const
Definition: node.h:87
rosmon::launch::Node::Ptr
std::shared_ptr< Node > Ptr
Definition: node.h:23
rosmon::launch::Node::m_type
std::string m_type
Definition: node.h:124
rosmon::launch::Node::extraArguments
std::vector< std::string > extraArguments() const
Definition: node.h:72
rosmon::launch::Node::m_memoryLimitByte
uint64_t m_memoryLimitByte
Definition: node.h:152
rosmon::launch::Node::name
std::string name() const
Definition: node.h:54
rosmon::launch::Node::cpuLimit
double cpuLimit() const
Definition: node.h:113
rosmon::launch::Node::memoryLimitByte
uint64_t memoryLimitByte() const
Definition: node.h:110
rosmon::launch::Node::executable
std::string executable() const
Definition: node.h:63
rosmon::launch::Node::setCPULimit
void setCPULimit(double cpuLimit)
Definition: node.cpp:165
rosmon::launch::Node::m_launchPrefix
std::vector< std::string > m_launchPrefix
Definition: node.h:142
rosmon::launch::Node::addExtraArguments
void addExtraArguments(const std::string &argString)
Definition: node.cpp:55
rosmon::launch::Node::setRespawn
void setRespawn(bool respawn)
Definition: node.cpp:95
rosmon::launch::Node::ConstPtr
std::shared_ptr< const Node > ConstPtr
Definition: node.h:24
rosmon::launch::Node::m_workingDirectory
std::string m_workingDirectory
Definition: node.h:146
rosmon::launch::Node::m_executable
std::string m_executable
Definition: node.h:126
rosmon::launch::Node::coredumpsEnabled
bool coredumpsEnabled() const
Definition: node.h:98
rosmon::launch::Node::m_spawnDelay
ros::WallDuration m_spawnDelay
Definition: node.h:138
rosmon::launch::Node::workingDirectory
std::string workingDirectory() const
Definition: node.h:101
rosmon::launch::Node::setLaunchPrefix
void setLaunchPrefix(const std::string &launchPrefix)
Definition: node.cpp:115
rosmon::launch::Node::launchPrefix
std::vector< std::string > launchPrefix() const
Definition: node.h:95
rosmon::launch::Node::m_clearParams
bool m_clearParams
Definition: node.h:148
rosmon::launch::Node::stdoutDisplayed
bool stdoutDisplayed() const
Definition: node.h:119
rosmon::launch::substitutions::env
std::string env(const std::string &name)
Definition: substitution.cpp:67
rosmon::launch::Node
Definition: node.h:20
rosmon::launch::Node::stopTimeout
double stopTimeout() const
Definition: node.h:107
rosmon::launch::Node::extraEnvironment
std::map< std::string, std::string > extraEnvironment() const
Definition: node.h:75
rosmon::launch::Node::numRespawnsAllowed
int numRespawnsAllowed() const
Definition: node.h:84
rosmon::launch::Node::m_stdoutDisplayed
bool m_stdoutDisplayed
Definition: node.h:156
rosmon::launch::Node::m_muted
bool m_muted
Definition: node.h:155
rosmon::launch::Node::type
std::string type() const
Definition: node.h:60
rosmon::launch::Node::setWorkingDirectory
void setWorkingDirectory(const std::string &workingDirectory)
Definition: node.cpp:145
rosmon::launch::Node::m_namespace
std::string m_namespace
Definition: node.h:128
rosmon::launch::Node::m_required
bool m_required
Definition: node.h:140
rosmon::launch::Node::m_extraArgs
std::vector< std::string > m_extraArgs
Definition: node.h:131
ros::WallDuration
rosmon::launch::Node::m_cpuLimit
double m_cpuLimit
Definition: node.h:153
rosmon::launch::Node::m_package
std::string m_package
Definition: node.h:123
rosmon::launch::Node::Node
Node(std::string name, std::string package, std::string type)
Definition: node.cpp:28
rosmon::launch::Node::required
bool required() const
Definition: node.h:92
rosmon::launch::Node::m_respawn
bool m_respawn
Definition: node.h:135
rosmon::launch::Node::setRequired
void setRequired(bool required)
Definition: node.cpp:90
rosmon::launch::Node::setStdoutDisplayed
void setStdoutDisplayed(bool showStdout)
Definition: node.cpp:175
rosmon::launch::Node::remappings
std::map< std::string, std::string > remappings() const
Definition: node.h:69
rosmon::launch::Node::setCoredumpsEnabled
void setCoredumpsEnabled(bool on)
Definition: node.cpp:140
rosmon::launch::Node::setMemoryLimit
void setMemoryLimit(uint64_t memoryLimitByte)
Definition: node.cpp:160
rosmon::launch::Node::namespaceString
std::string namespaceString() const
Definition: node.h:66


rosmon_core
Author(s): Max Schwarz
autogenerated on Wed Feb 21 2024 04:01:14