MIRA
|
This class represents the core element of a modular application. More...
#include <fw/Framework.h>
Public Types | |
typedef ProtecteeMixin< MetaTypeDatabase > | ProtecteeDatabase |
typedef Base::Type | Type |
Public Member Functions | |
Framework (int argc, char **argv, bool startImmediately=false) | |
Constructor that takes command line arguments and a flag. More... | |
Framework (const std::vector< std::string > &args, bool startImmediately=false) | |
Constructor that takes command line arguments as a vector and a flag. More... | |
virtual | ~Framework () |
template<typename Reflector > | |
void | reflect (Reflector &r) |
Reflect method for serialization. More... | |
boost::shared_ptr< PropertyNode > | getProperties () |
void | load (XMLDom &xml) |
Loads the specified XML configuration and applies all registered Loaders on it. More... | |
void | load (const std::string &configFile) |
Opens the specified XML configuration file and applies all registered Loaders on it. More... | |
void | load () |
Loads configuration files given on command line if any by calling above load(const std::string& configFile) function. More... | |
void | start () |
Starts the framework and it's remote component (if one was configured or created) and returns immediately. More... | |
bool | isStarted () const |
Return true if framework is started. More... | |
Duration | getUptime () const |
Return duration since started. More... | |
virtual int | exec () |
Executes the framework and blocks until the framework is terminated, e.g. More... | |
virtual void | requestTermination (int exitcode=0) |
Requests the termination of the framework and hence the whole application. More... | |
virtual bool | isTerminationRequested () const |
Returns whether the termination of the framework is reqested. More... | |
int | getTerminationExitCode () const |
Returns the exit code as specified by requestTermination(), or 0 if requestTermination() was not called. More... | |
int | run () |
Calls the above load() and start() methods according to the command line parameters that were passed in the constructor and finally calls exec(). More... | |
std::string | getID () const |
Returns the ID of this framework. More... | |
std::string | getGlobalID () const |
Return the fully qualified global id of this framework (includes namespace) More... | |
XMLVariablesMap & | getVariables () |
Returns the list of variables that are registered via command line or config file. More... | |
XMLDomPreprocessor & | getXMLDomPreprocessor () |
ScopedAccess< ProtecteeDatabase > | getMetaDatabase () |
Return the meta database that contains all known meta information in this framework. More... | |
bool | isInExec () const |
Obtain access to framework components | |
NameRegistry & | getNameRegistry () |
Returns the reference to the name registry. More... | |
AuthorityManager & | getAuthorityManager () |
Returns the reference to the manager singleton for registered authorities. More... | |
ChannelManager & | getChannelManager () |
Returns the reference to the manager singleton for channels. More... | |
boost::shared_ptr< FrameworkTransformer > | getTransformer () |
Returns the pointer to the transform framework. More... | |
ConfigurationLoader & | getConfigurationLoader () |
Returns the reference to the configuration file loader. More... | |
boost::shared_ptr< UnitManager > | getUnitManager () |
Returns the reference to the unit manager. More... | |
RPCManager & | getRPCManager () |
Returns the reference to the manager singleton for registered RPC services. More... | |
boost::shared_ptr< ErrorService > | getErrorService () |
Returns the pointer to the persistent error service. More... | |
boost::shared_ptr< RemoteModule > | getRemoteModule () |
Returns the pointer to the remote module. More... | |
Static Public Member Functions | |
static Type & | instance () |
Returns a reference to the singleton instance. More... | |
static bool | isDestroyed () |
Returns true, if the singleton was already destroyed. More... | |
Protected Member Functions | |
void | initialize () |
void | finalize () |
void | ctrlCHandler (const IntSignal &sig) |
Static Protected Member Functions | |
static void | errorHandler (const IntSignal &sig) |
static bool | enterLeaveErrorHandler (bool enter) |
Protected Attributes | |
bool | mTerminationRequested |
int | mTerminationExitCode |
bool | mIsStarted |
bool | mInExec |
bool | mRemoteDisabled |
boost::shared_ptr< Private::FrameworkAuthority > | mAuthority |
RootPropertyNode | mPropertiesRoot |
boost::shared_ptr< PropertyNode > | mProperties |
NameRegistry | mNames |
boost::shared_ptr< RemoteModule > | mRemoteModule |
RPCManager | mRPCManager |
ChannelManager | mChannelManager |
AuthorityManager | mAuthorityManager |
boost::shared_ptr< FrameworkTransformer > | mTransformer |
boost::shared_ptr< UnitManager > | mUnitManager |
ConfigurationLoader | mConfigurationLoader |
boost::shared_ptr< ErrorService > | mErrorServiceModule |
std::string | mName |
XMLDomPreprocessor | mXMLPreprocessor |
XMLDom | mConfigDom |
ProtecteeDatabase | mMetaDatabase |
Time | mStartTime |
Friends | |
class | Private::FrameworkStartup |
This class represents the core element of a modular application.
The Framework allows communication between different application parts, so called authorities, via data channels and remote procedure calls. The framework hides implementation details as well as sources, destinations of data and the way of data transmission from the developer of an authority. This allows the user to run the application on his local PC or distributed on PCs in a network without changing a single line of code.
|
inherited |
Framework | ( | int | argc, |
char ** | argv, | ||
bool | startImmediately = false |
||
) |
Framework | ( | const std::vector< std::string > & | args, |
bool | startImmediately = false |
||
) |
|
virtual |
|
inline |
Reflect method for serialization.
|
inline |
void load | ( | XMLDom & | xml | ) |
Loads the specified XML configuration and applies all registered Loaders on it.
This will load libraries, instantiate and configure units, etc. This method will do nothing if the xml document is empty.
void load | ( | const std::string & | configFile | ) |
Opens the specified XML configuration file and applies all registered Loaders on it.
This will load libraries, instantiate and configure units, etc. This method will do nothing if configFile is empty.
void load | ( | ) |
Loads configuration files given on command line if any by calling above load(const std::string& configFile) function.
void start | ( | ) |
Starts the framework and it's remote component (if one was configured or created) and returns immediately.
|
inline |
Return true if framework is started.
|
inline |
Return duration since started.
|
virtual |
Executes the framework and blocks until the framework is terminated, e.g.
by pressing Ctrl+C. Returns the exit code as specified by requestTermination().
Reimplemented in FrameworkWithGui.
|
virtual |
Requests the termination of the framework and hence the whole application.
Is called e.g. when user presses Ctrl+C. You can optionally specify an exit code that will be returned as exit code by exec(). Furthermore, this code is returned by the mira executables (mira, miragui, miracenter, etc.).
Reimplemented in FrameworkWithGui.
|
virtual |
Returns whether the termination of the framework is reqested.
int getTerminationExitCode | ( | ) | const |
Returns the exit code as specified by requestTermination(), or 0 if requestTermination() was not called.
int run | ( | ) |
Calls the above load() and start() methods according to the command line parameters that were passed in the constructor and finally calls exec().
Hence, this method will launch a fully operating framework and blocks until the framework is terminated, e.g. by pressing Ctrl+C. Returns the exit code as specified by requestTermination(), or 0 if no error or exception has occurred, otherwise -1.
|
inline |
Returns the reference to the name registry.
|
inline |
Returns the reference to the manager singleton for registered authorities.
|
inline |
Returns the reference to the manager singleton for channels.
|
inline |
Returns the pointer to the transform framework.
|
inline |
Returns the reference to the configuration file loader.
|
inline |
Returns the reference to the unit manager.
|
inline |
Returns the reference to the manager singleton for registered RPC services.
|
inline |
Returns the pointer to the persistent error service.
|
inline |
Returns the pointer to the remote module.
|
inline |
Returns the ID of this framework.
The ID can be specified via command line. If no ID is specified an UUID based one will be generated.
|
inline |
Return the fully qualified global id of this framework (includes namespace)
|
inline |
Returns the list of variables that are registered via command line or config file.
|
inline |
|
inline |
Return the meta database that contains all known meta information in this framework.
|
inline |
|
protected |
|
protected |
|
protected |
|
staticprotected |
|
staticprotected |
|
inlinestaticinherited |
Returns a reference to the singleton instance.
XSingleton | If the singleton was already destroyed (dead reference) or not yet created (when using ExplicitInstantiation). |
|
inlinestaticinherited |
Returns true, if the singleton was already destroyed.
Trying to access it will result in an exception.
|
friend |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |