Public Slots | Signals | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
ARCSApplicationComponent Class Reference

This class represents an application. More...

#include <arcsapplicationcomponent.h>

Inheritance diagram for ARCSApplicationComponent:
Inheritance graph
Collaboration diagram for ARCSApplicationComponent:
Collaboration graph

Public Slots

void finish ()
 

Signals

void finished ()
 

Public Member Functions

 ARCSApplicationComponent (ARCS::ARCSAppFlag flag=ARCS::ARCS_APP_EVENT)
 
bool startApplication ()
 
bool stopApplication ()
 
ARCS::ARCSAppFlag getCurrentMode ()
 
void setCurrentMode (ARCS::ARCSAppFlag flag)
 
ARCSContextgetContext ()
 
void addProcess (ARCSProcess *ap)
 
void removeProcess (int i)
 Removes a process in the list of processes managed by the application. More...
 
int getProcessCount ()
 
void removeComponent (QString name)
 
void swapProcesses (int i, int j)
 
ARCSProcessgetProcess (int idx)
 
virtual QStringList getSlots ()
 Returns the names of the available slots.
 
virtual QStringList getSignals ()
 Returns the names of the availables signals.
 
virtual QString toString ()
 Defines a basic seralization mechanism. More...
 
virtual bool parseString (QString s)
 Defines a basic seralization mechanism. More...
 
virtual bool loadFile (QString fn)
 Defines a way to load a component description from a file. More...
 
bool hasFinished ()
 
void wait ()
 
void changeConstant (QString name, QString representation)
 This hack allows to change the value of a constant in the constant pool. More...
 
virtual QVariant getGenuineComponentInstance ()
 
void * getInterface ()
 
- Public Member Functions inherited from ARCSAbstractComponent
bool instanciate ()
 Instanciates the real component.
 
bool isInstanciated ()
 Determines wether the component is instanciated or not.
 
void destroy ()
 Destroys the real component.
 
ARCSAbstractComponentclone ()
 Kage bunshin no jutsu ! More...
 
virtual bool connect (QString sig, ARCSAbstractComponent *dst, QString slt, bool queued=false)
 This method connects two components by the indicated signals and slots. More...
 
bool disconnect (QString sig, ARCSAbstractComponent *dst, QString slt)
 This method disconnects two components by the indicated signals and slots. More...
 
bool init (QString slt, QVariant *var)
 Initializes a component. More...
 
virtual bool saveFile (QString fn)
 Defines a way to save a component description inside a file. More...
 
void setProperty (QString name, QVariant value)
 Sets a meta-property on this component. More...
 
QVariant getProperty (QString name)
 Gets a meta-property from this component. More...
 
void removeProperty (QString name)
 Removes a meta-property from this component. More...
 
void resetProperties ()
 Sets the property list to a blank list.
 
QStringList getProperties ()
 
void setFamily (QString s)
 
QString getFamily ()
 
void setType (QString s)
 
QString getType ()
 

Static Public Member Functions

static ARCSApplicationComponentgetRunningInstance ()
 
template<typename T >
static void setInterface (T *iface)
 

Protected Member Functions

virtual void getProxySlot (QString slot, ObjectList &obj, QStringList &proxySlot)
 Creates a proxy slot to interface a component to native ARCS components. More...
 
virtual void getProxySignal (QString signal, ObjectList &obj, QStringList &proxySignal)
 Creates a proxy signal to interface a component to native ARCS components. More...
 
virtual bool genuineInstanciate ()
 This method should implement the instanciation of the actual component. More...
 
virtual void genuineDestroy ()
 This method should implement the destruction of the actual component. More...
 
- Protected Member Functions inherited from ARCSAbstractComponent
virtual bool genuineConnect (QString, ARCSAbstractComponent *, QString, bool=false)
 This method connects two components by the indicated signals and slots. More...
 
virtual bool genuineDisconnect (QString, ARCSAbstractComponent *, QString)
 This method disconnects two components by the indicated signals and slots. More...
 

Additional Inherited Members

- Static Protected Member Functions inherited from ARCSAbstractComponent
static void getProxySlot (ARCSAbstractComponent *cmp, QString slot, ObjectList &obj, QStringList &proxySlot)
 Wrapper for getProxySlot()
 
static void getProxySignal (ARCSAbstractComponent *cmp, QString signal, ObjectList &obj, QStringList &proxySignal)
 Wrapper for getProxySignal()
 
- Static Protected Attributes inherited from ARCSAbstractComponent
static const QString slotPrefix = "1"
 
static const QString signalPrefix = "2"
 

Detailed Description

This class represents an application.

Author
Jean-Yves Didier
Date
January, the 9th, 2009

Definition at line 45 of file arcsapplicationcomponent.h.

Constructor & Destructor Documentation

ARCSApplicationComponent::ARCSApplicationComponent ( ARCS::ARCSAppFlag  flag = ARCS::ARCS_APP_EVENT)

Constructor

Todo:
check if there is no regretion after this. Potential instructions to compensate this may appear somewhere.

Definition at line 42 of file arcsapplicationcomponent.cpp.

Here is the call graph for this function:

Member Function Documentation

void ARCSApplicationComponent::addProcess ( ARCSProcess ap)
inline

Adds a process in the list of processes managed by the application

Definition at line 68 of file arcsapplicationcomponent.h.

Here is the caller graph for this function:

void ARCSApplicationComponent::changeConstant ( QString  name,
QString  representation 
)
inline

This hack allows to change the value of a constant in the constant pool.

Parameters
namename of the constant
representationstring representation of the value of the constant.

Definition at line 104 of file arcsapplicationcomponent.h.

