RTC::Manager Class Reference

Manager class. More...

#include <Manager.h>

List of all members.

Public Member Functions

void terminate ()
 Terminate manager.
void shutdown ()
 Shutdown Manager.
void join ()
 Wait for Manager's termination.
LogbufgetLogbuf ()
 Get the log buffer.
MedLogbufgetMedLogbuf ()
PropertiesgetConfig ()
 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.
RtcBasecreateComponent (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.
RtcBasegetComponent (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 Managerinit (int argc, char **argv)
 Initialize manager.
static Managerinstance ()
 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.
ModuleManagerm_module
 The pointer to the ModuleManager.
NamingManagerm_namingManager
 The pointer to the NamingManager.
CorbaObjectManagerm_objManager
 The pointer to the CORBA ObjectManager.
Timerm_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.
OrbRunnerm_runner
Terminatorm_terminator
 Terminator.
Term m_terminate

Static Protected Attributes

static Managermanager
 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...


Detailed Description

Manager class.

This is a manager class that manages various information such as components.

Since:
0.2.0

Member Typedef Documentation

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]


Constructor & Destructor Documentation

RTC::Manager::Manager (  )  [protected]

Protected Constructor.

Protected Constructor

RTC::Manager::Manager ( const Manager manager  )  [protected]

Protected Copy Constructor.

Protected Copy Constructor

Parameters:
manager Manager object of copy source


Member Function Documentation

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

Parameters:
argc The number of command line arguments.
argv The array of the command line arguments.
Returns:
Reference of the unique instance of Manager

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.

Returns:
The only instance reference of the manager

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.

Returns:
Log buffer to 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.

Returns:
Manager's configuration

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.

Parameters:
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().

Returns:
Activation result (Successful:true, Failed:false)

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.

Parameters:
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.

Parameters:
fname The module file name
initfunc The initialize function name

void RTC::Manager::unload ( const char *  fname  ) 

Unload module.

Unload module.

Parameters:
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.

Returns:
Module list that has been loaded.

std::vector<std::string> RTC::Manager::getLoadableModules (  ) 

Get a list of loadable modules.

Get loadable module list. (Currently, unimplemented on ModuleManager side)

Returns:
Loadable module list

bool RTC::Manager::registerFactory ( Properties profile,
RtcNewFunc  new_func,
RtcDeleteFunc  delete_func 
)

Register RT-Component Factory.

Register Factory to create RT-Component's instances.

Parameters:
profile RT-Component profile
new_func RT-Component creation function
delete_func RT-Component destruction function
Returns:
Registration result (Successful:true, Failed:false)

bool RTC::Manager::registerECFactory ( const char *  name,
ECNewFunc  new_func,
ECDeleteFunc  delete_func 
)

Register ExecutionContext Factory.

Register Factory to create ExecutionContext's instances.

Parameters:
name ExecutionContext name for the creation
new_func ExecutionContext creation function
delete_func ExecutionContext destruction function
Returns:
Registration result (Successful:true, Failed:false)

std::vector<std::string> RTC::Manager::getModulesFactories (  ) 

Get the list of all Factories.

Get the list of all factories that have been registered.

Returns:
Registered factory list

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.

Parameters:
module_name Target RT-Component names for the creation
Returns:
Created RT-Component's instances

void RTC::Manager::cleanupComponent ( RtcBase comp  ) 

Unregister RT-Components.

Unregister specified RT-Component's instances from naming service.

Parameters:
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.

Parameters:
comp Target RT-Component's instances for the registration
Returns:
Registration result (Successful:true, Failed:false)

bool RTC::Manager::unregisterComponent ( RtcBase comp  ) 

Unregister RT-Components.

Unregister specified RT-Components

Parameters:
comp Target RT-Component's instances for the unregistration
Returns:
Unregistration result (Successful:true, Failed:false)

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.

Parameters:
comp Target RT-Component's instance for the bind
Returns:
Binding result (Successful:true, Failed:false)

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)

Parameters:
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.

Parameters:
instance_name Target RT-Component's name for searching
Returns:
Target RT-Component's instances that matches

std::vector<RtcBase*> RTC::Manager::getComponents (  ) 

Get all RT-Components registered in the Manager.

Get all RT-Component's instances that have been registered to Manager.

Returns:
List of all RT-Component's instances

CORBA::ORB_ptr RTC::Manager::getORB (  ) 

Get the pointer to ORB.

Get the pointer to ORB that has been set to Manager.

Returns:
ORB object

PortableServer::POA_ptr RTC::Manager::getPOA (  ) 

Get a pointer to RootPOA held by Manager.

Get the pointer to RootPOA that has been set to Manager.

Returns:
RootPOA object

PortableServer::POAManager_ptr RTC::Manager::getPOAManager (  ) 

Get POAManager that Manager has.

Get POAMAnager that has been set to Manager.

Returns:
POA manager

void RTC::Manager::initManager ( int  argc,
char **  argv 
) [protected]

Manager internal initialization.

Execute Manager's internal initialization processing.

Parameters:
argc Number of commandline arguments
argv Commandline arguments

void RTC::Manager::shutdownManager (  )  [protected]

Shutdown Manager.

Shutdown Manager (However, not implemented now)

bool RTC::Manager::initLogger (  )  [protected]

System logger initialization.

Initialize System logger. Initialize logger and set it according to the set information in configuration file,

Returns:
Initialization result (Successful:true, Failed:false)

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.

Returns:
ORB initialization result (Successful:true, Failed:false)

std::string RTC::Manager::createORBOptions (  )  [protected]

Create ORB command options.

Create ORB launch options from configuration information that has been set.

Returns:
ORB launch options

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.

Returns:
Initialization result (Successful:true, Failed:false)

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.

Parameters:
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.

Returns:
ExecutionContextManager initialization result (Successful:true, Failed:false)

bool RTC::Manager::initTimer (  )  [protected]

Timer initialization.

Initialize each Timer that is used. (In current implementation, nothing is done.)

Returns:
Timer Initialization result (Successful:true, Failed:false)

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.

Parameters:
prop Target properties for the merge
file_name File name that property information is described
Returns:
Merge result (Successful:true, Failed:false)

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:

Parameters:
naming_format Format specification for NamingService registration
prop Property information that is used
Returns:
Specification format conversion result


Member Data Documentation

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]

Terminator.

Term RTC::Manager::m_terminate [protected]


Generated on Wed May 21 05:17:34 2008 for OpenRTM by  doxygen 1.5.3