te::rp::AlgorithmParametersSerializer Class Reference

A class to standardize algorithm parameters serialization. More...

#include <AlgorithmParametersSerializer.h>

Public Member Functions

bool addMultivaluedParameter (const std::string &name, const std::vector< std::string > &values)
 Add a new multivalued parameter. More...
 
template<typename ValueType >
bool addMultivaluedParameter (const std::string &name, const std::vector< ValueType > &values)
 Add a new multivalued parameter. More...
 
template<typename ValueType >
bool addMultivaluedParameters (const std::string &name, const std::vector< std::vector< ValueType > > &values)
 Add sets of new multivalued parameters. More...
 
bool addParameter (const std::string &name, const std::string &value)
 Add a new parameter. More...
 
template<typename ValueType >
bool addParameter (const std::string &name, const ValueType &value)
 Add a new parameter. More...
 
 AlgorithmParametersSerializer ()
 
 AlgorithmParametersSerializer (const AlgorithmParametersSerializer &other)
 
void getMetaData (std::map< std::string, std::string > &metadata) const
 Returns all serialized parameters formatted for raster metadata. More...
 
AlgorithmParametersSerializeroperator= (const AlgorithmParametersSerializer &other)
 
void reset ()
 Reset to the initial empty state. More...
 
void setAlgorithmName (const std::string &name)
 Set a non-empty algorithm name. More...
 
 ~AlgorithmParametersSerializer ()
 

Protected Types

typedef std::pair< std::string, std::vector< std::string > > ParsContPairT
 
typedef std::multimap< std::string, std::vector< std::string > > ParsContT
 

Protected Member Functions

template<typename ValueType >
std::string toString (const std::complex< ValueType > &value) const
 
template<typename ValueType >
std::string toString (const ValueType &value) const
 

Private Attributes

std::string m_algoName
 
ParsContT m_params
 

Detailed Description

A class to standardize algorithm parameters serialization.

Definition at line 38 of file AlgorithmParametersSerializer.h.

Member Typedef Documentation

◆ ParsContPairT

typedef std::pair< std::string, std::vector< std::string > > te::rp::AlgorithmParametersSerializer::ParsContPairT
protected

Definition at line 157 of file AlgorithmParametersSerializer.h.

◆ ParsContT

typedef std::multimap<std::string, std::vector< std::string > > te::rp::AlgorithmParametersSerializer::ParsContT
protected

Definition at line 159 of file AlgorithmParametersSerializer.h.

Constructor & Destructor Documentation

◆ AlgorithmParametersSerializer() [1/2]

te::rp::AlgorithmParametersSerializer::AlgorithmParametersSerializer ( )

◆ AlgorithmParametersSerializer() [2/2]

te::rp::AlgorithmParametersSerializer::AlgorithmParametersSerializer ( const AlgorithmParametersSerializer other)

◆ ~AlgorithmParametersSerializer()

te::rp::AlgorithmParametersSerializer::~AlgorithmParametersSerializer ( )

Member Function Documentation

◆ addMultivaluedParameter() [1/2]

bool te::rp::AlgorithmParametersSerializer::addMultivaluedParameter ( const std::string &  name,
const std::vector< std::string > &  values 
)

Add a new multivalued parameter.

Parameters
nameA new non-empty parameter name.
valueA new parameter values.
Returns
true if ok, false on errors.

◆ addMultivaluedParameter() [2/2]

template<typename ValueType >
bool te::rp::AlgorithmParametersSerializer::addMultivaluedParameter ( const std::string &  name,
const std::vector< ValueType > &  values 
)
inline

Add a new multivalued parameter.

Parameters
nameA new non-empty parameter name.
valueA new parameter values.
Returns
true if ok, false on errors.

Definition at line 100 of file AlgorithmParametersSerializer.h.

◆ addMultivaluedParameters()

template<typename ValueType >
bool te::rp::AlgorithmParametersSerializer::addMultivaluedParameters ( const std::string &  name,
const std::vector< std::vector< ValueType > > &  values 
)
inline

Add sets of new multivalued parameters.

Parameters
nameA new non-empty parameter name.
valuesParameter values.
Returns
true if ok, false on errors.

Definition at line 128 of file AlgorithmParametersSerializer.h.

◆ addParameter() [1/2]

bool te::rp::AlgorithmParametersSerializer::addParameter ( const std::string &  name,
const std::string &  value 
)

Add a new parameter.

Parameters
nameA new non-empty parameter name.
valueA new parameter value.
Returns
true if ok, false on errors.

◆ addParameter() [2/2]

template<typename ValueType >
bool te::rp::AlgorithmParametersSerializer::addParameter ( const std::string &  name,
const ValueType &  value 
)
inline

Add a new parameter.

Parameters
nameA new non-empty parameter name.
valueA new parameter value.
Returns
true if ok, false on errors.

Definition at line 72 of file AlgorithmParametersSerializer.h.

◆ getMetaData()

void te::rp::AlgorithmParametersSerializer::getMetaData ( std::map< std::string, std::string > &  metadata) const

Returns all serialized parameters formatted for raster metadata.

Parameters
metadataThe output metadata.

◆ operator=()

AlgorithmParametersSerializer& te::rp::AlgorithmParametersSerializer::operator= ( const AlgorithmParametersSerializer other)

◆ reset()

void te::rp::AlgorithmParametersSerializer::reset ( )

Reset to the initial empty state.

◆ setAlgorithmName()

void te::rp::AlgorithmParametersSerializer::setAlgorithmName ( const std::string &  name)

Set a non-empty algorithm name.

Parameters
Thenew non-empty algorithm name.

◆ toString() [1/2]

template<typename ValueType >
std::string te::rp::AlgorithmParametersSerializer::toString ( const std::complex< ValueType > &  value) const
inlineprotected

Definition at line 162 of file AlgorithmParametersSerializer.h.

◆ toString() [2/2]

template<typename ValueType >
std::string te::rp::AlgorithmParametersSerializer::toString ( const ValueType &  value) const
inlineprotected

Definition at line 169 of file AlgorithmParametersSerializer.h.

Member Data Documentation

◆ m_algoName

std::string te::rp::AlgorithmParametersSerializer::m_algoName
private

Definition at line 176 of file AlgorithmParametersSerializer.h.

◆ m_params

ParsContT te::rp::AlgorithmParametersSerializer::m_params
private

Definition at line 178 of file AlgorithmParametersSerializer.h.


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