void ARCSApplicationComponent::finish ( )
slot

Slot to trigger to finish the application (not implemented yet)

Definition at line 128 of file arcsapplicationcomponent.cpp.

void ARCSApplicationComponent::finished ( )
signal

Signal triggered when the application is finished.

virtual void ARCSApplicationComponent::genuineDestroy ( )
inlineprotectedvirtual

This method should implement the destruction of the actual component.

Should be overloaded by each subclasses.

Implements ARCSAbstractComponent.

Definition at line 142 of file arcsapplicationcomponent.h.

virtual bool ARCSApplicationComponent::genuineInstanciate ( )
inlineprotectedvirtual

This method should implement the instanciation of the actual component.

Should be overloaded by each subclasses.

Implements ARCSAbstractComponent.

Definition at line 141 of file arcsapplicationcomponent.h.

ARCSContext* ARCSApplicationComponent::getContext ( )
inline

Returns a context (i.e. a component and a constant pool) for the application

Definition at line 65 of file arcsapplicationcomponent.h.

Here is the caller graph for this function:

ARCS::ARCSAppFlag ARCSApplicationComponent::getCurrentMode ( )
inline

Returns the mode in which the application is running.

Definition at line 60 of file arcsapplicationcomponent.h.

Here is the caller graph for this function:

QVariant ARCSApplicationComponent::getGenuineComponentInstance ( )
virtual

Allows to get the genuine component instance.

This method purpose is to help in invocating nested objects.

Reimplemented from ARCSAbstractComponent.

Definition at line 59 of file arcsapplicationcomponent.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

ARCSProcess* ARCSApplicationComponent::getProcess ( int  idx)
inline

Gives a particular process of the application

Parameters
idxindex of the process
Returns
a process structure

Definition at line 87 of file arcsapplicationcomponent.h.

Here is the caller graph for this function:

int ARCSApplicationComponent::getProcessCount ( )
inline

Gives the number of processes stored in the application

Definition at line 75 of file arcsapplicationcomponent.h.

Here is the caller graph for this function:

virtual void ARCSApplicationComponent::getProxySignal ( QString  signal,
ObjectList &  obj,
QStringList &  proxySignal 
)
inlineprotectedvirtual

Creates a proxy signal to interface a component to native ARCS components.

This function should be overriden by subclasses. It is used in the case the abstracted component is not from the same family as another component to connect to. In this case, the abstracted component should offer a wrapper using a QObject to communicate with other components as if it was a native component of the ARCS runtime.

Parameters
sigthe signal name of the current component
obja list of QObject wrappers returned by this method
proxySignalthe list of the real slot names associated to the QObjects returned by this method.

Implements ARCSAbstractComponent.

Definition at line 136 of file arcsapplicationcomponent.h.

virtual void ARCSApplicationComponent::getProxySlot ( QString  slot,
ObjectList &  obj,
QStringList &  proxySlot 
)
inlineprotectedvirtual

Creates a proxy slot to interface a component to native ARCS components.

This function should be overriden by subclasses. It is used in the case the abstracted component is not from the same family as another component to connect to. In this case, the abstracted component should offer a wrapper using a QObject to communicate with other components as if it was a native component of the ARCS runtime.

Parameters
slotthe slot name of the current component
obja list of QObject wrappers returned by this method
proxySlotthe list of the real slot names associated to the QObjects returned by this method.

Implements ARCSAbstractComponent.

Definition at line 132 of file arcsapplicationcomponent.h.

bool ARCSApplicationComponent::hasFinished ( )
inline

Tells wether the application has finished or not (not well implemented)

Definition at line 96 of file arcsapplicationcomponent.h.

bool ARCSApplicationComponent::loadFile ( QString  fn)
virtual

Defines a way to load a component description from a file.

This method has a default implementation. Optimizations might require to rewrite it.

Parameters
fna filename where component description is stored
Returns
true if loading and parsing was a success, false otherwise.

Reimplemented from ARCSAbstractComponent.

Definition at line 160 of file arcsapplicationcomponent.cpp.

Here is the call graph for this function:

bool ARCSApplicationComponent::parseString ( QString  s)
virtual

Defines a basic seralization mechanism.

This should parse a string and affect the internal representation of the component.

Returns
true if parsing was a success, false otherwise.

Implements ARCSAbstractComponent.

Definition at line 168 of file arcsapplicationcomponent.cpp.

Here is the call graph for this function:

void ARCSApplicationComponent::removeProcess ( int  i)
inline

Removes a process in the list of processes managed by the application.

Parameters
ithe index of the process to remove

Definition at line 72 of file arcsapplicationcomponent.h.

void ARCSApplicationComponent::setCurrentMode ( ARCS::ARCSAppFlag  flag)
inline

Sets the mode which the application is running

Definition at line 62 of file arcsapplicationcomponent.h.

Here is the caller graph for this function:

bool ARCSApplicationComponent::startApplication ( )

Starts the application

Definition at line 93 of file arcsapplicationcomponent.cpp.

Here is the call graph for this function:

bool ARCSApplicationComponent::stopApplication ( )

Stops the application (currently not implemented)

Definition at line 134 of file arcsapplicationcomponent.cpp.

virtual QString ARCSApplicationComponent::toString ( )
inlinevirtual

Defines a basic seralization mechanism.

This should return a string representation of the component.

Implements ARCSAbstractComponent.

Definition at line 91 of file arcsapplicationcomponent.h.

void ARCSApplicationComponent::wait ( )

Waits for the end of the application (useful when used as a threaded application).

<

Todo:
reimplement wait.

Definition at line 179 of file arcsapplicationcomponent.cpp.


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