#include <Manager.h>
Classes | |
struct | ECFactoryPredicate |
class | FactoryPredicate |
struct | Finalized |
struct | InstanceName |
struct | ModuleFactories |
class | ModulePredicate |
class | OrbRunner |
OrbRunner class. More... | |
struct | Term |
class | Terminator |
Terminator class. More... | |
Public Member Functions | |
bool | activateManager () |
Activate the Manager. | |
void | cleanupComponent (RTObject_impl *comp) |
Unregister RT-Components. | |
void | cleanupComponents () |
This method deletes RT-Components. | |
RTObject_impl * | createComponent (const char *comp_args) |
Create RT-Components. | |
ExecutionContextBase * | createContext (const char *ec_args) |
Create Context. | |
void | deleteComponent (RTObject_impl *comp) |
Unregister RT-Components that have been registered to Manager. | |
void | deleteComponent (const char *instance_name) |
Unregister RT-Components that have been registered to Manager. | |
RTObject_impl * | getComponent (const char *instance_name) |
Get RT-Component's pointer. | |
std::vector< RTObject_impl * > | getComponents () |
Get all RT-Components registered in the Manager. | |
coil::Properties & | getConfig () |
Get the manager configuration. | |
std::vector< coil::Properties > | getFactoryProfiles () |
Get profiles of factories. | |
std::vector< coil::Properties > | getLoadableModules () |
Get a list of loadable modules. | |
std::vector< coil::Properties > | getLoadedModules () |
Get a list of loaded modules. | |
std::string & | getLogLevel () |
Get the log level of the configuration. | |
LogStreamBuf & | getLogStreamBuf () |
Get the log buffer. | |
std::vector< std::string > | getModulesFactories () |
Get the list of all Factories. | |
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. | |
void | join () |
Wait for Manager's termination. | |
void | load (const char *fname, const char *initfunc) |
[CORBA interface] Load module | |
void | notifyFinalized (RTObject_impl *comp) |
This method deletes RT-Components. | |
bool | registerComponent (RTObject_impl *comp) |
Register RT-Component directly without Factory. | |
bool | registerECFactory (const char *name, ECNewFunc new_func, ECDeleteFunc delete_func) |
Register ExecutionContext Factory. | |
bool | registerFactory (coil::Properties &profile, RtcNewFunc new_func, RtcDeleteFunc delete_func) |
Register RT-Component Factory. | |
void | runManager (bool no_block=false) |
Run the Manager. | |
void | setModuleInitProc (ModuleInitProc proc) |
Set initial procedure. | |
void | shutdown () |
Shutdown Manager. | |
void | terminate () |
Terminate manager. | |
void | unload (const char *fname) |
Unload module. | |
void | unloadAll () |
bool | unregisterComponent (RTObject_impl *comp) |
Unregister RT-Components. | |
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, RTObject_impl, InstanceName > | ComponentManager |
typedef ObjectManager< const char *, ECFactoryBase, ECFactoryPredicate > | ECFactoryManager |
typedef ObjectManager< const coil::Properties, FactoryBase, FactoryPredicate > | FactoryManager |
ComponentFactory. | |
Protected Member Functions | |
void | configureComponent (RTObject_impl *comp, const coil::Properties &prop) |
Configure RT-Component. | |
void | createORBEndpointOption (std::string &opt, coil::vstring &endpoint) |
Create a command optional line of Endpoint of ORB. | |
void | createORBEndpoints (coil::vstring &endpoints) |
Create Endpoints. | |
std::string | createORBOptions () |
Create ORB command options. | |
std::string | formatString (const char *naming_format, coil::Properties &prop) |
Construct registration information when registering to Naming server. | |
bool | initComposite () |
PeriodicECSharedComposite initialization. | |
bool | initExecContext () |
ExecutionContextManager initialization. | |
bool | initFactories () |
Factories initialization. | |
bool | initLogger () |
System logger initialization. | |
void | initManager (int argc, char **argv) |
Manager internal initialization. | |
bool | initManagerServant () |
ManagerServant initialization. | |
bool | initNaming () |
NamingManager initialization. | |
bool | initORB () |
CORBA ORB initialization. | |
bool | initTimer () |
Timer initialization. | |
Manager () | |
Protected Constructor. | |
Manager (const Manager &manager) | |
Protected Copy Constructor. | |
bool | mergeProperty (coil::Properties &prop, const char *file_name) |
Merge property information. | |
bool | procComponentArgs (const char *comp_arg, coil::Properties &comp_id, coil::Properties &comp_conf) |
Extracting component type/properties from the given string. | |
bool | procContextArgs (const char *ec_args, std::string &ec_id, coil::Properties &ec_conf) |
Extracting ExecutionContext's name/properties from the given string. | |
void | shutdownComponents () |
NamingManager finalization. | |
void | shutdownLogger () |
System Logger finalization. | |
void | shutdownManager () |
Shutdown Manager. | |
void | shutdownNaming () |
NamingManager finalization. | |
void | shutdownOnNoRtcs () |
Shutdown Manager. | |
void | shutdownORB () |
ORB finalization. | |
Protected Attributes | |
ComponentManager | m_compManager |
ComponentManager. | |
coil::Properties | m_config |
Managaer's configuration Properties. | |
ECFactoryManager | m_ecfactory |
ExecutionContext Manager. | |
std::vector < ExecutionContextBase * > | m_ecs |
ExecutionContext list. | |
FactoryManager | m_factory |
ComponentManager. | |
Finalized | m_finalized |
ModuleInitProc | m_initProc |
User's initialization function's pointer. | |
std::vector< std::filebuf * > | m_logfiles |
Files for log output. | |
LogStreamBuf | m_logStreamBuf |
Logger buffer. | |
RTM::ManagerServant * | m_mgrservant |
The pointer to the ManagerServant. | |
ModuleManager * | m_module |
The pointer to the ModuleManager. | |
NamingManager * | m_namingManager |
The pointer to the NamingManager. | |
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. | |
OrbRunner * | m_runner |
The pointer to ORB helper class. | |
Term | m_terminate |
Synchronous flag for manager termination. | |
Terminator * | m_terminator |
The pointer to ORB termination helper class. | |
coil::Timer * | m_timer |
Timer Object. | |
Logger | rtclog |
Logger stream. | |
Static Protected Attributes | |
static Manager * | manager = NULL |
The pointer to the Manager. | |
static Mutex | mutex |
The mutex of the pointer to the Manager. | |
Private Types | |
typedef coil::Guard< Mutex > | Guard |
typedef coil::Mutex | Mutex |
Manager class.
This is a manager class that manages various information such as components.
typedef ObjectManager<std::string, RTObject_impl, InstanceName> RTC::Manager::ComponentManager [protected] |
typedef ObjectManager<const char*, ECFactoryBase, ECFactoryPredicate> RTC::Manager::ECFactoryManager [protected] |
typedef ObjectManager<const coil::Properties, FactoryBase, FactoryPredicate> RTC::Manager::FactoryManager [protected] |
typedef coil::Guard<Mutex> RTC::Manager::Guard [private] |
typedef coil::Mutex RTC::Manager::Mutex [private] |
RTC::Manager::Manager | ( | ) | [protected] |
RTC::Manager::Manager | ( | const Manager & | manager | ) | [protected] |
Protected Copy Constructor.
Protected Copy Constructor
manager | Manager object of copy source |
Definition at line 95 of file Manager.cpp.
bool RTC::Manager::activateManager | ( | ) |
Activate the Manager.
This operation do the following:
This operation should be invoked after Manager:init(), and before runManager().
Definition at line 244 of file Manager.cpp.
void RTC::Manager::cleanupComponent | ( | RTObject_impl * | comp | ) |
Unregister RT-Components.
Unregister specified RT-Component's instances from naming service.
comp | Target RT-Components for the unregistration |
Definition at line 1524 of file Manager.cpp.
void RTC::Manager::cleanupComponents | ( | ) |
This method deletes RT-Components.
This method deletes RT-Components registered by notifyFinalized().
Definition at line 1530 of file Manager.cpp.
void RTC::Manager::configureComponent | ( | RTObject_impl * | comp, |
const coil::Properties & | prop | ||
) | [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 |
Definition at line 1653 of file Manager.cpp.
RTObject_impl * RTC::Manager::createComponent | ( | const char * | comp_args | ) |
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 |
Definition at line 520 of file Manager.cpp.
ExecutionContextBase * RTC::Manager::createContext | ( | const char * | ec_args | ) |
void RTC::Manager::createORBEndpointOption | ( | std::string & | opt, |
coil::vstring & | endpoint | ||
) | [protected] |
Create a command optional line of Endpoint of ORB.
opt | ORB options |
endpoint | Endpoints list |
Definition at line 1189 of file Manager.cpp.
void RTC::Manager::createORBEndpoints | ( | coil::vstring & | endpoints | ) | [protected] |
Create Endpoints.
Create Endpoints from the configuration.
endpoints | Endpoints list |
Definition at line 1152 of file Manager.cpp.
std::string RTC::Manager::createORBOptions | ( | ) | [protected] |
Create ORB command options.
ORB command option creation.
Create ORB launch options from configuration information that has been set.
Definition at line 1137 of file Manager.cpp.
void RTC::Manager::deleteComponent | ( | RTObject_impl * | comp | ) |
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.
comp | Target RT-Component's instances for the unregistration |
Definition at line 748 of file Manager.cpp.
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.
instance_name | Target RT-Component's instances for the unregistration |
Definition at line 783 of file Manager.cpp.
std::string RTC::Manager::formatString | ( | const char * | naming_format, |
coil::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 |
Definition at line 1752 of file Manager.cpp.
RTObject_impl * 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 |
Definition at line 803 of file Manager.cpp.
std::vector< RTObject_impl * > RTC::Manager::getComponents | ( | ) |
Get all RT-Components registered in the Manager.
Get all RT-Component's instances that have been registered to Manager.
Definition at line 816 of file Manager.cpp.
coil::Properties& RTC::Manager::getConfig | ( | ) | [inline] |
std::vector< coil::Properties > RTC::Manager::getFactoryProfiles | ( | ) |
Get profiles of factories.
Get profiles of factories.
Definition at line 456 of file Manager.cpp.
std::vector< coil::Properties > RTC::Manager::getLoadableModules | ( | ) |
Get a list of loadable modules.
Get loadable module list. (Currently, unimplemented on ModuleManager side)
Definition at line 417 of file Manager.cpp.
std::vector< coil::Properties > RTC::Manager::getLoadedModules | ( | ) |
Get a list of loaded modules.
Get module list that is currently loaded into manager.
Definition at line 404 of file Manager.cpp.
std::string& RTC::Manager::getLogLevel | ( | ) | [inline] |
LogStreamBuf& RTC::Manager::getLogStreamBuf | ( | ) | [inline] |
std::vector< std::string > RTC::Manager::getModulesFactories | ( | ) |
Get the list of all Factories.
Get the list of all factories that have been registered.
Definition at line 502 of file Manager.cpp.
CORBA::ORB_ptr RTC::Manager::getORB | ( | ) |
Get the pointer to ORB.
Get the pointer to the ORB.
Get the pointer to ORB that has been set to Manager.
Definition at line 832 of file Manager.cpp.
PortableServer::POA_ptr RTC::Manager::getPOA | ( | ) |
Get a pointer to RootPOA held by Manager.
Get the pointer to the RootPOA.
Get the pointer to RootPOA that has been set to Manager.
Definition at line 845 of file Manager.cpp.
PortableServer::POAManager_ptr RTC::Manager::getPOAManager | ( | ) |
Get POAManager that Manager has.
Get the pointer to the POAManager.
Get POAMAnager that has been set to Manager.
Definition at line 858 of file Manager.cpp.
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. |
Definition at line 110 of file Manager.cpp.
bool RTC::Manager::initComposite | ( | ) | [protected] |
PeriodicECSharedComposite initialization.
Definition at line 1401 of file Manager.cpp.
bool RTC::Manager::initExecContext | ( | ) | [protected] |
ExecutionContextManager initialization.
Initialize each ExecutionContext that is used, and register each ExecutionContext creation Factory to ExecutionContextManager.
Definition at line 1392 of file Manager.cpp.
bool RTC::Manager::initFactories | ( | ) | [protected] |
Factories initialization.
Initialize buffer factories, thread factories, publisher factories, provider factories, and consumer factories.
Definition at line 1409 of file Manager.cpp.
bool RTC::Manager::initLogger | ( | ) | [protected] |
System logger initialization.
Initialize System logger. Initialize logger and set it according to the set information in configuration file,
Definition at line 977 of file Manager.cpp.
void RTC::Manager::initManager | ( | int | argc, |
char ** | argv | ||
) | [protected] |
Manager internal initialization.
Execute Manager's internal initialization processing.
argc | Number of commandline arguments |
argv | Commandline arguments |
Definition at line 878 of file Manager.cpp.
bool RTC::Manager::initManagerServant | ( | ) | [protected] |
ManagerServant initialization.
Definition at line 1429 of file Manager.cpp.
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.
Definition at line 1320 of file Manager.cpp.
bool RTC::Manager::initORB | ( | ) | [protected] |
CORBA ORB initialization.
Initialize ORB based on the configuration given by arguments.
Definition at line 1073 of file Manager.cpp.
bool RTC::Manager::initTimer | ( | ) | [protected] |
Timer initialization.
Initialize each Timer that is used. (In current implementation, nothing is done.)
Definition at line 1423 of file Manager.cpp.
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.
Definition at line 140 of file Manager.cpp.
void RTC::Manager::join | ( | ) |
Wait for Manager's termination.
Wait for Manager's termination to synchronize.
Definition at line 208 of file Manager.cpp.
void RTC::Manager::load | ( | const char * | fname, |
const char * | initfunc | ||
) |
[CORBA interface] Load module
Load module.
Load specified module (shared library, DLL etc..), and invoke initialize function.
fname | The module file name |
initfunc | The initialize function name |
Definition at line 346 of file Manager.cpp.
bool RTC::Manager::mergeProperty | ( | coil::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 |
Definition at line 1725 of file Manager.cpp.
void RTC::Manager::notifyFinalized | ( | RTObject_impl * | comp | ) |
This method deletes RT-Components.
The deleted RT-Component is registered. The registered RT-Components are deleted by cleanupComponents().
Deleted | RT component |
Definition at line 1543 of file Manager.cpp.
bool RTC::Manager::procComponentArgs | ( | const char * | comp_arg, |
coil::Properties & | comp_id, | ||
coil::Properties & | comp_conf | ||
) | [protected] |
Extracting component type/properties from the given string.
This operation extracts component type name and its properties from the figen character string. The given string formats is the following.
[RTC type]?[key(0)]=[val(0)]&[key(1)]=[val(1)]...[key(n)]=[val(n)]
Returned value "comp_id" has keys of "vendor", "category", "implementation_id", "version", and returned as Properties type object. "comp_conf" is returned as Properties type object includeing component properties to be given to component.
comp_arg | character string to be processed |
comp_type | extracted component type name |
comp_prop | extracted component's properties |
Definition at line 1557 of file Manager.cpp.
bool RTC::Manager::procContextArgs | ( | const char * | ec_args, |
std::string & | ec_id, | ||
coil::Properties & | ec_conf | ||
) | [protected] |
Extracting ExecutionContext's name/properties from the given string.
This operation extracts ExecutionContext's name and its properties from the figen character string. The given string formats is the following.
[ExecutionContext's name]?[key(0)]=[val(0)]&[key(1)]=[val(1)]...[key(n)]=[val(n)]
"ec_conf" is returned as Properties type object includeing component properties to be given to component.
ec_arg | character string to be processed |
ec_type | extracted ExecutionContext's name |
ec_prop | extracted ExecutionContext's properties |
Reimplemented in Tests::ManagerTestMock.
Definition at line 1616 of file Manager.cpp.
bool RTC::Manager::registerComponent | ( | RTObject_impl * | 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 |
Definition at line 678 of file Manager.cpp.
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 |
Definition at line 474 of file Manager.cpp.
bool RTC::Manager::registerFactory | ( | coil::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 |
Definition at line 433 of file Manager.cpp.
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. |
Definition at line 318 of file Manager.cpp.
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 |
Definition at line 232 of file Manager.cpp.
void RTC::Manager::shutdown | ( | ) |
Shutdown Manager.
Terminate manager's processing. After terminating ORB, shutdown manager in sync.
Definition at line 182 of file Manager.cpp.
void RTC::Manager::shutdownComponents | ( | ) | [protected] |
NamingManager finalization.
Get a list of RT-Components that have been registered to NamingManager, and shutdown all components.
Definition at line 1483 of file Manager.cpp.
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.
Definition at line 1046 of file Manager.cpp.
void RTC::Manager::shutdownManager | ( | ) | [protected] |
Shutdown Manager.
Manager internal finalization.
Shutdown Manager (However, not implemented now)
Definition at line 947 of file Manager.cpp.
void RTC::Manager::shutdownNaming | ( | ) | [protected] |
NamingManager finalization.
Finalize NamingManager. Unbind all registered elements and shutdown them.
Definition at line 1375 of file Manager.cpp.
void RTC::Manager::shutdownOnNoRtcs | ( | ) | [protected] |
Shutdown Manager.
This method shutdowns Manager as follows.
Definition at line 953 of file Manager.cpp.
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.
Definition at line 1240 of file Manager.cpp.
void RTC::Manager::terminate | ( | ) |
Terminate manager.
Terminate Manager.
Terminate manager's processing
Definition at line 169 of file Manager.cpp.
void RTC::Manager::unload | ( | const char * | fname | ) |
Unload module.
Unload module.
fname | The module file name |
Definition at line 376 of file Manager.cpp.
void RTC::Manager::unloadAll | ( | ) |
Unload all modules.
Definition at line 390 of file Manager.cpp.
bool RTC::Manager::unregisterComponent | ( | RTObject_impl * | comp | ) |
Unregister RT-Components.
Unregister specified RT-Components
comp | Target RT-Component's instances for the unregistration |
Definition at line 701 of file Manager.cpp.
ComponentManager RTC::Manager::m_compManager [protected] |
coil::Properties RTC::Manager::m_config [protected] |
Managaer's configuration Properties.
ECFactoryManager RTC::Manager::m_ecfactory [protected] |
std::vector<ExecutionContextBase*> RTC::Manager::m_ecs [protected] |
FactoryManager RTC::Manager::m_factory [protected] |
Finalized RTC::Manager::m_finalized [protected] |
ModuleInitProc RTC::Manager::m_initProc [protected] |
std::vector<std::filebuf*> RTC::Manager::m_logfiles [protected] |
LogStreamBuf RTC::Manager::m_logStreamBuf [protected] |
RTM::ManagerServant* RTC::Manager::m_mgrservant [protected] |
The pointer to the ManagerServant.
ModuleManager* RTC::Manager::m_module [protected] |
The pointer to the ModuleManager.
NamingManager* RTC::Manager::m_namingManager [protected] |
The pointer to the NamingManager.
CORBA::ORB_var RTC::Manager::m_pORB [protected] |
PortableServer::POA_var RTC::Manager::m_pPOA [protected] |
PortableServer::POAManager_var RTC::Manager::m_pPOAManager [protected] |
OrbRunner* RTC::Manager::m_runner [protected] |
Term RTC::Manager::m_terminate [protected] |
Terminator* RTC::Manager::m_terminator [protected] |
coil::Timer* RTC::Manager::m_timer [protected] |
Manager * RTC::Manager::manager = NULL [static, protected] |
coil::Mutex RTC::Manager::mutex [static, protected] |
Logger RTC::Manager::rtclog [protected] |