DGtal 1.3.0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Attributes
DGtal::Parameters Struct Reference

#include <DGtal/helpers/Parameters.h>

Public Types

typedef Parameters Self
 The type of *this. More...
 

Public Member Functions

 Parameters ()=default
 Default constructor. More...
 
 ~Parameters ()=default
 Default destructor. More...
 
 Parameters (const Self &other)=default
 Default copy constructor. More...
 
 Parameters (Self &&other)=default
 Default move. More...
 
Selfoperator= (const Self &other)=default
 Default assignment operator. More...
 
 Parameters (std::string name, ParameterValue pv=ParameterValue())
 
Selfoperator() (std::string name, ParameterValue pv=ParameterValue())
 
Selfoperator() (const Self &params)
 
ParameterValue operator[] (std::string name) const
 
bool count (std::string name) const
 
Self operator| (const Self &other) const
 
void selfDisplay (std::ostream &out) const
 
bool isValid () const
 

Protected Attributes

std::map< std::string, ParameterValuemyParameters
 

Detailed Description

This class represents a set of (input) simple parameters, i.e. mapping names to values.

Definition at line 146 of file Parameters.h.

Member Typedef Documentation

◆ Self

The type of *this.

Definition at line 148 of file Parameters.h.

Constructor & Destructor Documentation

◆ Parameters() [1/4]

DGtal::Parameters::Parameters ( )
default

Default constructor.

◆ ~Parameters()

DGtal::Parameters::~Parameters ( )
default

Default destructor.

◆ Parameters() [2/4]

DGtal::Parameters::Parameters ( const Self other)
default

Default copy constructor.

◆ Parameters() [3/4]

DGtal::Parameters::Parameters ( Self &&  other)
default

Default move.

◆ Parameters() [4/4]

DGtal::Parameters::Parameters ( std::string  name,
ParameterValue  pv = ParameterValue() 
)

Constructor. Add parameter (name) or (name,pv)

Parameters
[in]namethe name of the parameter.
[in]pvthe value of the parameter (string,int,float,double).

Member Function Documentation

◆ count()

bool DGtal::Parameters::count ( std::string  name) const
Parameters
[in]nameany parameter name
Returns
'true' if and only if the parameter has been set or assigned.

◆ isValid()

bool DGtal::Parameters::isValid ( ) const

Checks the validity/consistency of the object.

Returns
'true' if the object is valid, 'false' otherwise.

◆ operator()() [1/2]

Self & DGtal::Parameters::operator() ( const Self params)

Add parameters params to this object.

Parameters
[in]paramsa set of parameters

◆ operator()() [2/2]

Self & DGtal::Parameters::operator() ( std::string  name,
ParameterValue  pv = ParameterValue() 
)

Add parameter (name) or (name,pv).

Parameters
[in]namethe name of the parameter.
[in]pvthe value of the parameter (string,int,float,double).

◆ operator=()

Self & DGtal::Parameters::operator= ( const Self other)
default

Default assignment operator.

◆ operator[]()

ParameterValue DGtal::Parameters::operator[] ( std::string  name) const
Parameters
[in]nameany parameter name
Returns
the associated value (if it does not exist, return "UNSET PARAMETER").

◆ operator|()

Self DGtal::Parameters::operator| ( const Self other) const

Merge the two parameter sets and returns a new one.

Parameters
[in]othera set of parameters

◆ selfDisplay()

void DGtal::Parameters::selfDisplay ( std::ostream &  out) const

Writes/Displays the object on an output stream.

Parameters
outthe output stream where the object is written.

Field Documentation

◆ myParameters

std::map< std::string, ParameterValue > DGtal::Parameters::myParameters
protected

Definition at line 198 of file Parameters.h.


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