#include <Manager.h>
Public Member Functions | |
void | terminate () |
Terminate manager. | |
void | shutdown () |
Shutdown Manager. | |
void | join () |
Wait for Manager's termination. | |
Logbuf & | getLogbuf () |
Get the log buffer. | |
MedLogbuf & | getMedLogbuf () |
Properties & | getConfig () |
Get the manager configuration. | |
void | setModuleInitProc (ModuleInitProc proc) |
Set initial procedure. | |
bool | activateManager () |
Activate the Manager. | |
void | runManager (bool no_block=false) |
Run the Manager. | |
void | load (const char *fname, const char *initfunc) |
[CORBA interface] Load module | |
void | unload (const char *fname) |
Unload module. | |
void | unloadAll () |
Unload all modules. | |
std::vector < std::string > | getLoadedModules () |
Get a list of loaded modules. | |
std::vector < std::string > | getLoadableModules () |
Get a list of loadable modules. | |
bool | registerFactory (Properties &profile, RtcNewFunc new_func, RtcDeleteFunc delete_func) |
Register RT-Component Factory. | |
bool | registerECFactory (const char *name, ECNewFunc new_func, ECDeleteFunc delete_func) |
Register ExecutionContext Factory. | |
std::vector < std::string > | getModulesFactories () |
Get the list of all Factories. | |
RtcBase * | createComponent (const char *module_name) |
Create RT-Components. | |
void | cleanupComponent (RtcBase *comp) |
Unregister RT-Components. | |
bool | registerComponent (RtcBase *comp) |
Register RT-Component directly without Factory. | |
bool | unregisterComponent (RtcBase *comp) |
Unregister RT-Components. | |
bool | bindExecutionContext (RtcBase *comp) |
Bind ExecutionContext to RT-Component. | |
void | deleteComponent (const char *instance_name) |
Unregister RT-Components that have been registered to Manager. | |
RtcBase * | getComponent (const char *instance_name) |
Get RT-Component's pointer. | |
std::vector< RtcBase * > | getComponents () |
Get all RT-Components registered in the Manager. | |
CORBA::ORB_ptr | getORB () |
Get the pointer to ORB. | |
PortableServer::POA_ptr | getPOA () |
Get a pointer to RootPOA held by Manager. | |
PortableServer::POAManager_ptr | getPOAManager () |
Get POAManager that Manager has. | |
Static Public Member Functions | |
static Manager * | init (int argc, char **argv) |
Initialize manager. | |
static Manager & | instance () |
Get instance of the manager. | |
Protected Types | |
typedef ObjectManager < std::string, RtcBase, InstanceName > | ComponentManager |
typedef ObjectManager< const char *, FactoryBase, FactoryPredicate > | FactoryManager |
ComponentFactory. | |
typedef ObjectManager< const char *, ECFactoryBase, ECFactoryPredicate > | ECFactoryManager |
Protected Member Functions | |
Manager () | |
Protected Constructor. | |
Manager (const Manager &manager) | |
Protected Copy Constructor. | |
void | initManager (int argc, char **argv) |
Manager internal initialization. | |
void | shutdownManager () |
Shutdown Manager. | |
bool | initLogger () |
System logger initialization. | |
void | shutdownLogger () |
System Logger finalization. | |
bool | initORB () |
CORBA ORB initialization. | |
std::string | createORBOptions () |
Create ORB command options. | |
void | shutdownORB () |
ORB finalization. | |
bool | initNaming () |
NamingManager initialization. | |
void | shutdownNaming () |
NamingManager finalization. | |
void | shutdownComponents () |
NamingManager finalization. | |
void | configureComponent (RtcBase *comp) |
Configure RT-Component. | |
bool | initExecContext () |
ExecutionContextManager initialization. | |
bool | initTimer () |
Timer initialization. | |
bool | mergeProperty (Properties &prop, const char *file_name) |
Merge property information. | |
std::string | formatString (const char *naming_format, Properties &prop) |
Construct registration information when registering to Naming server. | |
Protected Attributes | |
CORBA::ORB_var | m_pORB |
The pointer to the ORB. | |
PortableServer::POA_var | m_pPOA |
The pointer to the POA. | |
PortableServer::POAManager_var | m_pPOAManager |
The pointer to the POAManager. | |
ModuleInitProc | m_initProc |
User's initialization function's pointer. | |
Properties | m_config |
Managaer's configuration Properties. | |
ModuleManager * | m_module |
The pointer to the ModuleManager. | |
NamingManager * | m_namingManager |
The pointer to the NamingManager. | |
CorbaObjectManager * | m_objManager |
The pointer to the CORBA ObjectManager. | |
Timer * | m_timer |
Timer Object. | |
Logbuf | m_Logbuf |
Logger buffer. | |
MedLogbuf | m_MedLogbuf |
Logger mediation buffer. | |
LogStream | rtcout |
Logger stream. | |
ComponentManager | m_compManager |
ComponentManager. | |
FactoryManager | m_factory |
ComponentManager. | |
ECFactoryManager | m_ecfactory |
ExecutionContext Manager. | |
std::vector < ExecutionContextBase * > | m_ecs |
ExecutionContext list. | |
OrbRunner * | m_runner |
Terminator * | m_terminator |
Terminator. | |
Term | m_terminate |
Static Protected Attributes | |
static Manager * | manager |
The pointer to the Manager. | |
static ACE_Thread_Mutex | mutex |
The mutex of the pointer to the Manager. | |
Classes | |
struct | ECFactoryPredicate |
struct | FactoryPredicate |
struct | InstanceName |
struct | ModuleFactories |
class | OrbRunner |
OrbRunner class. More... | |
struct | Term |
class | Terminator |
Terminator class. More... |
This is a manager class that manages various information such as components.
typedef ObjectManager<std::string, RtcBase, InstanceName> RTC::Manager::ComponentManager [protected] |
typedef ObjectManager<const char*, FactoryBase, FactoryPredicate> RTC::Manager::FactoryManager [protected] |
ComponentFactory.
typedef ObjectManager<const char*, ECFactoryBase, ECFactoryPredicate> RTC::Manager::ECFactoryManager [protected] |
RTC::Manager::Manager | ( | ) | [protected] |
Protected Constructor.
Protected Constructor
RTC::Manager::Manager | ( | const Manager & | manager | ) | [protected] |
Protected Copy Constructor.
Protected Copy Constructor
manager | Manager object of copy source |
static Manager* RTC::Manager::init | ( | int | argc, | |
char ** | argv | |||
) | [static] |
Initialize manager.
This is the static member function to initialize the Manager. The Manager is initialized by given commandline arguments. To use the manager, this initialization member function init() must be called. The manager has two static functions to get the instance such as init() and instance(). Since initializing process is only performed by the init() function, the init() has to be called at the beginning of the lifecycle of the Manager.
*Initialization of manager
argc | The number of command line arguments. | |
argv | The array of the command line arguments. |
static Manager& RTC::Manager::instance | ( | ) | [static] |
Get instance of the manager.
This is the static member function to get the instance of the Manager. Before calling this function, ensure that the initialization function "init()" is called.
void RTC::Manager::terminate | ( | ) |
Terminate manager.
Terminate manager's processing
void RTC::Manager::shutdown | ( | ) |
Shutdown Manager.
Terminate manager's processing. After terminating ORB, shutdown manager in sync.
void RTC::Manager::join | ( | ) |
Wait for Manager's termination.
Wait for Manager's termination to synchronize.
Logbuf& RTC::Manager::getLogbuf | ( | ) | [inline] |
Get the log buffer.
Get the log buffer that has been set to manager.
MedLogbuf& RTC::Manager::getMedLogbuf | ( | ) | [inline] |
Properties& RTC::Manager::getConfig | ( | ) | [inline] |
Get the manager configuration.
Get the manager configuration that has been set to manager.
void RTC::Manager::setModuleInitProc | ( | ModuleInitProc | proc | ) |
Set initial procedure.
This operation sets the initial procedure call to process module initialization, other user defined initialization and so on. The given procedure will be called at the proper timing after the manager initialization, activation and run.
proc | A function pointer to the initial procedure call |
bool RTC::Manager::activateManager | ( | ) |
Activate the Manager.
This operation do the following:
This operation should be invoked after Manager:init(), and before runManager().
void RTC::Manager::runManager | ( | bool | no_block = false |
) |
Run the Manager.
This operation processes the main event loop of the Manager. In this main loop, CORBA's ORB event loop or other processes are performed. As the default behavior, this operation is going to blocking mode and never returns until Manager::destroy() is called. When the given argument "no_block" is set to "true", this operation creates a thread to process the event loop internally, and it doesn't block and returns.
no_block | false: Blocking mode, true: non-blocking mode. |
void RTC::Manager::load | ( | const char * | fname, | |
const char * | initfunc | |||
) |
[CORBA interface] Load module
Load specified module (shared library, DLL etc..), and invoke initialize function.
fname | The module file name | |
initfunc | The initialize function name |
void RTC::Manager::unload | ( | const char * | fname | ) |
Unload module.
Unload module.
fname | The module file name |
void RTC::Manager::unloadAll | ( | ) |
Unload all modules.
Unload all modules.
std::vector<std::string> RTC::Manager::getLoadedModules | ( | ) |
Get a list of loaded modules.
Get module list that is currently loaded into manager.
std::vector<std::string> RTC::Manager::getLoadableModules | ( | ) |
Get a list of loadable modules.
Get loadable module list. (Currently, unimplemented on ModuleManager side)
bool RTC::Manager::registerFactory | ( | Properties & | profile, | |
RtcNewFunc | new_func, | |||
RtcDeleteFunc | delete_func | |||
) |
Register RT-Component Factory.
Register Factory to create RT-Component's instances.
profile | RT-Component profile | |
new_func | RT-Component creation function | |
delete_func | RT-Component destruction function |
bool RTC::Manager::registerECFactory | ( | const char * | name, | |
ECNewFunc | new_func, | |||
ECDeleteFunc | delete_func | |||
) |
Register ExecutionContext Factory.
Register Factory to create ExecutionContext's instances.
name | ExecutionContext name for the creation | |
new_func | ExecutionContext creation function | |
delete_func | ExecutionContext destruction function |
std::vector<std::string> RTC::Manager::getModulesFactories | ( | ) |
Get the list of all Factories.
Get the list of all factories that have been registered.
RtcBase* RTC::Manager::createComponent | ( | const char * | module_name | ) |
Create RT-Components.
Create specified RT-Component's instances via registered Factory. When its instances have been created successfully, the following processings are also executed.
module_name | Target RT-Component names for the creation |
void RTC::Manager::cleanupComponent | ( | RtcBase * | comp | ) |
Unregister RT-Components.
Unregister specified RT-Component's instances from naming service.
comp | Target RT-Components for the unregistration |
bool RTC::Manager::registerComponent | ( | RtcBase * | comp | ) |
Register RT-Component directly without Factory.
Register specified RT-Component's instances not via Factory to Manager directly.
comp | Target RT-Component's instances for the registration |
bool RTC::Manager::unregisterComponent | ( | RtcBase * | comp | ) |
Unregister RT-Components.
Unregister specified RT-Components
comp | Target RT-Component's instances for the unregistration |
bool RTC::Manager::bindExecutionContext | ( | RtcBase * | comp | ) |
Bind ExecutionContext to RT-Component.
Bind ExecutionContext to specified RT-Component. Specify the type of bound ExecutionContext according to "exec_cxt.periodic.type" attribute in property file.
comp | Target RT-Component's instance for the bind |
void RTC::Manager::deleteComponent | ( | const char * | instance_name | ) |
Unregister RT-Components that have been registered to Manager.
Unregister RT-Components that have been registered to manager Remove specified RT-Component from naming service, terminate itself and release its instances. (Currently, not implemented)
instance_name | Target RT-Component's instances for the unregistration |
RtcBase* RTC::Manager::getComponent | ( | const char * | instance_name | ) |
Get RT-Component's pointer.
Search RT-Component that has been registered to Manager by its specified name, and get it that matches.
instance_name | Target RT-Component's name for searching |
std::vector<RtcBase*> RTC::Manager::getComponents | ( | ) |
CORBA::ORB_ptr RTC::Manager::getORB | ( | ) |
PortableServer::POA_ptr RTC::Manager::getPOA | ( | ) |
PortableServer::POAManager_ptr RTC::Manager::getPOAManager | ( | ) |
void RTC::Manager::initManager | ( | int | argc, | |
char ** | argv | |||
) | [protected] |
void RTC::Manager::shutdownManager | ( | ) | [protected] |
bool RTC::Manager::initLogger | ( | ) | [protected] |
System logger initialization.
Initialize System logger. Initialize logger and set it according to the set information in configuration file,
void RTC::Manager::shutdownLogger | ( | ) | [protected] |
System Logger finalization.
Finalize System Logger. If log information stored in the buffer exists, output information to the log file forcibly and close it.
bool RTC::Manager::initORB | ( | ) | [protected] |
CORBA ORB initialization.
Initialize ORB based on the configuration given by arguments.
std::string RTC::Manager::createORBOptions | ( | ) | [protected] |
Create ORB command options.
Create ORB launch options from configuration information that has been set.
void RTC::Manager::shutdownORB | ( | ) | [protected] |
ORB finalization.
Finalize ORB . When the waiting process exists, wait until it completes. In actual finalization, deactivate POA Manager and then shutdown of ORB.
bool RTC::Manager::initNaming | ( | ) | [protected] |
NamingManager initialization.
Initialize NamingManager . However, operate nothing, if it is set to property that NamingManager is not used. Register default NamingServer that is set to property information, when NamingManager is used. Also, launch a timer that updates information automatically at specified cycle and register the method for the update to the timer, when it is set to update it reguraly.
void RTC::Manager::shutdownNaming | ( | ) | [protected] |
NamingManager finalization.
Finalize NamingManager. Unbind all registered elements and shutdown them.
void RTC::Manager::shutdownComponents | ( | ) | [protected] |
NamingManager finalization.
Get a list of RT-Components that have been registered to NamingManager, and shutdown all components.
void RTC::Manager::configureComponent | ( | RtcBase * | comp | ) | [protected] |
Configure RT-Component.
Read property files described each RT-Component's type and instance, and configure it to the component. Also, get each component's registered name when registering to NamingService and configure it.
comp | Target RT-Component for the configuration |
bool RTC::Manager::initExecContext | ( | ) | [protected] |
ExecutionContextManager initialization.
Initialize each ExecutionContext that is used, and register each ExecutionContext creation Factory to ExecutionContextManager.
bool RTC::Manager::initTimer | ( | ) | [protected] |
bool RTC::Manager::mergeProperty | ( | Properties & | prop, | |
const char * | file_name | |||
) | [protected] |
Merge property information.
Load property information that is configured in the specified file, and merge existing properties that has been configured.
prop | Target properties for the merge | |
file_name | File name that property information is described |
std::string RTC::Manager::formatString | ( | const char * | naming_format, | |
Properties & | prop | |||
) | [protected] |
Construct registration information when registering to Naming server.
Construct information when registering to NameServer based on specified format and property information. Each format specification character means as follows:
naming_format | Format specification for NamingService registration | |
prop | Property information that is used |
Manager* RTC::Manager::manager [static, protected] |
The pointer to the Manager.
ACE_Thread_Mutex RTC::Manager::mutex [static, protected] |
The mutex of the pointer to the Manager.
CORBA::ORB_var RTC::Manager::m_pORB [protected] |
The pointer to the ORB.
PortableServer::POA_var RTC::Manager::m_pPOA [protected] |
The pointer to the POA.
PortableServer::POAManager_var RTC::Manager::m_pPOAManager [protected] |
The pointer to the POAManager.
ModuleInitProc RTC::Manager::m_initProc [protected] |
User's initialization function's pointer.
Properties RTC::Manager::m_config [protected] |
Managaer's configuration Properties.
ModuleManager* RTC::Manager::m_module [protected] |
The pointer to the ModuleManager.
NamingManager* RTC::Manager::m_namingManager [protected] |
The pointer to the NamingManager.
CorbaObjectManager* RTC::Manager::m_objManager [protected] |
The pointer to the CORBA ObjectManager.
Timer* RTC::Manager::m_timer [protected] |
Timer Object.
Logbuf RTC::Manager::m_Logbuf [protected] |
Logger buffer.
MedLogbuf RTC::Manager::m_MedLogbuf [protected] |
Logger mediation buffer.
LogStream RTC::Manager::rtcout [protected] |
Logger stream.
ComponentManager RTC::Manager::m_compManager [protected] |
ComponentManager.
FactoryManager RTC::Manager::m_factory [protected] |
ComponentManager.
ECFactoryManager RTC::Manager::m_ecfactory [protected] |
ExecutionContext Manager.
std::vector<ExecutionContextBase*> RTC::Manager::m_ecs [protected] |
ExecutionContext list.
OrbRunner* RTC::Manager::m_runner [protected] |
Terminator* RTC::Manager::m_terminator [protected] |
Term RTC::Manager::m_terminate [protected] |