MIRA
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
FrameworkWithGui Class Reference

#include <fw/FrameworkWithGui.h>

Inheritance diagram for FrameworkWithGui:
Inheritance graph
[legend]

Classes

class  Application
 Implements our own Application derived from QApplication in order to overwrite the notify method. More...
 

Public Types

typedef ProtecteeMixin< MetaTypeDatabaseProtecteeDatabase
 
typedef Base::Type Type
 

Public Member Functions

 FrameworkWithGui (int &argc, char **argv, bool startImmediately=false)
 Constructor that creates own FrameworkWithGui::Application. More...
 
 FrameworkWithGui (int &argc, char **argv, QApplication *app, bool startImmediately=false)
 Constructor that takes previously created QApplication. More...
 
 ~FrameworkWithGui ()
 
virtual int exec ()
 Executes the framework and executes the underlying QApplication until the application is terminated, e.g. More...
 
virtual void requestTermination (int exitcode=0)
 Requests the termination of the framework and hence the whole application. More...
 
template<typename Reflector >
void reflect (Reflector &r)
 Reflect method for serialization. More...
 
boost::shared_ptr< PropertyNodegetProperties ()
 
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 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...
 
XMLVariablesMapgetVariables ()
 Returns the list of variables that are registered via command line or config file. More...
 
XMLDomPreprocessorgetXMLDomPreprocessor ()
 
ScopedAccess< ProtecteeDatabasegetMetaDatabase ()
 Return the meta database that contains all known meta information in this framework. More...
 
bool isInExec () const
 
Obtain access to framework components
NameRegistrygetNameRegistry ()
 Returns the reference to the name registry. More...
 
AuthorityManagergetAuthorityManager ()
 Returns the reference to the manager singleton for registered authorities. More...
 
ChannelManagergetChannelManager ()
 Returns the reference to the manager singleton for channels. More...
 
boost::shared_ptr< FrameworkTransformergetTransformer ()
 Returns the pointer to the transform framework. More...
 
ConfigurationLoadergetConfigurationLoader ()
 Returns the reference to the configuration file loader. More...
 
boost::shared_ptr< UnitManagergetUnitManager ()
 Returns the reference to the unit manager. More...
 
RPCManagergetRPCManager ()
 Returns the reference to the manager singleton for registered RPC services. More...
 
boost::shared_ptr< ErrorServicegetErrorService ()
 Returns the pointer to the persistent error service. More...
 
boost::shared_ptr< RemoteModulegetRemoteModule ()
 Returns the pointer to the remote module. More...
 

Static Public Member Functions

static Typeinstance ()
 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< PropertyNodemProperties
 
NameRegistry mNames
 
boost::shared_ptr< RemoteModulemRemoteModule
 
RPCManager mRPCManager
 
ChannelManager mChannelManager
 
AuthorityManager mAuthorityManager
 
boost::shared_ptr< FrameworkTransformermTransformer
 
boost::shared_ptr< UnitManagermUnitManager
 
ConfigurationLoader mConfigurationLoader
 
boost::shared_ptr< ErrorServicemErrorServiceModule
 
std::string mName
 
XMLDomPreprocessor mXMLPreprocessor
 
XMLDom mConfigDom
 
ProtecteeDatabase mMetaDatabase
 
Time mStartTime
 

Member Typedef Documentation

◆ ProtecteeDatabase

◆ Type

typedef Base::Type Type
inherited

Constructor & Destructor Documentation

◆ FrameworkWithGui() [1/2]

FrameworkWithGui ( int &  argc,
char **  argv,
bool  startImmediately = false 
)
inline

Constructor that creates own FrameworkWithGui::Application.

◆ FrameworkWithGui() [2/2]

FrameworkWithGui ( int &  argc,
char **  argv,
QApplication *  app,
bool  startImmediately = false 
)
inline

Constructor that takes previously created QApplication.

The caller is responsible for destroying the application at the end.

◆ ~FrameworkWithGui()

~FrameworkWithGui ( )
inline

Member Function Documentation

◆ exec()

virtual int exec ( )
inlinevirtual

Executes the framework and executes the underlying QApplication until the application is terminated, e.g.

by closing it or by pressing Ctrl+C.

Reimplemented from Framework.

◆ requestTermination()

virtual void requestTermination ( int  exitcode = 0)
inlinevirtual

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 from Framework.

◆ reflect()

void reflect ( Reflector &  r)
inlineinherited

Reflect method for serialization.

◆ getProperties()

boost::shared_ptr<PropertyNode> getProperties ( )
inlineinherited

◆ load() [1/3]

void load ( XMLDom xml)
inherited

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.

◆ load() [2/3]

void load ( const std::string &  configFile)
inherited

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.

◆ load() [3/3]

void load ( )
inherited

Loads configuration files given on command line if any by calling above load(const std::string& configFile) function.

◆ start()

void start ( )
inherited

Starts the framework and it's remote component (if one was configured or created) and returns immediately.

◆ isStarted()

bool isStarted ( ) const
inlineinherited

Return true if framework is started.

◆ getUptime()

Duration getUptime ( ) const
inlineinherited

Return duration since started.

◆ isTerminationRequested()

