Public Member Functions | |
SafeManager () | |
~SafeManager () override | |
bool | prepare (yarp::manager::Manager *lazy, yarp::os::Property *config, ApplicationEvent *event=nullptr) |
void | close () |
bool | threadInit () override |
Initialization method. | |
void | run () override |
Main body of the new thread. | |
void | threadRelease () override |
Release method. | |
void | safeRun (std::vector< int > &MIDs, std::vector< int > &CIDs, std::vector< int > &RIDs) |
void | safeStop (std::vector< int > &MIDs, std::vector< int > &CIDs, std::vector< int > &RIDs) |
void | safeKill (std::vector< int > &MIDs, std::vector< int > &CIDs, std::vector< int > &RIDs) |
void | safeConnect (std::vector< int > &CIDs) |
void | safeDisconnect (std::vector< int > &CDs) |
void | safeRefresh (std::vector< int > &MIDs, std::vector< int > &CIDs, std::vector< int > &RIDs) |
void | safeAttachStdout (std::vector< int > &MIDs) |
void | safeDetachStdout (std::vector< int > &MIDs) |
void | safeLoadBalance () |
bool | busy () |
bool | checkSemaphore () |
void | postSemaphore () |
void | waitSemaphore () |
![]() | |
Manager (bool withWatchDog=false) | |
Class Manager. | |
Manager (const char *szModPath, const char *szAppPath, const char *szResPath, bool withWatchDog=false) | |
~Manager () override | |
bool | addApplication (const char *szFileName, char **szAppName_=nullptr, bool modifyName=false) |
bool | addApplications (const char *szPath) |
bool | addModule (const char *szFileName) |
bool | addModules (const char *szPath) |
bool | addResource (const char *szFileName) |
bool | addResources (const char *szPath) |
bool | removeApplication (const char *szFileName, const char *szAppName) |
bool | removeModule (const char *szModName) |
bool | removeResource (const char *szResName) |
bool | loadApplication (const char *szAppName) |
bool | saveApplication (const char *szAppName, const char *fileName=nullptr) |
bool | updateExecutable (unsigned int id, const char *szparam, const char *szhost, const char *szstdio, const char *szworkdir, const char *szenv) |
bool | updateConnection (unsigned int id, const char *from, const char *to, const char *carrier) |
Node * | getNode (std::string appName) |
bool | run () |
bool | run (unsigned int id, bool async=false) |
bool | stop () |
bool | stop (unsigned int id, bool async=false) |
bool | kill () |
bool | kill (unsigned int id, bool async=false) |
bool | connect () |
bool | connect (unsigned int id) |
bool | disconnect () |
bool | disconnect (unsigned int id) |
bool | rmconnect (unsigned int id) |
bool | rmconnect () |
bool | running () |
bool | running (unsigned int id) |
bool | suspended () |
bool | suspended (unsigned int id) |
bool | connected () |
bool | connected (unsigned int id) |
bool | checkDependency () |
bool | exist (unsigned int id) |
bool | existPortFrom (unsigned int id) |
bool | existPortTo (unsigned int id) |
bool | attachStdout (unsigned int id) |
bool | detachStdout (unsigned int id) |
bool | updateResources () |
bool | updateResource (const char *szName) |
bool | waitingModuleRun (unsigned int id) |
bool | waitingModuleStop (unsigned int id) |
bool | waitingModuleKill (unsigned int id) |
bool | loadBalance () |
void | setDefaultBroker (const char *szBroker) |
const char * | defaultBroker () |
ExecutablePContainer & | getExecutables () |
Executable * | getExecutableById (size_t id) |
bool | switchBroker (size_t id) |
CnnContainer & | getConnections () |
ResourcePContainer & | getResources () |
const char * | getApplicationName () |
void | enableRestrictedMode () |
void | disableRestrictedMode () |
void | enableAutoConnect () |
void | disableAutoConnect () |
void | enableAutoDependency () |
void | disableAutoDependency () |
void | enableWatchDog () |
void | disableWatchod () |
bool | exportDependencyGraph (const char *szFileName) |
KnowledgeBase * | getKnowledgeBase () |
ErrorLogger * | getLogger () |
![]() | |
MEvent () | |
virtual | ~MEvent ()=default |
virtual void | onCnnReleased (void *which) |
Protected Member Functions | |
void | onExecutableStart (void *which) override |
void | onExecutableStop (void *which) override |
void | onExecutableStdout (void *which, const char *msg) override |
void | onCnnStablished (void *which) override |
void | onExecutableDied (void *which) override |
void | onExecutableFailed (void *which) override |
void | onCnnFailed (void *which) override |
void | onError (void *which) override |
Definition at line 54 of file safe_manager.h.
SafeManager::SafeManager | ( | ) |
Definition at line 15 of file safe_manager.cpp.
|
overridedefault |
bool SafeManager::busy | ( | ) |
Definition at line 87 of file safe_manager.cpp.
|
inline |
Definition at line 79 of file safe_manager.h.
void SafeManager::close | ( | ) |
Definition at line 24 of file safe_manager.cpp.
|
overrideprotectedvirtual |
Reimplemented from yarp::manager::Manager.
Definition at line 621 of file safe_manager.cpp.
|
overrideprotectedvirtual |
Reimplemented from yarp::manager::Manager.
Definition at line 618 of file safe_manager.cpp.
|
overrideprotectedvirtual |
Reimplemented from yarp::manager::Manager.
Definition at line 661 of file safe_manager.cpp.
|
overrideprotectedvirtual |
Reimplemented from yarp::manager::Manager.
Definition at line 566 of file safe_manager.cpp.
|
overrideprotectedvirtual |
Reimplemented from yarp::manager::Manager.
Definition at line 577 of file safe_manager.cpp.
|
overrideprotectedvirtual |
Reimplemented from yarp::manager::Manager.
Definition at line 530 of file safe_manager.cpp.
|
overrideprotectedvirtual |
Reimplemented from yarp::manager::Manager.
Definition at line 651 of file safe_manager.cpp.
|
overrideprotectedvirtual |
Reimplemented from yarp::manager::Manager.
Definition at line 540 of file safe_manager.cpp.
|
inline |
Definition at line 80 of file safe_manager.h.
bool SafeManager::prepare | ( | yarp::manager::Manager * | lazy, |
yarp::os::Property * | config, | ||
ApplicationEvent * | event = nullptr |
||
) |
Definition at line 31 of file safe_manager.cpp.
|
overridevirtual |
Main body of the new thread.
Override this method to do what you want. After Thread::start is called, this method will start running in a separate thread. It is important that this method either keeps checking Thread::isStopping to see if it should stop, or you override the Thread::onStop method to interact with it in some way to shut the new thread down. There is no really reliable, portable way to stop a thread cleanly unless that thread cooperates.
Implements yarp::os::Thread.
Definition at line 95 of file safe_manager.cpp.
void SafeManager::safeAttachStdout | ( | std::vector< int > & | MIDs | ) |
Definition at line 487 of file safe_manager.cpp.
void SafeManager::safeConnect | ( | std::vector< int > & | CIDs | ) |
Definition at line 435 of file safe_manager.cpp.
void SafeManager::safeDetachStdout | ( | std::vector< int > & | MIDs | ) |
Definition at line 501 of file safe_manager.cpp.
void SafeManager::safeDisconnect | ( | std::vector< int > & | CDs | ) |
Definition at line 451 of file safe_manager.cpp.
void SafeManager::safeKill | ( | std::vector< int > & | MIDs, |
std::vector< int > & | CIDs, | ||
std::vector< int > & | RIDs | ||
) |
Definition at line 417 of file safe_manager.cpp.
void SafeManager::safeLoadBalance | ( | ) |
Definition at line 516 of file safe_manager.cpp.
void SafeManager::safeRefresh | ( | std::vector< int > & | MIDs, |
std::vector< int > & | CIDs, | ||
std::vector< int > & | RIDs | ||
) |
Definition at line 467 of file safe_manager.cpp.
void SafeManager::safeRun | ( | std::vector< int > & | MIDs, |
std::vector< int > & | CIDs, | ||
std::vector< int > & | RIDs | ||
) |
Definition at line 383 of file safe_manager.cpp.
void SafeManager::safeStop | ( | std::vector< int > & | MIDs, |
std::vector< int > & | CIDs, | ||
std::vector< int > & | RIDs | ||
) |
Definition at line 400 of file safe_manager.cpp.
|
overridevirtual |
Initialization method.
The thread executes this function when it starts and before "run". This is a good place to perform initialization tasks that need to be done by the thread itself (device drivers initialization, memory allocation etc). If the function returns false the thread quits and never calls "run". The return value of threadInit() is notified to the class and passed as a parameter to afterStart(). Note that afterStart() is called by the same thread that is executing the "start" method.
Reimplemented from yarp::os::Thread.
Definition at line 79 of file safe_manager.cpp.
|
overridevirtual |
Release method.
The thread executes this function once when it exits, after the last "run". This is a good place to release resources that were initialized in threadInit() (release memory, and device driver resources).
Reimplemented from yarp::os::Thread.
Definition at line 83 of file safe_manager.cpp.
|
inline |
Definition at line 81 of file safe_manager.h.