Main MRPT website > C++ reference for MRPT 1.4.0
List of all members | Private Member Functions | Private Attributes | Friends
TCLAP::MULTI_ARG_HELPER::ValueExtractor< T > Class Template Reference

Detailed Description

template<class T>
class TCLAP::MULTI_ARG_HELPER::ValueExtractor< T >

This class is used to extract a value from an argument.

It is used because we need a special implementation to deal with std::string and making a specialiced function puts it in the T segment, thus generating link errors. Having a specialiced class makes the symbols weak. This is not pretty but I don't know how to make it work any other way.

Definition at line 53 of file MultiArg.h.

#include <mrpt/otherlibs/tclap/MultiArg.h>

Private Member Functions

 ValueExtractor (std::vector< T > &values)
 Constructor. More...
 
int extractValue (const std::string &val)
 Method that will attempt to parse the input stream for values of type T. More...
 

Private Attributes

std::vector< T > & _values
 Reference to the vector of values where the result of the extraction will be put. More...
 

Friends

class MultiArg< T >
 

Constructor & Destructor Documentation

◆ ValueExtractor()

template<class T >
TCLAP::MULTI_ARG_HELPER::ValueExtractor< T >::ValueExtractor ( std::vector< T > &  values)
inlineprivate

Constructor.

Parameters
values- Where the values extracted will be put.

Definition at line 69 of file MultiArg.h.

Member Function Documentation

◆ extractValue()

template<class T >
int TCLAP::MULTI_ARG_HELPER::ValueExtractor< T >::extractValue ( const std::string &  val)
inlineprivate

Method that will attempt to parse the input stream for values of type T.

Parameters
val- Where the values parsed will be put.

Definition at line 76 of file MultiArg.h.

References TCLAP::MULTI_ARG_HELPER::ValueExtractor< T >::_values, TCLAP::MULTI_ARG_HELPER::EXTRACT_FAILURE, and TCLAP::MULTI_ARG_HELPER::EXTRACT_TOO_MANY.

Referenced by TCLAP::MultiArg< T >::_extractValue().

Friends And Related Function Documentation

◆ MultiArg< T >

template<class T >
friend class MultiArg< T >
friend

Definition at line 55 of file MultiArg.h.

Member Data Documentation

◆ _values

template<class T >
std::vector<T>& TCLAP::MULTI_ARG_HELPER::ValueExtractor< T >::_values
private

Reference to the vector of values where the result of the extraction will be put.

Definition at line 63 of file MultiArg.h.

Referenced by TCLAP::MULTI_ARG_HELPER::ValueExtractor< T >::extractValue(), and TCLAP::MULTI_ARG_HELPER::ValueExtractor< std::string >::extractValue().




Page generated by Doxygen 1.8.17 for MRPT 1.4.0 SVN: at Sat Jan 18 22:37:07 UTC 2020