|
cisst-saw
|
#include <mtsManagerLocal.h>
Public Member Functions | |
| void | Cleanup (void) |
| Cleanup. Left in the public API for backwards compatibility. Client code should not call this method directly, and should instead call DeleteInstance prior to quitting. DeleteInstance calls this method before deleting the singleton. | |
| const std::string CISST_DEPRECATED | GetName (void) const |
| const mtsManagerComponentServices * | GetManagerComponentServices () const |
| const ManagerLocalComponent * | GetLoggerServices () const |
| mtsComponent * | CreateComponentDynamically (const std::string &className, const std::string &componentName, const std::string &constructorArgSerialized) |
| Create a component. Does not add it to the local component manager. In this method, componentName is only used if constructorArgSerialized is an empty string. | |
| mtsComponent * | CreateComponentDynamically (const std::string &className, const mtsGenericObject &constructorArg) |
| Create a component. Does not add it to the local component manager. In this method, the component name is obtained from constructorArg. | |
| bool | AddComponent (mtsComponent *component) |
| Add a component to the component manager. | |
| bool CISST_DEPRECATED | AddTask (mtsTask *component) |
| bool CISST_DEPRECATED | AddDevice (mtsComponent *component) |
| bool | RemoveComponent (mtsComponent *component) |
| Remove component from component manager. | |
| bool | RemoveComponent (const std::string &componentName) |
| size_t | RemoveAllUserComponents (void) |
| Remove all user components from this local component manager. | |
| mtsComponent * | GetComponent (const std::string &componentName) const |
| Retrieve a component by name. | |
| mtsTask * | GetComponentAsTask (const std::string &componentName) const |
| mtsComponent CISST_DEPRECATED * | GetDevice (const std::string &deviceName) |
| mtsTask CISST_DEPRECATED * | GetTask (const std::string &taskName) |
| bool | FindComponent (const std::string &componentName) const |
| Check if a component exists by its name. | |
| bool | WaitForStateAll (mtsComponentState desiredState, double timeout=3.0 *cmn_minute) const |
| void | CreateAll (void) |
| Create all components. If a component is of type mtsTask, mtsTask::Create() is called internally. | |
| bool | CreateAllAndWait (double timeoutInSeconds) |
| void | StartAll (void) |
| Start all components. If a component is of type mtsTask, mtsTask::Start() is called internally. | |
| bool | StartAllAndWait (double timeoutInSeconds) |
| void | KillAll (void) |
| Stop all components. If a component is of type mtsTask, mtsTask::Kill() is called internally. | |
| bool | KillAllAndWait (double timeoutInSeconds) |
| bool | Connect (const std::string &clientComponentName, const std::string &clientInterfaceRequiredName, const std::string &serverComponentName, const std::string &serverInterfaceProvidedName) |
| Connect two local interfaces. | |
| bool | Connect (const std::string &clientProcessName, const std::string &clientComponentName, const std::string &clientInterfaceRequiredName, const std::string &serverProcessName, const std::string &serverComponentName, const std::string &serverInterfaceProvidedName) |
| Connect two remote interfaces. | |
| bool | Disconnect (const ConnectionIDType connectionID) |
| bool | Disconnect (const std::string &clientComponentName, const std::string &clientInterfaceRequiredName, const std::string &serverComponentName, const std::string &serverInterfaceProvidedName) |
| bool | Disconnect (const std::string &clientProcessName, const std::string &clientComponentName, const std::string &clientInterfaceRequiredName, const std::string &serverProcessName, const std::string &serverComponentName, const std::string &serverInterfaceProvidedName) |
| const std::string | GetProcessName (void) const |
| void | GetNamesOfProcesses (std::vector< std::string > &namesOfProcesses) const |
| std::vector< std::string > | GetNamesOfComponents (void) const |
| void | GetNamesOfComponents (std::vector< std::string > &namesOfComponents) const |
| void | GetNamesOfComponents (const std::string &processName, std::vector< std::string > &namesOfComponents) const |
| std::vector< mtsDescriptionComponent > | GetDescriptionsOfComponents (const std::string &processName="") const |
| bool | GetNamesOfInterfaces (const std::string &processName, const std::string &componentName, std::vector< std::string > &namesOfInterfacesRequired, std::vector< std::string > &namesOfInterfacesProvided) const |
| bool | GetNamesOfInterfaces (const std::string &componentName, std::vector< std::string > &namesOfInterfacesRequired, std::vector< std::string > &namesOfInterfacesProvided) const |
| bool | GetDescriptionsOfInterfaces (const std::string &processName, const std::string &componentName, std::vector< mtsDescriptionInterfaceFullName > &descriptionsRequired, std::vector< mtsDescriptionInterfaceFullName > &descriptionsProvided) const |
| bool | GetDescriptionsOfInterfaces (const std::string &componentName, std::vector< mtsDescriptionInterfaceFullName > &descriptionsRequired, std::vector< mtsDescriptionInterfaceFullName > &descriptionsProvided) const |
| std::vector< mtsDescriptionConnection > | GetListOfConnections (void) const |
| std::vector< mtsDescriptionComponentClass > | GetListOfComponentClasses (const std::string &processName="") const |
| mtsInterfaceProvidedDescription | GetInterfaceProvidedDescription (const std::string &processName, const std::string &componentName, const std::string &interfaceName) const |
| mtsInterfaceProvidedDescription | GetInterfaceProvidedDescription (const std::string &componentName, const std::string &interfaceName) const |
| mtsInterfaceRequiredDescription | GetInterfaceRequiredDescription (const std::string &processName, const std::string &componentName, const std::string &interfaceName) const |
| mtsInterfaceRequiredDescription | GetInterfaceRequiredDescription (const std::string &componentName, const std::string &interfaceName) const |
| const osaTimeServer & | GetTimeServer (void) const |
| void | SetMainThreadId (void) |
| void | SetMainThreadId (const osaThreadId &threadId) |
| osaThreadId | GetMainThreadId (void) const |
| void | GetNamesOfCommands (std::vector< std::string > &namesOfCommands, const std::string &componentName, const std::string &providedInterfaceName) |
| void | GetNamesOfEventGenerators (std::vector< std::string > &namesOfEventGenerators, const std::string &componentName, const std::string &providedInterfaceName) |
| void | GetNamesOfFunctions (std::vector< std::string > &namesOfFunctions, const std::string &componentName, const std::string &requiredInterfaceName) |
| void | GetNamesOfEventHandlers (std::vector< std::string > &namesOfEventHandlers, const std::string &componentName, const std::string &requiredInterfaceName) |
| void | GetDescriptionOfCommand (std::string &description, const std::string &componentName, const std::string &providedInterfaceName, const std::string &commandName) |
| void | GetDescriptionOfEventGenerator (std::string &description, const std::string &componentName, const std::string &providedInterfaceName, const std::string &eventGeneratorName) |
| void | GetDescriptionOfFunction (std::string &description, const std::string &componentName, const std::string &requiredInterfaceName, const std::string &functionName) |
| void | GetDescriptionOfEventHandler (std::string &description, const std::string &componentName, const std::string &requiredInterfaceName, const std::string &eventHandlerName) |
| std::string CISST_DEPRECATED | GetIPAddress (void) const |
| bool | IsValidComponentTag (const std::string &tag) const |
| bool | IsValidInterfaceTag (const std::string &tag) const |
| void | AddValidComponentTag (const std::string &tag) |
| void | AddValidInterfaceTag (const std::string &tag) |
| const std::set< std::string > & | GetValidComponentTags (void) const |
| const std::set< std::string > & | GetValidInterfaceTags (void) const |
| Public Member Functions inherited from cmnGenericObject | |
| virtual | ~cmnGenericObject (void) |
| virtual const cmnClassServicesBase * | Services (void) const =0 |
| bool | ReconstructFrom (const cmnGenericObject &other) |
| std::string | ToString (void) const |
| virtual void | ToStream (std::ostream &outputStream) const |
| virtual void | ToStreamRaw (std::ostream &outputStream, const char delimiter=' ', bool headerOnly=false, const std::string &headerPrefix="") const |
| virtual bool | FromStreamRaw (std::istream &inputStream, const char delimiter=' ') |
| virtual void | SerializeRaw (std::ostream &outputStream) const |
| virtual void | DeSerializeRaw (std::istream &inputStream) |
| virtual cmnLogger::StreamBufType * | GetLogMultiplexer (void) const |
| virtual size_t | ScalarNumber (void) const |
| virtual bool | ScalarNumberIsFixed (void) const |
| virtual double | Scalar (const size_t CMN_UNUSED(index)) const CISST_THROW(std |
| virtual std::string | ScalarDescription (const size_t CMN_UNUSED(index), const std::string &CMN_UNUSED(userDescription)) const |
Static Public Member Functions | |
| static mtsManagerLocal * | GetInstance (void) |
| static void | DeleteInstance (void) |
| DeleteInstance. Since a local component manager is a singleton, and demand-created by the first caller of GetInstance, the destructor will never be called unless an application calls this method just prior to quitting. GetInstance should NOT be used again after this method is called. This method calls Cleanup from its implementation, so a separate call to Cleanup is unnecessary. | |
| static std::vector< std::string > | GetIPAddressList (void) |
| static void | GetIPAddressList (std::vector< std::string > &ipAddresses) |
| static bool CISST_DEPRECATED | IsLogAllowed (void) |
| static bool | IsLogForwardingEnabled (void) |
| static void | SetLogForwarding (bool activate) |
| static void | GetLogForwardingState (bool &state) |
| static bool | GetLogForwardingState (void) |
| static void | LogDispatcher (const char *str, int len) |
Protected Member Functions | |
| mtsManagerLocal (void) | |
| virtual | ~mtsManagerLocal () |
| void | Initialize (void) |
| bool | CreateManagerComponent (void) |
| Create internal manager component. | |
| void | DestroyManagerComponent (void) |
| Destroy internal manager component. | |
| void | GetInterfaceProvidedDescription (const std::string &componentName, const std::string &interfaceName, mtsInterfaceProvidedDescription &interfaceProvidedDescription) |
| void | GetInterfaceRequiredDescription (const std::string &componentName, const std::string &interfaceName, mtsInterfaceRequiredDescription &interfaceRequiredDescription) |
| void | SetupSystemLogger (void) |
Protected Attributes | |
| ManagerLocalComponent * | LocalComponent |
|
protected |
Protected constructor (singleton)
|
protectedvirtual |
Destructor. Includes OS-specific cleanup.
| bool mtsManagerLocal::AddComponent | ( | mtsComponent * | component | ) |
Add a component to the component manager.
| component | Component instance to be added |
| bool CISST_DEPRECATED mtsManagerLocal::AddDevice | ( | mtsComponent * | component | ) |
| bool CISST_DEPRECATED mtsManagerLocal::AddTask | ( | mtsTask * | component | ) |
| void mtsManagerLocal::AddValidComponentTag | ( | const std::string & | tag | ) |
| void mtsManagerLocal::AddValidInterfaceTag | ( | const std::string & | tag | ) |
| void mtsManagerLocal::Cleanup | ( | void | ) |
Cleanup. Left in the public API for backwards compatibility. Client code should not call this method directly, and should instead call DeleteInstance prior to quitting. DeleteInstance calls this method before deleting the singleton.
| bool mtsManagerLocal::Connect | ( | const std::string & | clientComponentName, |
| const std::string & | clientInterfaceRequiredName, | ||
| const std::string & | serverComponentName, | ||
| const std::string & | serverInterfaceProvidedName ) |
Connect two local interfaces.
| clientComponentName | Name of client component |
| clientInterfaceRequiredName | Name of required interface |
| serverComponentName | Name of server component |
| serverInterfaceProvidedName | Name of provided interface |
| bool mtsManagerLocal::Connect | ( | const std::string & | clientProcessName, |
| const std::string & | clientComponentName, | ||
| const std::string & | clientInterfaceRequiredName, | ||
| const std::string & | serverProcessName, | ||
| const std::string & | serverComponentName, | ||
| const std::string & | serverInterfaceProvidedName ) |
Connect two remote interfaces.
| clientProcessName | Name of client process |
| clientComponentName | Name of client component |
| clientInterfaceRequiredName | Name of required interface |
| serverProcessName | Name of server process |
| serverComponentName | Name of server component |
| serverInterfaceProvidedName | Name of provided interface |
| void mtsManagerLocal::CreateAll | ( | void | ) |
Create all components. If a component is of type mtsTask, mtsTask::Create() is called internally.
| bool mtsManagerLocal::CreateAllAndWait | ( | double | timeoutInSeconds | ) |
Call CreateAll method followed by WaitForStateAll.
| mtsComponent * mtsManagerLocal::CreateComponentDynamically | ( | const std::string & | className, |
| const mtsGenericObject & | constructorArg ) |
Create a component. Does not add it to the local component manager. In this method, the component name is obtained from constructorArg.
| mtsComponent * mtsManagerLocal::CreateComponentDynamically | ( | const std::string & | className, |
| const std::string & | componentName, | ||
| const std::string & | constructorArgSerialized ) |
Create a component. Does not add it to the local component manager. In this method, componentName is only used if constructorArgSerialized is an empty string.
|
protected |
Create internal manager component.
|
static |
DeleteInstance. Since a local component manager is a singleton, and demand-created by the first caller of GetInstance, the destructor will never be called unless an application calls this method just prior to quitting. GetInstance should NOT be used again after this method is called. This method calls Cleanup from its implementation, so a separate call to Cleanup is unnecessary.
|
protected |
Destroy internal manager component.
| bool mtsManagerLocal::Disconnect | ( | const ConnectionIDType | connectionID | ) |
Disconnect two interfaces
| bool mtsManagerLocal::Disconnect | ( | const std::string & | clientComponentName, |
| const std::string & | clientInterfaceRequiredName, | ||
| const std::string & | serverComponentName, | ||
| const std::string & | serverInterfaceProvidedName ) |
| bool mtsManagerLocal::Disconnect | ( | const std::string & | clientProcessName, |
| const std::string & | clientComponentName, | ||
| const std::string & | clientInterfaceRequiredName, | ||
| const std::string & | serverProcessName, | ||
| const std::string & | serverComponentName, | ||
| const std::string & | serverInterfaceProvidedName ) |
| bool mtsManagerLocal::FindComponent | ( | const std::string & | componentName | ) | const |
Check if a component exists by its name.
| mtsComponent * mtsManagerLocal::GetComponent | ( | const std::string & | componentName | ) | const |
Retrieve a component by name.
| mtsTask * mtsManagerLocal::GetComponentAsTask | ( | const std::string & | componentName | ) | const |
| void mtsManagerLocal::GetDescriptionOfCommand | ( | std::string & | description, |
| const std::string & | componentName, | ||
| const std::string & | providedInterfaceName, | ||
| const std::string & | commandName ) |
Get description of a command in a provided interface
| void mtsManagerLocal::GetDescriptionOfEventGenerator | ( | std::string & | description, |
| const std::string & | componentName, | ||
| const std::string & | providedInterfaceName, | ||
| const std::string & | eventGeneratorName ) |
Get description of a event generator in a provided interface
| void mtsManagerLocal::GetDescriptionOfEventHandler | ( | std::string & | description, |
| const std::string & | componentName, | ||
| const std::string & | requiredInterfaceName, | ||
| const std::string & | eventHandlerName ) |
Get description of a function in a required interface
| void mtsManagerLocal::GetDescriptionOfFunction | ( | std::string & | description, |
| const std::string & | componentName, | ||
| const std::string & | requiredInterfaceName, | ||
| const std::string & | functionName ) |
Get description of a function in a required interface
| std::vector< mtsDescriptionComponent > mtsManagerLocal::GetDescriptionsOfComponents | ( | const std::string & | processName = "" | ) | const |
|
inline |
| bool mtsManagerLocal::GetDescriptionsOfInterfaces | ( | const std::string & | processName, |
| const std::string & | componentName, | ||
| std::vector< mtsDescriptionInterfaceFullName > & | descriptionsRequired, | ||
| std::vector< mtsDescriptionInterfaceFullName > & | descriptionsProvided ) const |
| mtsComponent CISST_DEPRECATED * mtsManagerLocal::GetDevice | ( | const std::string & | deviceName | ) |
|
static |
Get a singleton object of local component manager.
|
inline |
|
protected |
Get information about provided interface
| mtsInterfaceProvidedDescription mtsManagerLocal::GetInterfaceProvidedDescription | ( | const std::string & | processName, |
| const std::string & | componentName, | ||
| const std::string & | interfaceName ) const |
|
inline |
|
protected |
Extract all the information on a required interface such as function objects and event handlers with arguments serialized
| mtsInterfaceRequiredDescription mtsManagerLocal::GetInterfaceRequiredDescription | ( | const std::string & | processName, |
| const std::string & | componentName, | ||
| const std::string & | interfaceName ) const |
|
inline |
Return IP address of this process
|
static |
|
static |
Return a list of all IP addresses detected on this machine.
| std::vector< mtsDescriptionComponentClass > mtsManagerLocal::GetListOfComponentClasses | ( | const std::string & | processName = "" | ) | const |
| std::vector< mtsDescriptionConnection > mtsManagerLocal::GetListOfConnections | ( | void | ) | const |
|
static |
Get whether system-wide logging is enabled or not
|
static |
| const ManagerLocalComponent * mtsManagerLocal::GetLoggerServices | ( | ) | const |
Return the logger services. This is a method so that we can later add thread-safety.
|
inline |
Return main thread id.
| const mtsManagerComponentServices * mtsManagerLocal::GetManagerComponentServices | ( | ) | const |
Return the ManagerComponentServices. This is a method so that we can later add thread-safety.
|
inline |
Returns name of this local component manager (for mtsProxyBaseCommon.h)
| void mtsManagerLocal::GetNamesOfCommands | ( | std::vector< std::string > & | namesOfCommands, |
| const std::string & | componentName, | ||
| const std::string & | providedInterfaceName ) |
Get names of all commands in a provided interface
| void mtsManagerLocal::GetNamesOfComponents | ( | const std::string & | processName, |
| std::vector< std::string > & | namesOfComponents ) const |
| void mtsManagerLocal::GetNamesOfComponents | ( | std::vector< std::string > & | namesOfComponents | ) | const |
| std::vector< std::string > mtsManagerLocal::GetNamesOfComponents | ( | void | ) | const |
Enumerate all the names of components added
| void mtsManagerLocal::GetNamesOfEventGenerators | ( | std::vector< std::string > & | namesOfEventGenerators, |
| const std::string & | componentName, | ||
| const std::string & | providedInterfaceName ) |
Get names of all event generators in a provided interface
| void mtsManagerLocal::GetNamesOfEventHandlers | ( | std::vector< std::string > & | namesOfEventHandlers, |
| const std::string & | componentName, | ||
| const std::string & | requiredInterfaceName ) |
Get names of all event handlers in a required interface
| void mtsManagerLocal::GetNamesOfFunctions | ( | std::vector< std::string > & | namesOfFunctions, |
| const std::string & | componentName, | ||
| const std::string & | requiredInterfaceName ) |
Get names of all functions in a required interface
|
inline |
| bool mtsManagerLocal::GetNamesOfInterfaces | ( | const std::string & | processName, |
| const std::string & | componentName, | ||
| std::vector< std::string > & | namesOfInterfacesRequired, | ||
| std::vector< std::string > & | namesOfInterfacesProvided ) const |
| void mtsManagerLocal::GetNamesOfProcesses | ( | std::vector< std::string > & | namesOfProcesses | ) | const |
Get names of all processes
|
inline |
Returns name of this local component manager
| mtsTask CISST_DEPRECATED * mtsManagerLocal::GetTask | ( | const std::string & | taskName | ) |
| const osaTimeServer & mtsManagerLocal::GetTimeServer | ( | void | ) | const |
Return a reference to the time server.
| const std::set< std::string > & mtsManagerLocal::GetValidComponentTags | ( | void | ) | const |
| const std::set< std::string > & mtsManagerLocal::GetValidInterfaceTags | ( | void | ) | const |
|
protected |
Initialization
|
static |
|
static |
Is system-wide thread-safe logging enabled?
| bool mtsManagerLocal::IsValidComponentTag | ( | const std::string & | tag | ) | const |
| bool mtsManagerLocal::IsValidInterfaceTag | ( | const std::string & | tag | ) | const |
| void mtsManagerLocal::KillAll | ( | void | ) |
Stop all components. If a component is of type mtsTask, mtsTask::Kill() is called internally.
| bool mtsManagerLocal::KillAllAndWait | ( | double | timeoutInSeconds | ) |
Call KillAll method followed by WaitForStateAll.
|
static |
Callback function for system-wide thread-safe logging
| size_t mtsManagerLocal::RemoveAllUserComponents | ( | void | ) |
Remove all user components from this local component manager.
| bool mtsManagerLocal::RemoveComponent | ( | const std::string & | componentName | ) |
| bool mtsManagerLocal::RemoveComponent | ( | mtsComponent * | component | ) |
Remove component from component manager.
|
static |
Enable or disable system-wide thread-safe logging. As of 6/2026, system-wide logging will only be initialized on first call to this method.
|
inline |
Set main thread id based on the passed parameter. In most situations, it is not necessary to call this function because the main thread id is initialized in GetInstance.
|
inline |
Set main thread id based on the current thread. In most situations, it is not necessary to call this function because the main thread id is initialized in GetInstance.
|
protected |
Set up system logger that allows collecting system-wide logs across network
| void mtsManagerLocal::StartAll | ( | void | ) |
Start all components. If a component is of type mtsTask, mtsTask::Start() is called internally.
| bool mtsManagerLocal::StartAllAndWait | ( | double | timeoutInSeconds | ) |
Call StartAll method followed by WaitForStateAll.
| bool mtsManagerLocal::WaitForStateAll | ( | mtsComponentState | desiredState, |
| double | timeout = 3.0 *cmn_minute ) const |
Wait until all components reach a certain state. If all components have reach the given state within the time alloted, the method returns true.
|
protected |