SingleCommand< T, U, V, W > Class Template Reference

This class represents a command which can occur only once in a given commandline and can have 1-4 arguments of types T, U, V and U. More...

#include <singlecommand.h>

Inheritance diagram for SingleCommand< T, U, V, W >:
Command

List of all members.

Public Member Functions

 SingleCommand (T *ptr1, const std::string &name, const std::string &shortName="", const std::string &infoText="", const std::string parameterList="")
 SingleCommand (T *ptr1, U *ptr2, const std::string &name, const std::string &shortName="", const std::string &infoText="", const std::string parameterList="")
 SingleCommand (T *ptr1, U *ptr2, V *ptr3, const std::string &name, const std::string &shortName="", const std::string &infoText="", const std::string parameterList="")
 SingleCommand (T *ptr1, U *ptr2, V *ptr3, W *ptr4, const std::string &name, const std::string &shortName="", const std::string &infoText="", const std::string parameterList="")
bool execute (const std::vector< std::string > &parameters)
 Executes this command with the given parameters.
bool checkParameters (const std::vector< std::string > &parameters)
 Checks the parameters for consistency and number.

Protected Attributes

T * ptr1_
U * ptr2_
V * ptr3_
W * ptr4_

Detailed Description

template<class T, class U = T, class V = U, class W = V>
class voreen::SingleCommand< T, U, V, W >

This class represents a command which can occur only once in a given commandline and can have 1-4 arguments of types T, U, V and U.

This class simply tries to convert the parameters to the appropriate values and stores them in it The template must be usable within a stringstream (necessary for conversion)

See also:
SingleCommandZeroArguments

Definition at line 43 of file singlecommand.h.


Member Function Documentation

bool checkParameters ( const std::vector< std::string > &  parameters  )  [inline, virtual]

Checks the parameters for consistency and number.

This version only tests for the number of parameters. If you want to test for other conditions, overwrite this method in a derived class

Parameters:
parameters The parameters which should be tested
Returns:
true, if the parameters are correct

Reimplemented from Command.

Definition at line 98 of file singlecommand.h.

bool execute ( const std::vector< std::string > &  parameters  )  [inline, virtual]

Executes this command with the given parameters.

Parameters:
parameters The parameters needed for the execution of this command.
Returns:
true, if the execution was successful, false otherwise

Implements Command.

Definition at line 86 of file singlecommand.h.