roviz  0.7
Code Documentation of roviz
Public Member Functions | List of all members
ObjectState Class Reference

The ObjectState class represents the State of a Singleton or Component and helps calling create/delete/init/deinit them. More...

#include <startup_helper_p.h>

Collaboration diagram for ObjectState:
Collaboration graph

Public Member Functions

 ObjectState (const QMetaObject &metaobj)
 Constructs a ObjectState for a Singleton. More...
 
 ObjectState (const QMetaObject &metaobj, internal::VoidFnPtr initFunc, internal::VoidFnPtr deinitFunc)
 Constructs a ObjectState for a Component. More...
 
QString className () const
 Returns the name of the class represented by the ObjectState. More...
 
QStringList dependencies () const
 Returns a list of all dependencies of the represented class. More...
 
QStringList optionalDependencies () const
 Returns a list of all optional dependencies of the represented class. More...
 
bool initialized () const
 Whether or not the represented class has already been initialized. More...
 
bool guiModule () const
 Whether or not the represented class is a gui module (= it requires a Q(Gui)Application to run) More...
 
bool init ()
 Tries to construct the represented singleton or call init() on the represented component. More...
 
bool postInit ()
 Tries to call postInit() on the represented singleton. Does nothing if the represented class is a component. More...
 
bool preDestroy ()
 Tries to call preDestroy() on the represented singleton. Does nothing if the represented class is a component. More...
 
bool destroy ()
 Tries to delete the represented singleton or call deinit() on the represented component. More...
 

Detailed Description

The ObjectState class represents the State of a Singleton or Component and helps calling create/delete/init/deinit them.

Constructor & Destructor Documentation

◆ ObjectState() [1/2]

ObjectState::ObjectState ( const QMetaObject &  metaobj)

Constructs a ObjectState for a Singleton.

Parameters
metaobjThe static metaobject of the singleton

◆ ObjectState() [2/2]

ObjectState::ObjectState ( const QMetaObject &  metaobj,
internal::VoidFnPtr  initFunc,
internal::VoidFnPtr  deinitFunc 
)

Constructs a ObjectState for a Component.

Parameters
metaobjThe static metaobject of the component
initFuncA Function Pointer to the static void init() function
deinitFuncA Function Pointer to the static void deinit() function

Member Function Documentation

◆ className()

QString ObjectState::className ( ) const

Returns the name of the class represented by the ObjectState.

Returns
Classname as QString
Here is the caller graph for this function:

◆ dependencies()

QStringList ObjectState::dependencies ( ) const

Returns a list of all dependencies of the represented class.

Returns
Names of the classes on which the represented class depends as StringList

◆ destroy()

bool ObjectState::destroy ( )

Tries to delete the represented singleton or call deinit() on the represented component.

Returns
false on error
Here is the caller graph for this function:

◆ guiModule()

bool ObjectState::guiModule ( ) const

Whether or not the represented class is a gui module (= it requires a Q(Gui)Application to run)

Returns
true if the class is a gui module

◆ init()

bool ObjectState::init ( )

Tries to construct the represented singleton or call init() on the represented component.

Returns
false on error
Here is the call graph for this function:
Here is the caller graph for this function:

◆ initialized()

bool ObjectState::initialized ( ) const

Whether or not the represented class has already been initialized.

Returns
true if the class has been initialized

◆ optionalDependencies()

QStringList ObjectState::optionalDependencies ( ) const

Returns a list of all optional dependencies of the represented class.

Returns
Names of the classes on which the represented class optionally depends in form of a StringList

◆ postInit()

bool ObjectState::postInit ( )

Tries to call postInit() on the represented singleton. Does nothing if the represented class is a component.

Returns
false on error
Here is the call graph for this function:
Here is the caller graph for this function:

◆ preDestroy()

bool ObjectState::preDestroy ( )

Tries to call preDestroy() on the represented singleton. Does nothing if the represented class is a component.

Returns
false on error
Here is the call graph for this function:
Here is the caller graph for this function:

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