ArmarXObjectScheduler.cpp
Go to the documentation of this file.
1 /*
2  * This file is part of ArmarX.
3  *
4  * Copyright (C) 2011-2016, High Performance Humanoid Technologies (H2T), Karlsruhe Institute of Technology (KIT), all rights reserved.
5  *
6  * ArmarX is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation.
9  *
10  * ArmarX is distributed in the hope that it will be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  *
18  * @package ArmarXCore::core
19  * @author Kai Welke (kai dot welke at kit dot edu)
20  * @date 2012
21  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
22  * GNU General Public License
23  */
24 
25 #include <ArmarXCore/core/ArmarXManager.h> // for ArmarXManagerPtr, etc
26 #include <ArmarXCore/core/IceManager.h> // for IceManager, ObjectHandles
27 #include <ArmarXCore/core/ManagedIceObject.h> // for ManagedIceObject
29 #include <ArmarXCore/core/exceptions/Exception.h> // for handleExceptions, etc
31 
32 #include <Ice/BuiltinSequences.h> // for StringSeq
33 #include <Ice/ObjectAdapter.h> // for ObjectAdapterPtr
34 #include <IceGrid/Admin.h> // for AdminPrx, Admin
35 #include <IceGrid/Exception.h> // for DeploymentException, etc
36 #include <IceStorm/IceStorm.h> // for TopicPrx
37 #include <IceUtil/Time.h> // for Time
38 
39 #include <SimoxUtility/algorithm/string/string_tools.h>
40 
41 #include <cstddef> // for NULL
42 #include <algorithm> // for min
43 #include <map> // for _Rb_tree_iterator, etc
44 #include <ostream> // for operator<<, etc
45 #include <utility> // for pair
46 #include <vector> // for vector, vector<>::iterator
47 #include <memory>
48 
49 #include "ArmarXCore/core/ArmarXFwd.h" // for ArmarXManagerPtr, etc
51 #include "ArmarXCore/core/logging/LogSender.h" // for LogSender, flush
52 #include "ArmarXCore/core/logging/Logging.h" // for ARMARX_VERBOSE, etc
53 #include "ArmarXCore/interface/core/ManagedIceObjectDefinitions.h"
54 #include "ArmarXCore/interface/core/ManagedIceObjectDependencyBase.h"
55 #include "ArmarXCore/interface/core/ThreadingIceBase.h" // for upCast
56 #include "ArmarXObjectScheduler.h"
57 #include "ManagedIceObjectImpl.h"
58 #include "IceGridAdmin.h" // for IceGridAdmin
59 
60 #define WAITMESSAGEINTERVAL (long)5000
61 
62 namespace armarx
63 {
64  // *******************************************************
65  // construction
66  // *******************************************************
67 
68 
69  ArmarXObjectScheduler::ArmarXObjectScheduler(const ArmarXManagerPtr& armarXManager, const IceManagerPtr& iceManager, const ManagedIceObjectPtr& object, Ice::ObjectAdapterPtr objectAdapterToAddTo, bool startSchedulingObject)
70  : armarXManager(armarXManager),
71  iceManager(iceManager),
72  managedObject(object),
73  terminateRequested(false),
74  objectedInitialized(false),
75  tryReconnect(true),
76  objectAdapterToAddTo(objectAdapterToAddTo)
77  {
78  setTag("ObjectScheduler");
79  // set object scheduler and armarxManager in managedIceObject
80  object->impl->objectScheduler = this;
81  object->impl->armarXManager = armarXManager;
82 
83  interruptCondition = std::make_shared<std::condition_variable>();
84  interruptConditionVariable = std::make_shared<bool>();
85  if (startSchedulingObject)
86  // start management thread
87  {
89  }
90 
91  }
92 
93 
94 
96  {
97  wakeupDependencyCheck();
98 
99  if (scheduleObjectTask)
100  {
101  scheduleObjectTask->stop(true);
102  }
103 
104  // ARMARX_VERBOSE << "~ArmarXObjectScheduler()" ;
105  }
106 
108  {
109  if (!scheduleObjectTask)
110  {
111  scheduleObjectTask = new RunningTask<ArmarXObjectScheduler>(this, &ArmarXObjectScheduler::scheduleObject, managedObject->getName() + "ArmarXObjectScheduler");
112  }
113 
114  if (!scheduleObjectTask->isRunning())
115  {
116  scheduleObjectTask->start();
117  }
118  else
119  {
120  ARMARX_INFO << managedObject->getName() << " already scheduled";
121  }
122  }
123 
124  // *******************************************************
125  // termination handling
126  // *******************************************************
128  {
129  terminateRequested = true;
130 
131  if (managedObject)
132  {
133  managedObject->impl->stateCondition.notify_all();
134  }
135 
137  {
138  std::scoped_lock lock(interruptMutex);
139  *interruptConditionVariable = true;
140  }
141  interruptCondition->notify_all();
142 
143  if (scheduleObjectTask)
144  {
145  scheduleObjectTask->stop(false);
146  }
147  }
148 
150  {
151  while (scheduleObjectTask && !scheduleObjectTask->waitForFinished(5000))
152  {
153  ARMARX_INFO << managedObject->getName() << " is blocking the removal - continuing to wait.";
154  }
155  std::unique_lock lock(managedObject->impl->objectStateMutex);
156 
157  while (managedObject->impl->objectState != eManagedIceObjectExited)
158  {
159  managedObject->impl->stateCondition.wait_for(lock, std::chrono::milliseconds(100));
160  ARMARX_INFO << deactivateSpam(5) << managedObject->getName() << " is blocking the removal - continuing to wait.";
161  }
162  }
163 
164  void ArmarXObjectScheduler::waitForInterrupt()
165  {
166  std::unique_lock lock(interruptMutex);
167 
168  if (terminateRequested || (scheduleObjectTask && !scheduleObjectTask->isRunning()))
169  {
170  return;
171  }
172 
173  *interruptConditionVariable = false;
174 
175  while (!*interruptConditionVariable)
176  {
177  interruptCondition->wait(lock);
178  }
179  }
180 
181 
182  bool ArmarXObjectScheduler::waitForObjectState(ManagedIceObjectState stateToWaitFor, const long timeoutMs) const
183  {
184  if (!managedObject)
185  {
186  return false;
187  }
188 
189  if (timeoutMs == -1)
190  {
191  while (!terminateRequested)
192  {
193  std::unique_lock lock(managedObject->impl->objectStateMutex);
194 
195  if (managedObject->impl->objectState != stateToWaitFor)
196  {
197  managedObject->impl->stateCondition.wait_for(lock, std::chrono::milliseconds(WAITMESSAGEINTERVAL));
198  }
199  else
200  {
201  return true;
202  }
203 
204  ARMARX_VERBOSE /*<< deactivateSpam(4)*/ << "Waiting for '" << managedObject->getName() << "' to reach state " << ManagedIceObject::GetObjectStateAsString(stateToWaitFor);
205  }
206  }
207  else
208  {
209  IceUtil::Time startTime = IceUtil::Time::now();
210  IceUtil::Time waitTime = startTime;
211  long waitTimeLeft = timeoutMs;
212 
213  while (waitTimeLeft > 0 && !terminateRequested)
214  {
215  waitTime = IceUtil::Time::now() - startTime;
216  waitTimeLeft = timeoutMs - waitTime.toMilliSeconds();
217 
218  if (waitTime.toMilliSeconds() > 2000)
219  {
220  ARMARX_VERBOSE << "Waiting for " << waitTimeLeft << "ms for '" << managedObject->getName() << "' to reach state " << ManagedIceObject::GetObjectStateAsString(stateToWaitFor);
221  }
222 
223  std::unique_lock lock(managedObject->impl->objectStateMutex);
224 
225  if (managedObject->impl->objectState != stateToWaitFor)
226  {
227  managedObject->impl->stateCondition.wait_for(lock, std::chrono::milliseconds(std::min(WAITMESSAGEINTERVAL, waitTimeLeft)));
228  }
229  else
230  {
231  return true;
232  }
233  }
234  }
235 
236  return false;
237  }
238 
239  bool ArmarXObjectScheduler::waitForObjectStateMinimum(ManagedIceObjectState minimumStateToWaitFor, const long timeoutMs) const
240  {
241  if (!managedObject)
242  {
243  return false;
244  }
245 
246  if (timeoutMs == -1)
247  {
248 
249  while (!terminateRequested)
250  {
251  std::unique_lock lock(managedObject->impl->objectStateMutex);
252 
253  if (managedObject->impl->objectState < minimumStateToWaitFor)
254  {
255  bool timeout = managedObject->impl->stateCondition.wait_for(lock, std::chrono::milliseconds(WAITMESSAGEINTERVAL)) == std::cv_status::timeout;
256  if (timeout)
257  {
258  ARMARX_IMPORTANT << /*deactivateSpam(4) <<*/ "Waiting for '" << managedObject->getName() << "' to reach minimum state "
259  << ManagedIceObject::GetObjectStateAsString(minimumStateToWaitFor) <<
260  "\nWaiting for: " << ARMARX_STREAM_PRINTER
261  {
262  if (managedObject->getUnresolvedDependencies().empty())
263  {
264  out << "nothing";
265  }
266  else
267  {
268  out << simox::alg::join(managedObject->getUnresolvedDependencies(), ", ");
269  }
270  };
271  }
272  }
273  else
274  {
275  return true;
276  }
277  }
278  }
279  else
280  {
281 
282  IceUtil::Time startTime = IceUtil::Time::now();
283  IceUtil::Time waitTime = startTime;
284  long waitTimeLeft = timeoutMs;
285 
286  while (waitTimeLeft > 0 && !terminateRequested)
287  {
288  waitTime = IceUtil::Time::now() - startTime;
289  waitTimeLeft = timeoutMs - waitTime.toMilliSeconds();
290 
291  if (waitTime.toMilliSeconds() > 2000)
292  {
293  ARMARX_IMPORTANT << "Waiting for " << waitTimeLeft << "ms for '" << managedObject->getName() << "' to reach minimum state " << ManagedIceObject::GetObjectStateAsString(minimumStateToWaitFor);
294  }
295 
296  std::unique_lock lock(managedObject->impl->objectStateMutex);
297 
298  if (managedObject->impl->objectState < minimumStateToWaitFor)
299  {
300  managedObject->impl->stateCondition.wait_for(lock, std::chrono::milliseconds(std::min(WAITMESSAGEINTERVAL, waitTimeLeft)));
301  }
302  else
303  {
304  return true;
305  }
306  }
307  }
308 
309  return false;
310  }
311 
313  {
314  return (scheduleObjectTask && scheduleObjectTask->isFinished()) ||
315  getObjectState() == eManagedIceObjectExited;
316  }
317 
319  {
320  return terminateRequested;
321  }
322 
324  {
325  return managedObject;
326  }
327  ManagedIceObjectState ArmarXObjectScheduler::getObjectState() const
328  {
329  return managedObject ? (ManagedIceObjectState)managedObject->getState() : eManagedIceObjectExited;
330  }
331 
332 
333 
334  // *******************************************************
335  // dependency resolution
336  // *******************************************************
338  {
339  IceUtil::Time startTime = IceUtil::Time::now();
340 
341  bool dependenciesResolved = false;
342 
343  while (!dependenciesResolved && !terminateRequested)
344  {
345  dependenciesResolved = checkDependenciesResolvement();
346 
347 
348 
349  if (timeoutMs != -1 && (IceUtil::Time::now() - startTime).toMilliSeconds() >= timeoutMs)
350  {
351  throw LocalException("Could not resolve dependencies in ") << timeoutMs << " ms";
352  }
353 
354  if (!dependenciesResolved) // only wait when dependencies are not resolved yet
355  {
356  std::unique_lock lock(dependencyWaitMutex);
357  dependencyWaitConditionVariable = false;
358  bool timeout = false;
359 
360  while (! dependencyWaitConditionVariable && !timeout)
361  {
362  timeout = (dependencyWaitCondition.wait_for(lock, std::chrono::milliseconds(1000)) == std::cv_status::timeout);
363  }
364  }
365 
366 
367  }
368 
369  if (!terminateRequested)
370  {
371  ARMARX_VERBOSE << "All "
372  << managedObject->getName()
373  << " dependencies resolved";
374  }
375  }
376 
378  {
379  bool dependenciesResolved = true;
380  bool stateChanged = false;
381  std::string unresolvedNames;
382 
383  // retrieve dependencies
384  DependencyMap dependencies = managedObject->getConnectivity().dependencies;
385  DependencyMap::iterator iter = dependencies.begin();
386 
387  while (iter != dependencies.end())
388  {
389  ManagedIceObjectDependencyPtr dependency = ManagedIceObjectDependencyPtr::dynamicCast(iter->second);
390 
391  // check dependency
392  dependency->check();
393 
394  // check whether dependency has been resolves
395  if (!dependency->getResolved())
396  {
397  dependenciesResolved = false;
398  unresolvedNames += "\t" + dependency->getName() + "\n";
399  }
400 
401  // check if dependecy state has changed
402  if (dependency->getStateChanged())
403  {
404  stateChanged = true;
405  }
406 
407  iter++;
408  }
409 
410  // output list of objects we still need
411  if (stateChanged)
412  {
413  if (unresolvedNames.length() > 0)
414  {
415  ARMARX_INFO << "ManagedIceObject '" << managedObject->getName() << "' still waiting for: \n " << unresolvedNames;
416  }
417  else
418  {
419  ARMARX_INFO << "All dependencies of '" << managedObject->getName() << "' resolved!";
420  }
421  }
422  return dependenciesResolved;
423  }
424 
425  void ArmarXObjectScheduler::setInteruptConditionVariable(std::shared_ptr<std::condition_variable> interruptCondition, std::shared_ptr<bool> interruptConditionVariable)
426  {
427  this->interruptCondition = interruptCondition;
428  this->interruptConditionVariable = interruptConditionVariable;
429  }
430 
432  {
433  // ARMARX_DEBUG << managedObject->getName() << " scheduler was woken up";
434  {
435  std::scoped_lock lock(dependencyWaitMutex);
436  dependencyWaitConditionVariable = true;
437  }
438  dependencyWaitCondition.notify_all();
439  }
440 
442  {
443  bool dependencyLost = false;
444  // retrieve dependencies
445  DependencyMap dependencies = managedObject->getConnectivity().dependencies;
446  DependencyMap::iterator iter = dependencies.begin();
447 
448  while (iter != dependencies.end())
449  {
450  ManagedIceObjectDependencyPtr dependency = ManagedIceObjectDependencyPtr::dynamicCast(iter->second);
451 
452  // check dependency
453  dependency->check();
454 
455  // check whether dependency has been resolved
456  if (!dependency->getResolved())
457  {
458  dependencyLost = true;
459  iceManager->removeProxyFromCache(dependency->getName(), dependency->getType());
460  }
461 
462  iter++;
463  }
464 
465  return !dependencyLost;
466 
467  }
468 
469 
470 
471 
472  bool ArmarXObjectScheduler::dependsOn(const std::string& objectName)
473  {
474  DependencyMap dependencies = managedObject->getConnectivity().dependencies;
475  DependencyMap::iterator iter = dependencies.begin();
476 
477  while (iter != dependencies.end())
478  {
479  ManagedIceObjectDependencyPtr dependency = ManagedIceObjectDependencyPtr::dynamicCast(iter->second);
480 
481  if (dependency->getName() == objectName)
482  {
483  return true;
484  }
485 
486  iter++;
487  }
488 
489  return false;
490  }
491 
493  {
494  tryReconnect = reconnect;
495  {
496  std::scoped_lock lock(interruptMutex);
497  *interruptConditionVariable = true;
498  }
499 
500  interruptCondition->notify_all();
501  }
502 
503  // *******************************************************
504  // main scheduling thread
505  // *******************************************************
506  void ArmarXObjectScheduler::scheduleObject()
507  {
508  // first let Managed ice objects initialize
509  if (!objectedInitialized)
510  {
511  initObject();
512  }
513 
514  while (!terminateRequested && (scheduleObjectTask && !scheduleObjectTask->isStopped()))
515  {
516  // try to resolve dependencies
518 
519 
520  // register component with ice
521  if (!terminateRequested)
522  {
523  startObject();
524  }
525 
526  // wait for disconnect or shutdown
527  waitForInterrupt();
528 
529  // checkDependencyStatusTask->stop();
530 
531  disconnectObject();
532 
533  if (!tryReconnect)
534  {
535  break;
536  }
537  }
538 
539  scheduleObjectTask->waitForStop();
540 
541  // exit managed object
542  if (terminateRequested)
543  {
544  exitObject();
545  }
546  }
547 
548  // *******************************************************
549  // ManagedIceObject phases
550  // *******************************************************
551  void ArmarXObjectScheduler::initObject()
552  {
553  try
554  {
555  objectedInitialized = true;
556  managedObject->init(iceManager);
557  }
558  catch (...) // dispatch and handle exception
559  {
560  managedObject->setObjectState(eManagedIceObjectInitializationFailed);
562  terminate();
563  }
564  }
565 
566  void ArmarXObjectScheduler::startObject()
567  {
568  // register to iceManager
569  ObjectHandles objectHandles = iceManager->registerObject(
570  managedObject, managedObject->getName(),
571  objectAdapterToAddTo);
572 
573  // call hook
574  try
575  {
576  managedObject->start(objectHandles.first, objectAdapterToAddTo ? objectAdapterToAddTo : objectHandles.second);
577  }
578  catch (...) // dispatch and handle exception
579  {
580  managedObject->setObjectState(eManagedIceObjectStartingFailed);
582  }
583 
584 
585  // offer topics
586  Ice::StringSeq offeredTopics = managedObject->getConnectivity().offeredTopics;
587  Ice::StringSeq::iterator iterOT = offeredTopics.begin();
588 
589  while (iterOT != offeredTopics.end())
590  {
591  iceManager->getTopic<IceStorm::TopicPrx>(*iterOT);
592  iterOT++;
593  }
594 
595  // subscribe to topics
596  Ice::StringSeq usedTopics = managedObject->getConnectivity().usedTopics;
597  Ice::StringSeq::iterator iterUT = usedTopics.begin();
598 
599  while (iterUT != usedTopics.end())
600  {
601  iceManager->subscribeTopic(objectHandles.first, *iterUT, managedObject->impl->orderedTopicPublishing[*iterUT]);
602  iterUT++;
603  }
604 
605  // retrieve (precache) proxies
606  DependencyMap dependencies = managedObject->getConnectivity().dependencies;
607  // TODO: precaching cannot work with current iceManager since it only provides
608  // a template getProxy which uses the typeid for caching
609 
610 
611  // register to admin
612  // from now on object is pingable throuhg registry and can be found by
613  // waiting ManagedIceObjects
614  IceGrid::AdminPrx admin = iceManager->getIceGridSession()->getAdmin();
615 
616  try
617  {
618  admin->addObject(objectHandles.first);
619  }
620  catch (const IceGrid::ObjectExistsException& e)
621  {
622  admin->updateObject(objectHandles.first);
623  }
624  catch (const IceGrid::DeploymentException& e)
625  {
626  ARMARX_ERROR << "*** IceGrid::Admin >> adding "
627  << managedObject->getName()
628  << " raised a DeploymentException("
629  << e.reason
630  << ")"
631  << flush;
632  }
633 
634  ARMARX_VERBOSE << "Object '" << managedObject->getName() << "' started";
635  }
636 
637  void ArmarXObjectScheduler::disconnectObject()
638  {
639  ARMARX_INFO << "disconnecting object " << managedObject->getName();
640 
641  try
642  {
643  managedObject->disconnect();
644  }
645 
646  catch (...) // dispatch and handle exception
647  {
649  }
650 
651  try
652  {
653  if (iceManager && managedObject)
654  {
655  iceManager->removeObject(managedObject->getName());
656  }
657 
658  // IceGrid::AdminPrx admin = iceManager->getIceGridSession()->getAdmin();
659  // if(getObject()->getObjectAdapter())
660  // getObject()->getObjectAdapter()->deactivate();
661  // if(managedObject->getProxy())
662  // admin->removeObject(managedObject->getProxy()->ice_getIdentity());
663  }
664  catch (IceGrid::ObjectNotRegisteredException& notRegisteredException)
665  {
666  // // removing an unregistered object
667  // //!!!
668  // ARMARX_WARNING << "removing "
669  // << getObject()->getName()
670  // << " object failed due to ObjectNotRegisteredException"
671  // << flush;
672 
673  }
674  // unsubscribe from topics
675  Ice::StringSeq usedTopics = managedObject->getConnectivity().usedTopics;
676  Ice::StringSeq::iterator iterUT = usedTopics.begin();
677 
678  try
679  {
680  while (iterUT != usedTopics.end())
681  {
682  iceManager->unsubscribeTopic(managedObject->getProxy(), *iterUT);
683  iterUT++;
684  }
685  }
686  catch (...)
687  {
688 
689  }
690  }
691 
692 
693  void ArmarXObjectScheduler::exitObject()
694  {
695  // ARMARX_INFO << "Exiting object " << managedObject->getName();
696 
697  managedObject->exit();
698 
699 
700  iceManager = nullptr;
701  armarXManager = nullptr;
702  }
703 }
ARMARX_VERBOSE
#define ARMARX_VERBOSE
Definition: Logging.h:180
armarx::ArmarXObjectScheduler::isTerminated
bool isTerminated() const
Check whether the Scheduler is terminated.
Definition: ArmarXObjectScheduler.cpp:312
armarx::ArmarXObjectScheduler::~ArmarXObjectScheduler
~ArmarXObjectScheduler() override
Definition: ArmarXObjectScheduler.cpp:95
ARMARX_IMPORTANT
#define ARMARX_IMPORTANT
Definition: Logging.h:183
armarx::ArmarXObjectScheduler::wakeupDependencyCheck
void wakeupDependencyCheck()
Definition: ArmarXObjectScheduler.cpp:431
ArmarXManager.h
armarx::ArmarXObjectScheduler::terminate
void terminate()
Terminates the ManagedIceObject.
Definition: ArmarXObjectScheduler.cpp:127
armarx::ArmarXObjectScheduler::ArmarXObjectScheduler
ArmarXObjectScheduler(const ArmarXManagerPtr &armarXManager, const IceManagerPtr &iceManager, const armarx::ManagedIceObjectPtr &object, Ice::ObjectAdapterPtr objectAdapterToAddTo, bool startSchedulingObject=true)
Constructs an ArmarXObjectScheduler.
Definition: ArmarXObjectScheduler.cpp:69
armarx::ArmarXObjectScheduler::getObjectState
ManagedIceObjectState getObjectState() const
Definition: ArmarXObjectScheduler.cpp:327
armarx::ManagedIceObject::GetObjectStateAsString
static std::string GetObjectStateAsString(int state)
Definition: ManagedIceObject.cpp:213
RunningTask.h
armarx::RunningTask
Definition: ArmarXMultipleObjectsScheduler.h:35
armarx::ArmarXObjectScheduler::checkDependenciesResolvement
bool checkDependenciesResolvement()
Definition: ArmarXObjectScheduler.cpp:377
IceInternal::Handle< ManagedIceObject >
ManagedIceObject.h
WAITMESSAGEINTERVAL
#define WAITMESSAGEINTERVAL
Definition: ArmarXObjectScheduler.cpp:60
armarx::ArmarXObjectScheduler::checkDependenciesStatus
bool checkDependenciesStatus() const
Definition: ArmarXObjectScheduler.cpp:441
armarx::flush
const LogSender::manipulator flush
Definition: LogSender.h:251
armarx::ArmarXObjectScheduler::waitForObjectState
bool waitForObjectState(ManagedIceObjectState stateToWaitFor, const long timeoutMs=-1) const
waitForObjectStart waits (thread sleeps) until the object reached a specific state.
Definition: ArmarXObjectScheduler.cpp:182
armarx::ArmarXObjectScheduler::startScheduling
void startScheduling()
Definition: ArmarXObjectScheduler.cpp:107
IceManager.h
ArmarXObjectScheduler.h
IceGridAdmin.h
armarx::ArmarXObjectScheduler::isTerminationRequested
bool isTerminationRequested() const
Definition: ArmarXObjectScheduler.cpp:318
ARMARX_ERROR
#define ARMARX_ERROR
Definition: Logging.h:189
armarx::ArmarXObjectScheduler::waitForDependencies
void waitForDependencies(int timeoutMs=-1)
waits until all depenencies are resolved.
Definition: ArmarXObjectScheduler.cpp:337
armarx::armem::Time
armarx::core::time::DateTime Time
Definition: forward_declarations.h:13
ManagedIceObjectDependency.h
armarx::ArmarXObjectScheduler::getObject
const armarx::ManagedIceObjectPtr & getObject() const
Retrieve pointer to scheduled ManagedIceObject.
Definition: ArmarXObjectScheduler.cpp:323
ArmarXFwd.h
armarx::ArmarXObjectScheduler::disconnected
void disconnected(bool reconnect)
Definition: ArmarXObjectScheduler.cpp:492
ARMARX_INFO
#define ARMARX_INFO
Definition: Logging.h:174
armarx::ArmarXObjectScheduler::dependsOn
bool dependsOn(const std::string &objectName)
Definition: ArmarXObjectScheduler.cpp:472
IceUtil::Handle< ArmarXManager >
LogSender.h
IceInternal::ProxyHandle< ::IceProxy::IceStorm::Topic >
ManagedIceObjectRegistryInterface.h
armarx::Logging::deactivateSpam
SpamFilterDataPtr deactivateSpam(float deactivationDurationSec=10.0f, const std::string &identifier="", bool deactivate=true) const
disables the logging for the current line for the given amount of seconds.
Definition: Logging.cpp:92
armarx::Logging::setTag
void setTag(const LogTag &tag)
Definition: Logging.cpp:55
Logging.h
ManagedIceObjectImpl.h
min
T min(T t1, T t2)
Definition: gdiam.h:42
armarx::ArmarXObjectScheduler::waitForTermination
void waitForTermination()
Waits until scheduler has been terminated.
Definition: ArmarXObjectScheduler.cpp:149
armarx::handleExceptions
void handleExceptions()
Definition: Exception.cpp:141
armarx::ObjectHandles
std::pair< Ice::ObjectPrx, Ice::ObjectAdapterPtr > ObjectHandles
Object handles pair which contains the object proxy and its adapter.
Definition: IceManager.h:97
armarx::ArmarXObjectScheduler::waitForObjectStateMinimum
bool waitForObjectStateMinimum(ManagedIceObjectState minimumStateToWaitFor, const long timeoutMs=-1) const
waitForObjectStart waits (thread sleeps) until the object reached a specific state (or higher/later).
Definition: ArmarXObjectScheduler.cpp:239
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28
Exception.h
ARMARX_STREAM_PRINTER
#define ARMARX_STREAM_PRINTER
use this macro to write output code that is executed when printed and thus not executed if the debug ...
Definition: Logging.h:304