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

Detailed Description

template<class T>
class TCLAP::VALUE_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 52 of file ValueArg.h.

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

Private Member Functions

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

Private Attributes

T & _value
 Reference to the value where the result of the extraction will be put. More...
 

Friends

class ValueArg< T >
 

Constructor & Destructor Documentation

◆ ValueExtractor()

template<class T >
TCLAP::VALUE_ARG_HELPER::ValueExtractor< T >::ValueExtractor ( T &  value)
inlineprivate

Constructor.

Parameters
value- Where the value extracted will be put.

Definition at line 71 of file ValueArg.h.

Member Function Documentation

◆ extractValue()

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

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

Parameters
val- Where the value parsed will be put.

Definition at line 78 of file ValueArg.h.

References TCLAP::VALUE_ARG_HELPER::ValueExtractor< T >::_value, TCLAP::VALUE_ARG_HELPER::EXTRACT_FAILURE, and TCLAP::VALUE_ARG_HELPER::EXTRACT_TOO_MANY.

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

Friends And Related Function Documentation

◆ ValueArg< T >

template<class T >
friend class ValueArg< T >
friend

Definition at line 488 of file ValueArg.h.

Member Data Documentation

◆ _value

template<class T >
T& TCLAP::VALUE_ARG_HELPER::ValueExtractor< T >::_value
private

Reference to the value where the result of the extraction will be put.

Definition at line 65 of file ValueArg.h.

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




Page generated by Doxygen 1.9.2 for MRPT 1.4.0 SVN: at Mon Sep 20 00:47:55 UTC 2021