virtual bool isTerminationRequested ( ) const
virtualinherited

Returns whether the termination of the framework is reqested.

◆ getTerminationExitCode()

int getTerminationExitCode ( ) const
inherited

Returns the exit code as specified by requestTermination(), or 0 if requestTermination() was not called.

See also
isTerminationRequested().

◆ run()

int run ( )
inherited

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.

◆ getNameRegistry()

NameRegistry& getNameRegistry ( )
inlineinherited

Returns the reference to the name registry.

◆ getAuthorityManager()

AuthorityManager& getAuthorityManager ( )
inlineinherited

Returns the reference to the manager singleton for registered authorities.

◆ getChannelManager()

ChannelManager& getChannelManager ( )
inlineinherited

Returns the reference to the manager singleton for channels.

◆ getTransformer()

boost::shared_ptr<FrameworkTransformer> getTransformer ( )
inlineinherited

Returns the pointer to the transform framework.

◆ getConfigurationLoader()

ConfigurationLoader& getConfigurationLoader ( )
inlineinherited

Returns the reference to the configuration file loader.

◆ getUnitManager()

boost::shared_ptr<UnitManager> getUnitManager ( )
inlineinherited

Returns the reference to the unit manager.

◆ getRPCManager()

RPCManager& getRPCManager ( )
inlineinherited

Returns the reference to the manager singleton for registered RPC services.

◆ getErrorService()

boost::shared_ptr<ErrorService> getErrorService ( )
inlineinherited

Returns the pointer to the persistent error service.

◆ getRemoteModule()

boost::shared_ptr<RemoteModule> getRemoteModule ( )
inlineinherited

Returns the pointer to the remote module.

◆ getID()

std::string getID ( ) const
inlineinherited

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.

◆ getGlobalID()

std::string getGlobalID ( ) const
inlineinherited

Return the fully qualified global id of this framework (includes namespace)

Returns
Global ID

◆ getVariables()

XMLVariablesMap& getVariables ( )
inlineinherited

Returns the list of variables that are registered via command line or config file.

◆ getXMLDomPreprocessor()

XMLDomPreprocessor& getXMLDomPreprocessor ( )
inlineinherited

◆ getMetaDatabase()

ScopedAccess<ProtecteeDatabase> getMetaDatabase ( )
inlineinherited

Return the meta database that contains all known meta information in this framework.

◆ isInExec()

bool isInExec ( ) const
inlineinherited

◆ initialize()

void initialize ( )
protectedinherited

◆ finalize()

void finalize ( )
protectedinherited

◆ ctrlCHandler()

void ctrlCHandler ( const IntSignal sig)
protectedinherited

◆ errorHandler()

static void errorHandler ( const IntSignal sig)
staticprotectedinherited

◆ enterLeaveErrorHandler()

static bool enterLeaveErrorHandler ( bool  enter)
staticprotectedinherited

◆ instance()

static Type& instance ( )
inlinestaticinherited

Returns a reference to the singleton instance.

Exceptions
XSingletonIf the singleton was already destroyed (dead reference) or not yet created (when using ExplicitInstantiation).

◆ isDestroyed()

static bool isDestroyed ( )
inlinestaticinherited

Returns true, if the singleton was already destroyed.

Trying to access it will result in an exception.

Member Data Documentation

◆ mTerminationRequested

bool mTerminationRequested
protectedinherited

◆ mTerminationExitCode

int mTerminationExitCode
protectedinherited

◆ mIsStarted

bool mIsStarted
protectedinherited

◆ mInExec

bool mInExec
protectedinherited

◆ mRemoteDisabled

bool mRemoteDisabled
protectedinherited

◆ mAuthority

boost::shared_ptr<Private::FrameworkAuthority> mAuthority
protectedinherited

◆ mPropertiesRoot

RootPropertyNode mPropertiesRoot
protectedinherited

◆ mProperties

boost::shared_ptr<PropertyNode> mProperties
protectedinherited

◆ mNames

NameRegistry mNames
protectedinherited

◆ mRemoteModule

boost::shared_ptr<RemoteModule> mRemoteModule
protectedinherited

◆ mRPCManager

RPCManager mRPCManager
protectedinherited

◆ mChannelManager

ChannelManager mChannelManager
protectedinherited

◆ mAuthorityManager

AuthorityManager mAuthorityManager
protectedinherited

◆ mTransformer

boost::shared_ptr<FrameworkTransformer> mTransformer
protectedinherited

◆ mUnitManager

boost::shared_ptr<UnitManager> mUnitManager
protectedinherited

◆ mConfigurationLoader

ConfigurationLoader mConfigurationLoader
protectedinherited

◆ mErrorServiceModule

boost::shared_ptr<ErrorService> mErrorServiceModule
protectedinherited

◆ mName

std::string mName
protectedinherited

◆ mXMLPreprocessor

XMLDomPreprocessor mXMLPreprocessor
protectedinherited

◆ mConfigDom

XMLDom mConfigDom
protectedinherited

◆ mMetaDatabase

ProtecteeDatabase mMetaDatabase
protectedinherited

◆ mStartTime

Time mStartTime
protectedinherited

The documentation for this class was generated from the following file: