Command  0.3
Public Member Functions | Protected Attributes | List of all members
command::Grouped Class Reference

#include <grouped.h>

Inheritance diagram for command::Grouped:
[legend]
Collaboration diagram for command::Grouped:
[legend]

Public Member Functions

 Grouped (std::initializer_list< Parameter * > params, std::string description="Grouped")
 
virtual ~Grouped ()
 
virtual void handle ()
 
virtual bool understand (const std::string &value)
 
virtual bool hungryForValue ()
 
virtual unsigned int valuePosition (const std::string &)
 
void releaseMemory ()
 
- Public Member Functions inherited from command::Parameter
 Parameter (const std::string &description)
 
virtual void handle ()=0
 
virtual bool understand (const std::string &)=0
 
virtual bool isRequired ()
 
virtual bool isUsed ()
 
virtual bool hungryForValue ()
 
virtual unsigned int valuePosition (const std::string &)=0
 
- Public Member Functions inherited from command::Descriptive
 Descriptive (const std::string &description)
 
const std::string & describe ()
 

Protected Attributes

std::vector< Parameter * > parameters
 
std::vector< std::string > values
 
std::vector< bool > understood
 
std::vector< bool > all_used
 
- Protected Attributes inherited from command::Parameter
bool used = false
 

Additional Inherited Members

- Public Types inherited from command::Parameter
typedef class Parameter Type
 

Detailed Description

Grouped Parameters decorator. Allows Parameters to understand be grouped together.

Example usage:

Constructor & Destructor Documentation

◆ Grouped()

command::Grouped::Grouped ( std::initializer_list< Parameter * >  params,
std::string  description = "Grouped" 
)
inline

Default constructor.

Parameters
paramsParameters which will be treated as grouped together

◆ ~Grouped()

virtual command::Grouped::~Grouped ( )
inlinevirtual

Default destructor. Releases allocated memory

Member Function Documentation

◆ handle()

virtual void command::Grouped::handle ( )
inlinevirtual

Wrapper method around passed Parameter::handle().

Method used for handling method calls linked with this Parameter

Implements command::Parameter.

◆ hungryForValue()

virtual bool command::Grouped::hungryForValue ( )
inlinevirtual

Indicates if current Parameter has been already used

Returns
true if current Parameter has been already used. False otherwise.

Reimplemented from command::Parameter.

◆ releaseMemory()

void command::Grouped::releaseMemory ( )
inline

Releases acquired memory

◆ understand()

virtual bool command::Grouped::understand ( const std::string &  value)
inlinevirtual

Wrapper method around passed Parameter::understand()

Parameters
argvcommand line value against which test will be made

Method used for checking if the given user value understandable for parameter.

Returns
true if passed value is understandable by current Parameter. False otherwise.

Implements command::Parameter.

◆ valuePosition()

virtual unsigned int command::Grouped::valuePosition ( const std::string &  )
inlinevirtual

Wrapper method around passed Parameter::valuePosition().

Returns
position where value starts in passed string

Implements command::Parameter.

Member Data Documentation

◆ parameters

std::vector<Parameter *> command::Grouped::parameters
protected

Parameters which will be treated as grouped together


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