Object::Operation Class Reference

#include <object.h>

List of all members.


Detailed Description

Operation is a "command" one can perform with an object.

An operation has a name and optional list of arguments the command supports.

Definition at line 225 of file object.h.


Public Member Functions

 Operation (const std::string &name, bool requiresArgs)
 This constructor should be used by modules to describe an operation to an user interface.
 Operation (const std::string &name, std::vector< Argument > args)
 This constructor should be used by UI parser to construct a command to be sent to an object.
 ~Operation ()
 Destructor.
void addArg (const Argument &arg)
 Add an argument to this operation.
Argument getArg (const std::string &name) const
 Get argument by name.
Accessors
uint32_t getArgCount () const
std::string getName () const
bool requiresArgs () const
Argument getArg (uint32_t num) const

Private Member Functions

 Operation ()

Private Attributes

std::string m_name
 Name of the operation.
bool m_requiresArgs
 If arguments are required.
std::vector< Argumentm_argList
 Argument list.

Friends

class Object
 Default constructor for internal usage only.

Classes

class  Argument
 Argument class represents one argument that can be passed to an operation. More...

Constructor & Destructor Documentation

Object::Operation::Operation const std::string &  name,
bool  requiresArgs
[inline]
 

This constructor should be used by modules to describe an operation to an user interface.

It may optionally be follwed by argument additions through addArgument() method.

Parameters:
name Name of the command
requiresArgs If arguments are required

Definition at line 237 of file object.h.

Object::Operation::Operation const std::string &  name,
std::vector< Argument args
[inline]
 

This constructor should be used by UI parser to construct a command to be sent to an object.

Parameters:
name Name of the command
args Optional argument list

Definition at line 247 of file object.h.

Object::Operation::~Operation  )  [inline]
 

Destructor.

Definition at line 251 of file object.h.

Object::Operation::Operation  )  [inline, private]
 

Definition at line 348 of file object.h.


Member Function Documentation

void Object::Operation::addArg const Argument arg  )  [inline]
 

Add an argument to this operation.

Parameters:
arg Argument to be added

Definition at line 258 of file object.h.

Referenced by FilesList::getOper().

Argument Object::Operation::getArg const std::string &  name  )  const [inline]
 

Get argument by name.

Parameters:
name Argument to retrieve
Returns:
The argument, if found
Exceptions:
std::runtime_error if argument is not found

Definition at line 278 of file object.h.

Argument Object::Operation::getArg uint32_t  num  )  const [inline]
 

Definition at line 267 of file object.h.

Referenced by FilesList::doOper().

uint32_t Object::Operation::getArgCount  )  const [inline]
 

Definition at line 264 of file object.h.

Referenced by FilesList::doOper().

std::string Object::Operation::getName  )  const [inline]
 

Definition at line 265 of file object.h.

bool Object::Operation::requiresArgs  )  const [inline]
 

Definition at line 266 of file object.h.


Friends And Related Function Documentation

friend class Object [friend]
 

Default constructor for internal usage only.

Definition at line 347 of file object.h.


Member Data Documentation

std::vector<Argument> Object::Operation::m_argList [private]
 

Argument list.

Definition at line 351 of file object.h.

std::string Object::Operation::m_name [private]
 

Name of the operation.

Definition at line 349 of file object.h.

bool Object::Operation::m_requiresArgs [private]
 

If arguments are required.

Definition at line 350 of file object.h.


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