ExternalApplicationManager.cpp
Go to the documentation of this file.
1 /*
2  * This file is part of ArmarX.
3  *
4  * ArmarX is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation.
7  *
8  * ArmarX is distributed in the hope that it will be useful, but
9  * WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  * @package ArmarXCore::ArmarXObjects::ExternalApplicationManager
17  * @author Stefan Reither ( stef dot reither at web dot de )
18  * @date 2016
19  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20  * GNU General Public License
21  */
22 
24 
25 #include <signal.h>
26 
27 #include <filesystem>
28 #include <thread>
29 
30 #include <sys/prctl.h>
31 
33 #include <boost/regex.hpp>
34 
35 #include <IceUtil/UUID.h>
36 
37 #include <SimoxUtility/algorithm/string/string_tools.h>
38 
45 
46 namespace armarx
47 {
48 
50  std::string prefix) :
52  {
53  defineRequiredProperty<std::string>(
54  "ApplicationPath",
55  "Either the name of the application if its directory is part of the PATH environment "
56  "variable of the system or it is located in an ArmarX-package, or the relative or "
57  "absolute path to the application.")
58  .setCaseInsensitive(false);
59  defineOptionalProperty<std::string>("ApplicationArguments",
60  "",
61  "Comma separated list of command line parameters. "
62  "Commas in double-quoted strings are ignored.");
63  defineOptionalProperty<std::string>(
64  "ArmarXPackage",
65  "",
66  "Set this property if the application is located in an ArmarX-package.");
67  defineOptionalProperty<std::string>(
68  "WorkingDirectory",
69  "",
70  "If set, this path is used as working directory for the external app. This overrides "
71  "BinaryPathAsWorkingDirectory. ${HOME} for env vars, $C{RobotAPI:BINARY_DIR} for "
72  "CMakePackageFinder vars");
73 
74  defineOptionalProperty<bool>(
75  "BinaryPathAsWorkingDirectory",
76  false,
77  "If true the path of the binary is set as the working directory.");
78  defineOptionalProperty<bool>(
79  "RestartInCaseOfCrash",
80  false,
81  "Whether the application should be restarted in case it crashed.");
82 
83  defineOptionalProperty<bool>(
84  "DisconnectInCaseOfCrash",
85  true,
86  "Whether this component should disconnect as long as the application is not running.");
87  defineOptionalProperty<int>(
88  "FakeObjectStartDelay",
89  0,
90  "Delay in ms after which the fake armarx object is started on which other apps can "
91  "depend. Not used if property FakeObjectDelayedStartKeyword is used.");
92  defineOptionalProperty<std::string>(
93  "FakeObjectDelayedStartKeyword",
94  "",
95  "If not empty, the start up of the fake armarx object will be delayed until this "
96  "keyword is found in the stdout of the subprocess.");
97  defineOptionalProperty<int>(
98  "KillDelay",
99  2000,
100  "Delay ins ms before the subprocess is killed after sending the stop signal");
101  defineOptionalProperty<bool>(
102  "PythonUnbuffered",
103  true,
104  "If true, PYTHONUNBUFFERED=1 is added to the environment variables.");
105  defineOptionalProperty<bool>("RedirectToArmarXLog",
106  true,
107  "If true, all outputs from the subprocess are printed with "
108  "ARMARX_LOG, otherwise with std::cout");
109  defineOptionalProperty<Ice::StringSeq>(
110  "AdditionalEnvVars",
111  {},
112  "Comma-seperated list of env-var assignment, e.g. MYVAR=1,ADDPATH=/tmp");
113  defineOptionalProperty<Ice::StringSeq>(
114  "Dependencies",
115  {},
116  "Comma-seperated list of Ice Object dependencies. The external app will only be "
117  "started after all dependencies have been found.");
118  }
119 
120  void
122  {
123  const std::string argsStr = getProperty<std::string>("ApplicationArguments").getValue();
124 
125  const boost::regex re(",(?=(?:[^\\\"]*\\\"[^\\\"]*\\\")*[^\\\"]*$)");
126 
127  boost::match_results<std::string::const_iterator> what;
128  boost::match_flag_type flags = boost::match_default;
129  std::string::const_iterator s = argsStr.begin();
130  std::string::const_iterator e = argsStr.end();
131  size_t begin = 0;
132  while (boost::regex_search(s, e, what, re, flags))
133  {
134  int pos = what.position();
135  auto arg = argsStr.substr(begin, pos);
136  if (!arg.empty())
137  {
138  args.push_back(arg);
139  }
140  std::string::difference_type l = what.length();
141  std::string::difference_type p = what.position();
142  begin += l + p;
143  s += p + l;
144  }
145  std::string lastArg = argsStr.substr(begin);
146  if (!lastArg.empty())
147  {
148  args.push_back(lastArg);
149  }
150  }
151 
152  void
154  {
155  getProperty(redirectToArmarXLog, "RedirectToArmarXLog");
156  getProperty(restartWhenCrash, "RestartInCaseOfCrash");
157  getProperty(disconnectWhenCrash, "DisconnectInCaseOfCrash");
158 
159  updateLogSenderComponentName();
160 
161  workingDir = deriveWorkingDir();
162  application = deriveApplicationPath();
163 
164  std::filesystem::path appPath(application);
165  ARMARX_INFO << "Application absolute path: " << appPath;
166  Logging::setTag(appPath.stem().string());
167 
168  args.insert(args.begin(), application);
170 
171  if (getProperty<bool>("PythonUnbuffered"))
172  {
173  envVars.push_back("PYTHONUNBUFFERED=1");
174  }
175  if (getProperty<Ice::StringSeq>("AdditionalEnvVars").isSet())
176  {
177  auto addEnvVrs =
178  getProperty<Ice::StringSeq>("AdditionalEnvVars").getValueAndReplaceAllVars();
179  envVars.insert(envVars.end(), addEnvVrs.begin(), addEnvVrs.end());
180  }
181 
182  for (auto& var : envVars)
183  {
184  auto split = Split(var, "=");
185  if (split.size() >= 2)
186  {
187  setenv(split.at(0).c_str(), split.at(1).c_str(), 1);
188  }
189  }
190 
191  getProperty(startUpKeyword, "FakeObjectDelayedStartKeyword");
192  starterUUID = "ExternalApplicationManagerStarter" + IceUtil::generateUUID();
193  depObjUUID = "ExternalApplicationManagerDependency" + IceUtil::generateUUID();
194 
195  usingProxy(depObjUUID);
197  }
198 
199  void
201  {
202  ARMARX_DEBUG << "External App Manager started";
203  // startApplication();
204  }
205 
206  void
208  {
209  ARMARX_DEBUG << "Disconnecting " << getName();
210  }
211 
212  void
214  {
215  ARMARX_DEBUG << "Exiting " << getName();
216  }
217 
220  {
223  }
224 
225  void
226  ExternalApplicationManager::updateLogSenderComponentName()
227  {
228  if (Application::getInstance() &&
229  Application::getInstance()->getProperty<std::string>("ApplicationName").isSet())
230  {
232  Application::getInstance()->getProperty<std::string>("ApplicationName").getValue());
233  }
234  else if (getProperty<std::string>("ObjectName").isSet())
235  {
236  LogSender::SetComponentName(getProperty<std::string>("ObjectName").getValue());
237  }
238  else
239  {
240  LogSender::SetComponentName("ExtApp");
241  }
242  }
243 
244  std::string
246  {
247  std::string workingDir;
248  try
249  {
250  workingDir = getProperty<bool>("BinaryPathAsWorkingDirectory")
251  ? std::filesystem::path(application).parent_path().string()
252  : std::filesystem::current_path().string();
253  }
254  catch (std::exception& e)
255  {
256  ARMARX_ERROR << "caught exception in line " << __LINE__ << " what:\n" << e.what();
257  throw;
258  }
259 
260  if (getProperty<std::string>("WorkingDirectory").isSet())
261  {
262  workingDir = getProperty<std::string>("WorkingDirectory").getValueAndReplaceAllVars();
263  try
264  {
265  std::filesystem::current_path(workingDir);
266  }
267  catch (std::exception& e)
268  {
269  ARMARX_ERROR << "caught exception in line " << __LINE__
270  << " when setting the current working directory to '" << workingDir
271  << "'. except.what:\n"
272  << e.what();
273  throw;
274  }
275  ARMARX_INFO << "Using '" << workingDir << "' as working directory";
276  }
277 
278  return workingDir;
279  }
280 
281  std::string
283  {
284  std::filesystem::path applicationPath =
285  getProperty<std::string>("ApplicationPath").getValueAndReplaceAllVars();
286 
287  if (applicationPath.is_absolute())
288  {
289  if (!std::filesystem::exists(applicationPath))
290  {
291  throw LocalException() << applicationPath << " does not exist.";
292  }
293  return applicationPath;
294  }
295 
296  if (getProperty<std::string>("ArmarXPackage").isSet())
297  {
298  CMakePackageFinder finder(getProperty<std::string>("ArmarXPackage").getValue());
299  if (finder.packageFound())
300  {
301  std::string path = finder.getBinaryDir() / applicationPath;
302  if (!std::filesystem::exists(path))
303  {
304  throw LocalException()
305  << applicationPath << " does not exist in ArmarX-package "
306  << finder.getName();
307  }
308  return path;
309  }
310  else
311  {
312  throw LocalException() << finder.getName() << " is not an ArmarX-package";
313  }
314  }
315  else
316  {
317  std::string applicationPathStr = applicationPath.string();
318  ArmarXDataPath::ResolveHomePath(applicationPathStr);
320  ArmarXDataPath::ReplaceEnvVars(applicationPathStr);
321  applicationPath = applicationPathStr;
322 
323  if (!std::filesystem::exists(applicationPath))
324  {
325  const std::string path = boost::process::search_path(applicationPath);
326  if (path.empty())
327  {
328  throw LocalException()
329  << applicationPath << " does not represent an executable.";
330  }
331  else
332  {
333  return path;
334  }
335  }
336  else
337  {
338  return applicationPath;
339  }
340  }
341  }
342 
343  void
345  {
346  stopApplication();
347  startApplication();
348  }
349 
350  void
352  {
353  stopApplication();
354  }
355 
356  std::string
358  {
359  return application;
360  }
361 
362  bool
364  {
365  return isAppRunning;
366  }
367 
368  void
369  ExternalApplicationManager::waitForApplication()
370  {
371  if (isAppRunning)
372  {
373  try
374  {
375  wait_for_exit(*childProcess);
376  cleanUp();
377 
378  if (restartWhenCrash && !appStoppedOnPurpose)
379  {
380  ARMARX_INFO << "Restarting application ...";
381  startApplication();
382  }
383  else
384  {
385  isAppRunning = false;
386  if (this->disconnectWhenCrash)
387  {
388  this->getArmarXManager()->removeObjectBlocking(starterUUID);
389  }
390  }
391  }
392  catch (...)
393  {
394  }
395  }
396  }
397 
398  void
400  {
402  depObj->setParent(this);
403 
404  this->getArmarXManager()->addObject(depObj, false, depObjUUID);
405  ARMARX_INFO << "Adding dummy app with name " << depObjUUID;
406  }
407 
408  void
410  {
411  starter = new ExternalApplicationManagerStarter();
412  starter->setParent(this);
413  starter->setDependencies(getProperty<Ice::StringSeq>("Dependencies").getValue());
414 
415  this->getArmarXManager()->addObject(starter, false, starterUUID);
416  }
417 
418  void
419  ExternalApplicationManager::setupStream(StreamMetaData& meta)
420  {
421 
422 
423  meta.read = [&, this](const boost::system::error_code& error, std::size_t length)
424  {
425  if (!error)
426  {
427  std::ostringstream ss;
428  ss << &meta.input_buffer;
429  std::string s = ss.str();
430 
431  std::filesystem::path appPath(application);
432  if (redirectToArmarXLog)
433  {
434  *((ARMARX_LOG_S).setBacktrace(false)->setTag(LogTag(appPath.stem().string())))
435  << meta.level << s;
436  }
437  else
438  {
439  std::cout << s << std::flush;
440  }
441 
442  if (!startUpKeyword.empty() && !depObj)
443  {
444  if (Contains(s, startUpKeyword))
445  {
447  }
448  }
449  boost::asio::async_read_until(meta.pend, meta.input_buffer, "\n", meta.read);
450  }
451  else if (error == boost::asio::error::not_found)
452  {
453  std::cout << "Did not receive ending character!" << std::endl;
454  }
455  };
456  boost::asio::async_read_until(meta.pend, meta.input_buffer, "\n", meta.read);
457  auto run = [&]() { meta.io_service.run(); };
458 
459  std::thread{run}.detach();
460  }
461 
462  void
463  ExternalApplicationManager::startApplication()
464  {
465  appStoppedOnPurpose = false;
466 
467  Ice::StringSeq managedObjects = this->getArmarXManager()->getManagedObjectNames();
468  bool dummyAlreadyAdded = false;
469  for (std::string s : managedObjects)
470  {
471  if (s == depObjUUID)
472  {
473  dummyAlreadyAdded = true;
474  }
475  }
476 
477  outMetaData.reset(new StreamMetaData());
478  errMetaData.reset(new StreamMetaData());
479 
480  {
481  outMetaData->sink = boost::iostreams::file_descriptor_sink(
482  outMetaData->pipe.sink, boost::iostreams::close_handle);
483  errMetaData->sink = boost::iostreams::file_descriptor_sink(
484  errMetaData->pipe.sink, boost::iostreams::close_handle);
485 
486 
487  if (hasProperty("ApplicationArguments") &&
488  !getProperty<std::string>("ApplicationArguments").getValue().empty())
489  {
490  ARMARX_INFO << "Application arguments: "
491  << getProperty<std::string>("ApplicationArguments").getValue();
492  }
493  ARMARX_INFO << "Commandline: " << simox::alg::join(args, " ");
494  childProcess.reset(new boost::process::child(boost::process::execute(
497  boost::process::initializers::bind_stdout(outMetaData->sink),
498  boost::process::initializers::bind_stderr(errMetaData->sink),
499  boost::process::initializers::inherit_env(),
500  // Guarantees that the child process gets killed, even when this process recieves SIGKILL(9) instead of SIGINT(2)
502  [](boost::process::executor&) { ::prctl(PR_SET_PDEATHSIG, SIGKILL); }))));
503  }
504 
505  outMetaData->level = MessageTypeT::INFO;
506  errMetaData->level = MessageTypeT::WARN;
507  setupStream(*outMetaData);
508  setupStream(*errMetaData);
509 
510 
511  isAppRunning = true;
512 
513  waitTask = new RunningTask<ExternalApplicationManager>(
514  this, &ExternalApplicationManager::waitForApplication);
515  waitTask->start();
516 
517  usleep(1000 * getProperty<int>("FakeObjectStartDelay").getValue());
518  if (!dummyAlreadyAdded && startUpKeyword.empty())
519  {
521  }
522 
523  ARMARX_INFO << "Application started";
524  }
525 
526  void
527  ExternalApplicationManager::stopApplication()
528  {
529 
530  if (isAppRunning)
531  {
532  int processId = (*childProcess).pid;
533  ARMARX_INFO << "Stopping application with PID " << processId << " with SIGINT";
534  appStoppedOnPurpose = true;
535 
536  if (this->disconnectWhenCrash && this->getArmarXManager())
537  {
538  this->getArmarXManager()->removeObjectBlocking(depObjUUID);
539  depObj = nullptr;
540  }
541 
542  ::kill(processId, SIGINT);
543 
544  ARMARX_VERBOSE << "waiting for application " << processId;
545  if (!waitForProcessToFinish(processId, getProperty<int>("KillDelay").getValue()))
546  {
547  ARMARX_VERBOSE << "Application wont stop - killing it now";
548  boost::process::terminate(*childProcess); // Sends SIGTERM to the process
549  }
550 
551  cleanUp();
552  isAppRunning = false;
553  }
554  }
555 
556  void
557  ExternalApplicationManager::cleanUp()
558  {
559  if (waitTask)
560  {
561  waitTask->stop();
562  }
563  errMetaData->io_service.stop();
564  outMetaData->io_service.stop();
565  ARMARX_VERBOSE << "Application cleaned up";
566  }
567 
568  bool
569  ExternalApplicationManager::waitForProcessToFinish(int pid, int timeoutMS)
570  {
571  if (pid <= 0)
572  {
573  return false;
574  }
575 
576  double startTime = TimeUtil::GetTime().toMilliSecondsDouble();
577 
578  while ((startTime + timeoutMS > TimeUtil::GetTime().toMilliSecondsDouble()) &&
579  ::kill(pid, 0) != -1)
580  {
581  TimeUtil::MSSleep(100);
582  }
583 
584  if (::kill(pid, 0) == -1)
585  {
586  return true;
587  }
588  else
589  {
590  return false;
591  }
592  }
593 
594  ExternalApplicationManager::StreamMetaData::StreamMetaData() :
595  pipe(boost::process::create_pipe()), pend(pipe_end(io_service, pipe.source))
596  {
597  }
598 
599  ExternalApplicationManager::StreamMetaData::StreamMetaData(
600  const ExternalApplicationManager::StreamMetaData& data) :
601  pipe(boost::process::create_pipe()), pend(pipe_end(io_service, pipe.source))
602  {
603  }
604 
605 } // namespace armarx
armarx::ExternalApplicationManager::deriveApplicationPath
virtual std::string deriveApplicationPath() const
Definition: ExternalApplicationManager.cpp:282
ARMARX_VERBOSE
#define ARMARX_VERBOSE
Definition: Logging.h:180
armarx::ExternalApplicationManager::ExternalApplicationManagerDependency
friend struct ExternalApplicationManagerDependency
Definition: ExternalApplicationManager.h:184
armarx::MessageTypeT::WARN
@ WARN
armarx::CMakePackageFinder::packageFound
bool packageFound() const
Returns whether or not this package was found with cmake.
Definition: CMakePackageFinder.cpp:485
armarx::ArmarXDataPath::ResolveHomePath
static void ResolveHomePath(std::string &path)
Resolves a path like ~/myfile.txt or $HOME/myfile.txt to /home/user/myfile.txt.
Definition: ArmarXDataPath.cpp:521
execute
Use of this software is granted under one of the following two to be chosen freely by the user Boost Software License Version Marcin Kalicinski Permission is hereby free of to any person or organization obtaining a copy of the software and accompanying documentation covered by this execute
Definition: license.txt:12
armarx::ExternalApplicationManager::onConnectComponent
void onConnectComponent() override
Definition: ExternalApplicationManager.cpp:200
ArmarXManager.h
armarx::MessageTypeT::INFO
@ INFO
ExternalApplicationManager.h
boost::process::posix::initializers::on_exec_setup
on_exec_setup_< Handler > on_exec_setup(Handler handler)
Definition: on_exec_setup.hpp:35
armarx::Contains
bool Contains(const ContainerType &container, const ElementType &searchElement)
Definition: algorithm.h:295
armarx::TimeUtil::MSSleep
static void MSSleep(int durationMS)
lock the calling thread for a given duration (like usleep(...) but using Timeserver time)
Definition: TimeUtil.cpp:94
armarx::Split
std::vector< std::string > Split(const std::string &source, const std::string &splitBy, bool trimElements=false, bool removeEmptyElements=false)
Definition: StringHelperTemplates.h:35
armarx::ManagedIceObject::getArmarXManager
ArmarXManagerPtr getArmarXManager() const
Returns the ArmarX manager used to add and remove components.
Definition: ManagedIceObject.cpp:348
armarx::CMakePackageFinder
The CMakePackageFinder class provides an interface to the CMake Package finder capabilities.
Definition: CMakePackageFinder.h:53
boost
Definition: ApplicationOptions.h:37
armarx::ExternalApplicationManagerPropertyDefinitions
Definition: ExternalApplicationManager.h:57
armarx::ExternalApplicationManager::createPropertyDefinitions
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
Definition: ExternalApplicationManager.cpp:219
boost::process::posix::wait_for_exit
int wait_for_exit(const Process &p)
Definition: wait_for_exit.hpp:21
armarx::PropertyUser::hasProperty
bool hasProperty(const std::string &name)
Definition: PropertyUser.cpp:243
armarx::ExternalApplicationManager::addStarterObject
void addStarterObject()
Definition: ExternalApplicationManager.cpp:409
boost::process::windows::initializers::start_in_dir
start_in_dir_< std::string > start_in_dir(const char *s)
Definition: start_in_dir.hpp:51
boost::process::posix::create_pipe
pipe create_pipe()
Definition: create_pipe.hpp:20
cxxopts::empty
bool empty(const std::string &s)
Definition: cxxopts.hpp:255
armarx::ExternalApplicationManager::onInitComponent
void onInitComponent() override
Definition: ExternalApplicationManager.cpp:153
armarx::ExternalApplicationManager::addApplicationArguments
virtual void addApplicationArguments(Ice::StringSeq &args)
Definition: ExternalApplicationManager.cpp:121
armarx::ExternalApplicationManager::terminateApplication
void terminateApplication(const Ice::Current &) override
Definition: ExternalApplicationManager.cpp:351
initializers.hpp
armarx::ExternalApplicationManager::ExternalApplicationManagerStarter
friend struct ExternalApplicationManagerStarter
Definition: ExternalApplicationManager.h:183
armarx::ExternalApplicationManager::deriveWorkingDir
virtual std::string deriveWorkingDir() const
Definition: ExternalApplicationManager.cpp:245
armarx::ExternalApplicationManagerPropertyDefinitions::ExternalApplicationManagerPropertyDefinitions
ExternalApplicationManagerPropertyDefinitions(std::string prefix)
Definition: ExternalApplicationManager.cpp:49
armarx::CMakePackageFinder::getName
std::string getName() const
Returns the name of the given package.
Definition: CMakePackageFinder.cpp:480
armarx::flush
const LogSender::manipulator flush
Definition: LogSender.h:251
data
uint8_t data[1]
Definition: EtherCATFrame.h:68
ARMARX_DEBUG
#define ARMARX_DEBUG
Definition: Logging.h:177
armarx::CMakePackageFinder::getBinaryDir
std::string getBinaryDir() const
Definition: CMakePackageFinder.h:159
boost::process::posix::initializers::set_args
set_args_< Range > set_args(const Range &range)
Definition: set_args.hpp:52
boost::process::posix::terminate
void terminate(const Process &p)
Definition: terminate.hpp:20
armarx::ExternalApplicationManager::addDependencyObject
void addDependencyObject()
Definition: ExternalApplicationManager.cpp:399
ARMARX_ERROR
#define ARMARX_ERROR
Definition: Logging.h:189
boost::process::posix::search_path
std::string search_path(const std::string &filename, std::string path="")
Definition: search_path.hpp:23
armarx::Application::getInstance
static ApplicationPtr getInstance()
Retrieve shared pointer to the application object.
Definition: Application.cpp:289
boost::source
Vertex source(const detail::edge_base< Directed, Vertex > &e, const PCG &)
Definition: point_cloud_graph.h:681
ARMARX_LOG_S
#define ARMARX_LOG_S
Definition: Logging.h:145
armarx::ExternalApplicationManager::onDisconnectComponent
void onDisconnectComponent() override
Definition: ExternalApplicationManager.cpp:207
armarx::TimeUtil::GetTime
static IceUtil::Time GetTime(TimeMode timeMode=TimeMode::VirtualTime)
Get the current time.
Definition: TimeUtil.cpp:42
armarx::control::common::getValue
T getValue(nlohmann::json &userConfig, nlohmann::json &defaultConfig, const std::string &entryName)
Definition: utils.h:71
armarx::Component::getConfigIdentifier
std::string getConfigIdentifier()
Retrieve config identifier for this component as set in constructor.
Definition: Component.cpp:74
CMakePackageFinder.h
armarx::ComponentPropertyDefinitions
Default component property definition container.
Definition: Component.h:70
TimeUtil.h
ARMARX_INFO
#define ARMARX_INFO
Definition: Logging.h:174
armarx::PropertyUser::getProperty
Property< PropertyType > getProperty(const std::string &name)
Property creation and retrieval.
Definition: PropertyUser.h:179
armarx::LogSender::SetComponentName
static void SetComponentName(const std::string &componentName)
Definition: LogSender.cpp:155
armarx::ExternalApplicationManager::getPathToApplication
std::string getPathToApplication(const Ice::Current &) override
Definition: ExternalApplicationManager.cpp:357
IceUtil::Handle< class PropertyDefinitionContainer >
armarx::ArmarXDataPath::ReplaceEnvVars
static bool ReplaceEnvVars(std::string &string)
ReplaceEnvVars replaces environment variables in a string with their values, if the env.
Definition: ArmarXDataPath.cpp:483
armarx::CMakePackageFinder::ReplaceCMakePackageFinderVars
static bool ReplaceCMakePackageFinderVars(std::string &string)
Replaces occurrences like $C{PACKAGE_NAME:VAR_NAME} with their CMakePackageFinder value.
Definition: CMakePackageFinder.cpp:630
armarx::ExternalApplicationManager::onExitComponent
void onExitComponent() override
Definition: ExternalApplicationManager.cpp:213
armarx::ManagedIceObject::getName
std::string getName() const
Retrieve name of object.
Definition: ManagedIceObject.cpp:107
armarx::Logging::setTag
void setTag(const LogTag &tag)
Definition: Logging.cpp:55
Logging.h
armarx::ExternalApplicationManager::isApplicationRunning
bool isApplicationRunning(const Ice::Current &) override
Definition: ExternalApplicationManager.cpp:363
armarx::PropertyDefinitionsPtr
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
Definition: forward_declarations.h:34
ArmarXDataPath.h
armarx::LogTag
Definition: LoggingUtil.h:66
armarx::ManagedIceObject::usingProxy
bool usingProxy(const std::string &name, const std::string &endpoints="")
Registers a proxy for retrieval after initialization and adds it to the dependency list.
Definition: ManagedIceObject.cpp:151
armarx::ctrlutil::s
double s(double t, double s0, double v0, double a0, double j)
Definition: CtrlUtil.h:33
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28
Application.h
armarx::ExternalApplicationManager::restartApplication
void restartApplication(const Ice::Current &) override
Definition: ExternalApplicationManager.cpp:344
armarx::split
std::vector< std::string > split(const std::string &source, const std::string &splitBy, bool trimElements=false, bool removeEmptyElements=false)
Definition: StringHelpers.cpp:36