YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
SafeManager Class Reference

#include </home/runner/work/yarp-documentation/yarp-documentation/yarp/src/guis/yarpmanager/src-manager/safe_manager.h>

+ Inheritance diagram for SafeManager:

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 ()
 
- Public Member Functions inherited from yarp::manager::Manager
 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)
 
NodegetNode (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 ()
 
ExecutablePContainergetExecutables ()
 
ExecutablegetExecutableById (size_t id)
 
bool switchBroker (size_t id)
 
CnnContainergetConnections ()
 
ResourcePContainergetResources ()
 
const char * getApplicationName ()
 
void enableRestrictedMode ()
 
void disableRestrictedMode ()
 
void enableAutoConnect ()
 
void disableAutoConnect ()
 
void enableAutoDependency ()
 
void disableAutoDependency ()
 
void enableWatchDog ()
 
void disableWatchod ()
 
bool exportDependencyGraph (const char *szFileName)
 
KnowledgeBasegetKnowledgeBase ()
 
ErrorLoggergetLogger ()
 
- Public Member Functions inherited from yarp::manager::MEvent
 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
 

Detailed Description

Definition at line 54 of file safe_manager.h.

Constructor & Destructor Documentation

◆ SafeManager()

SafeManager::SafeManager ( )

Definition at line 15 of file safe_manager.cpp.

◆ ~SafeManager()

SafeManager::~SafeManager ( )
overridedefault

Member Function Documentation

◆ busy()

bool SafeManager::busy ( )

Definition at line 87 of file safe_manager.cpp.

◆ checkSemaphore()

bool SafeManager::checkSemaphore ( )
inline

Definition at line 79 of file safe_manager.h.

◆ close()

void SafeManager::close ( )

Definition at line 24 of file safe_manager.cpp.

◆ onCnnFailed()

void SafeManager::onCnnFailed ( void *  which)
overrideprotectedvirtual

Reimplemented from yarp::manager::Manager.

Definition at line 621 of file safe_manager.cpp.

◆ onCnnStablished()

void SafeManager::onCnnStablished ( void *  which)
overrideprotectedvirtual

Reimplemented from yarp::manager::Manager.

Definition at line 618 of file safe_manager.cpp.

◆ onError()

void SafeManager::onError ( void *  which)
overrideprotectedvirtual

Reimplemented from yarp::manager::Manager.

Definition at line 661 of file safe_manager.cpp.

◆ onExecutableDied()

void SafeManager::onExecutableDied ( void *  which)
overrideprotectedvirtual

Reimplemented from yarp::manager::Manager.

Definition at line 566 of file safe_manager.cpp.

◆ onExecutableFailed()

void SafeManager::onExecutableFailed ( void *  which)
overrideprotectedvirtual

Reimplemented from yarp::manager::Manager.

Definition at line 577 of file safe_manager.cpp.

◆ onExecutableStart()

void SafeManager::onExecutableStart ( void *  which)
overrideprotectedvirtual

Reimplemented from yarp::manager::Manager.

Definition at line 530 of file safe_manager.cpp.

◆ onExecutableStdout()

void SafeManager::onExecutableStdout ( void *  which,
const char *  msg 
)
overrideprotectedvirtual

Reimplemented from yarp::manager::Manager.

Definition at line 651 of file safe_manager.cpp.

◆ onExecutableStop()

void SafeManager::onExecutableStop ( void *  which)
overrideprotectedvirtual

Reimplemented from yarp::manager::Manager.

Definition at line 540 of file safe_manager.cpp.

◆ postSemaphore()

void SafeManager::postSemaphore ( )
inline

Definition at line 80 of file safe_manager.h.

◆ prepare()

bool SafeManager::prepare ( yarp::manager::Manager lazy,
yarp::os::Property config,
ApplicationEvent event = nullptr 
)

Definition at line 31 of file safe_manager.cpp.

◆ run()

void SafeManager::run ( )
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.

◆ safeAttachStdout()

void SafeManager::safeAttachStdout ( std::vector< int > &  MIDs)

Definition at line 487 of file safe_manager.cpp.

◆ safeConnect()

void SafeManager::safeConnect ( std::vector< int > &  CIDs)

Definition at line 435 of file safe_manager.cpp.

◆ safeDetachStdout()

void SafeManager::safeDetachStdout ( std::vector< int > &  MIDs)

Definition at line 501 of file safe_manager.cpp.

◆ safeDisconnect()

void SafeManager::safeDisconnect ( std::vector< int > &  CDs)

Definition at line 451 of file safe_manager.cpp.

◆ safeKill()

void SafeManager::safeKill ( std::vector< int > &  MIDs,
std::vector< int > &  CIDs,
std::vector< int > &  RIDs 
)

Definition at line 417 of file safe_manager.cpp.

◆ safeLoadBalance()

void SafeManager::safeLoadBalance ( )

Definition at line 516 of file safe_manager.cpp.

◆ safeRefresh()

void SafeManager::safeRefresh ( std::vector< int > &  MIDs,
std::vector< int > &  CIDs,
std::vector< int > &  RIDs 
)

Definition at line 467 of file safe_manager.cpp.

◆ safeRun()

void SafeManager::safeRun ( std::vector< int > &  MIDs,
std::vector< int > &  CIDs,
std::vector< int > &  RIDs 
)

Definition at line 383 of file safe_manager.cpp.

◆ safeStop()

void SafeManager::safeStop ( std::vector< int > &  MIDs,
std::vector< int > &  CIDs,
std::vector< int > &  RIDs 
)

Definition at line 400 of file safe_manager.cpp.

◆ threadInit()

bool SafeManager::threadInit ( )
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.

◆ threadRelease()

void SafeManager::threadRelease ( )
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.

◆ waitSemaphore()

void SafeManager::waitSemaphore ( )
inline

Definition at line 81 of file safe_manager.h.


The documentation for this class was generated from the following files: