Public Member Functions | Protected Member Functions | List of all members
ARCSCompositeComponent Class Reference

Class defining a composite component i.e. a component made of components. More...

#include <arcscompositecomponent.h>

Inheritance diagram for ARCSCompositeComponent:
Inheritance graph
Collaboration diagram for ARCSCompositeComponent:
Collaboration graph

Public Member Functions

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...
 
virtual bool saveFile (QString fn)
 Defines a way to save a component description inside a file. More...
 
void setSheet (ARCSSheet ref)
 Sets the sheet to use as an internal description of embedded components.
 
ARCSSheetgetSheet ()
 Returns the internal structure of this composite component described as a sheet.
 
ARCSContext getContext ()
 Returns the internal context of the composite component.
 
bool addProxySignal (QString proxy, QString id, QString signal)
 Adds a wrapper to an internal component and its signal. More...
 
bool addProxySlot (QString proxy, QString id, QString slot)
 Adds a wrapper to an internal component and its slot. More...
 
void getProxySlots (QStringList &proxies, QStringList &objects, QStringList &slotNames)
 
void getProxySignals (QStringList &proxies, QStringList &objects, QStringList &signalNames)
 
- 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...
 
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 ()
 
virtual QVariant getGenuineComponentInstance ()
 

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

Class defining a composite component i.e. a component made of components.

This kind of component stores its own context as well as a sheet structure and a basic interface description. One can consider the design pattern composite as a model of this implementation.

Author
Jean-Yves Didier
Date
December, the 12th, 2008

Definition at line 44 of file arcscompositecomponent.h.

Member Function Documentation

bool ARCSCompositeComponent::addProxySignal ( QString  proxy,
QString  id,
QString  signal 
)
inline

Adds a wrapper to an internal component and its signal.

Parameters
proxyname of the external interface entry
idinternal component's id
signalinternal component's signal

Definition at line 79 of file arcscompositecomponent.h.

Here is the caller graph for this function:

bool ARCSCompositeComponent::addProxySlot ( QString  proxy,
QString  id,
QString  slot 
)
inline

Adds a wrapper to an internal component and its slot.

Parameters
proxyname of the external interface entry
idinternal component's id
signalinternal component's slot

Definition at line 89 of file arcscompositecomponent.h.

Here is the caller graph for this function:

void ARCSCompositeComponent::genuineDestroy ( )
protectedvirtual

This method should implement the destruction of the actual component.

Should be overloaded by each subclasses.

Implements ARCSAbstractComponent.

Definition at line 56 of file arcscompositecomponent.cpp.

Here is the call graph for this function:

bool ARCSCompositeComponent::genuineInstanciate ( )
protectedvirtual

This method should implement the instanciation of the actual component.

Should be overloaded by each subclasses.

Implements ARCSAbstractComponent.

Definition at line 47 of file arcscompositecomponent.cpp.

Here is the call graph for this function:

void ARCSCompositeComponent::getProxySignal ( QString  signal,
ObjectList &  obj,
QStringList &  proxySignal 
)
protectedvirtual

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 133 of file arcscompositecomponent.cpp.

Here is the call graph for this function:

void ARCSCompositeComponent::getProxySignals ( QStringList &  proxies,
QStringList &  objects,
QStringList &  signalNames 
)
inline

Returns lists of proxy signals

Definition at line 102 of file arcscompositecomponent.h.

Here is the caller graph for this function:

void ARCSCompositeComponent::getProxySlot ( QString  slot,
ObjectList &  obj,
QStringList &  proxySlot 
)
protectedvirtual

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 116 of file arcscompositecomponent.cpp.

Here is the call graph for this function:

void ARCSCompositeComponent::getProxySlots ( QStringList &  proxies,
QStringList &  objects,
QStringList &  slotNames 
)
inline

Returns lists of proxy slots

Definition at line 96 of file arcscompositecomponent.h.

Here is the caller graph for this function:

bool ARCSCompositeComponent::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 102 of file arcscompositecomponent.cpp.

Here is the call graph for this function:

bool ARCSCompositeComponent::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 95 of file arcscompositecomponent.cpp.

Here is the call graph for this function:

bool ARCSCompositeComponent::saveFile ( QString  fn)
virtual

Defines a way to save a component description inside a file.

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

Parameters
fna filename where component description will be stored.
Returns
true if saving a success, false otherwise.

Reimplemented from ARCSAbstractComponent.

Definition at line 109 of file arcscompositecomponent.cpp.

Here is the call graph for this function:

QString ARCSCompositeComponent::toString ( )
virtual

Defines a basic seralization mechanism.

This should return a string representation of the component.

Implements ARCSAbstractComponent.

Definition at line 76 of file arcscompositecomponent.cpp.

Here is the caller graph for this function:


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