BrisaUpnp::BrisaAction Class Reference

Template method class that represents each service's action. More...

#include <BrisaUpnp/BrisaAction>

List of all members.

Public Member Functions

 BrisaAction (QString name="", BrisaService *service=0, QObject *parent=0)
 BrisaAction (QString name, BrisaService *service, const QMetaMethod &method, QObject *parent)
 BrisaAction (const BrisaAction &action)
virtual ~BrisaAction ()
void setName (QString name)
QString getName () const
void setService (BrisaService *service)
BrisaServicegetService () const
BrisaStateVariablegetStateVariable (const QString &name) const
QList< BrisaArgument * > getArgumentList () const
void addArgument (QString name="", QString direction="", QString relatedStateVariable="")
void addArgument (BrisaArgument *argumentA)
void addArguments (const QList< BrisaArgument * > argumentA)
void clearArgumentList ()
void removeArgument (BrisaArgument *argumentA)
bool call (BrisaInArgument *inArguments, BrisaOutArgument *&outArguments)
void setMethod (const QMetaMethod &method, BrisaService *service)
QMetaMethod getMethod () const

Detailed Description

Template method class that represents each service's action.

Create a class derived from BrisaAction and reimplement the method run(). That method is the one which is called when this action is invoked and defines the action's behavior.

The method run() receives a QMap<QString, QString> with the input arguments. They are organized as key -- the argument name -- and value -- the argument value. It has to return a QMap<QString, QString> with the output arguments organized the same way.

If any of the returned output arguments is not defined in the service description file, BrisaAction will show an error message at the debug output stream and send an error message to the control point.

Definition at line 66 of file brisaaction.h.


Constructor & Destructor Documentation

BrisaAction::BrisaAction ( QString  name = "",
BrisaService service = 0,
QObject *  parent = 0 
)

Constructs an action with given name, parent and service that it is related to.

Definition at line 34 of file brisaaction.cpp.

BrisaAction::BrisaAction ( QString  name,
BrisaService service,
const QMetaMethod &  method,
QObject *  parent 
)

Constructs an action with given name, parent and service and a method to be invoked when the action is executed.

Definition at line 40 of file brisaaction.cpp.

BrisaAction::BrisaAction ( const BrisaAction action  ) 

Constructs a new action based on action.

Definition at line 47 of file brisaaction.cpp.

BrisaAction::~BrisaAction (  )  [virtual]

Destroys the action. It has to be overridden for properly destroying the derived actions when necessary.

Definition at line 59 of file brisaaction.cpp.


Member Function Documentation

void BrisaAction::addArgument ( BrisaArgument argumentA  ) 

Adds given argument to this action's list of arguments.

Definition at line 72 of file brisaaction.cpp.

void BrisaAction::addArgument ( QString  name = "",
QString  direction = "",
QString  relatedStateVariable = "" 
)

Adds an argument with given name, direction and relatedStateVariable to this action's list of arguments.

Definition at line 67 of file brisaaction.cpp.

void BrisaAction::addArguments ( const QList< BrisaArgument * >  argumentA  ) 

Adds given list of arguments to this action's list of arguments.

Definition at line 80 of file brisaaction.cpp.

bool BrisaAction::call ( BrisaInArgument inArguments,
BrisaOutArgument *&  outArguments 
)

Validates inArguments, outArguments and runs the action. outArguments is an output parameter. This method returns true in case of successful running of the action, else returns false.

Definition at line 124 of file brisaaction.cpp.

void BrisaAction::clearArgumentList (  ) 

Clears this action's argument list.

Definition at line 120 of file brisaaction.cpp.

QList< BrisaArgument * > BrisaAction::getArgumentList (  )  const

Returns this action's list of arguments.

Definition at line 116 of file brisaaction.cpp.

QMetaMethod BrisaAction::getMethod (  )  const

Returns the method to be invoked when the action is executed.

Definition at line 185 of file brisaaction.cpp.

QString BrisaAction::getName (  )  const

Returns the action's name.

Definition at line 90 of file brisaaction.cpp.

BrisaService * BrisaAction::getService (  )  const

Returns the service that this action is related to.

Definition at line 98 of file brisaaction.cpp.

BrisaStateVariable * BrisaAction::getStateVariable ( const QString &  name  )  const

Returns the related service's state variable with the given name. If it cannot find its related service or the state variable, then it returns a null pointer.

Definition at line 102 of file brisaaction.cpp.

void BrisaAction::removeArgument ( BrisaArgument argumentA  ) 

Remove given argument from this action's list of arguments.

Definition at line 76 of file brisaaction.cpp.

void BrisaAction::setMethod ( const QMetaMethod &  method,
BrisaService service 
)

Sets the method to be invoked when the action is executed.

Definition at line 180 of file brisaaction.cpp.

void BrisaAction::setName ( QString  name  ) 

Sets a new name to the action.

Definition at line 86 of file brisaaction.cpp.

void BrisaAction::setService ( BrisaService service  ) 

Sets a new service for this action.

Definition at line 94 of file brisaaction.cpp.


The documentation for this class was generated from the following files:
Generated on Thu Sep 30 14:04:30 2010 for Brisa by  doxygen 1.6.3