FEDEM Solver  R8.0
Source code of the dynamics solver
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
FFaCmdLineEntry< T > Class Template Reference

Template class for command-line options of arbitrary value type. More...

#include <FFaCmdLineArg.H>

Inheritance diagram for FFaCmdLineEntry< T >:
Inheritance graph
[legend]
Collaboration diagram for FFaCmdLineEntry< T >:
Collaboration graph
[legend]

Public Member Functions

 FFaCmdLineEntry (const std::string &text, const T &value, bool showToAll)
 The constructor initializes the class attributes and option values. More...
 
virtual ~FFaCmdLineEntry ()
 Empty destructor. More...
 
virtual bool hasValue () const
 Checks if this option has been assigned a non-empty value. More...
 
virtual bool hasDefault () const
 Checks if this option has been assigned a non-empty default value. More...
 
virtual int convertOption (const std::string &)
 Converts the command-line option value from the given string. More...
 
virtual std::string getDefaultString () const
 Composes the default section of the help text for this option. More...
 
virtual std::string getValueString (bool noDefaults) const
 Returns a string representation of the command-line option value. More...
 
const T & getValue () const
 Returns the actual command-line option value. More...
 
virtual void reset ()
 Resets the option to its default value. More...
 
bool hasValue () const
 Checks if a string option has been assigned a non-empty value. More...
 
bool hasDefault () const
 Checks if a string option has been assigned a non-empty default value. More...
 
bool hasDefault () const
 Checks if an int vector option has been assigned a non-empty default value. More...
 
bool hasDefault () const
 Checks if a double vector option has been assigned a non-empty default value. More...
 
std::string getDefaultString () const
 Composes the default section of the help text for a string option. More...
 
std::string getValueString (bool noDefaults) const
 Returns a string representation of a string option value. More...
 
std::string getDefaultString () const
 Composes the default section of the help text for a string option. More...
 
std::string getValueString (bool noDefaults) const
 Returns a string representation of a bool option value. More...
 
int convertOption (const std::string &value)
 Converts the command-line option to an int value. More...
 
int convertOption (const std::string &value)
 Converts the command-line option to a float value. More...
 
int convertOption (const std::string &value)
 Converts the command-line option to a double value. More...
 
int convertOption (const std::string &value)
 Converts the command-line option to a vector of integers. More...
 
int convertOption (const std::string &value)
 Converts the command-line option to a vector of doubles. More...
 
int convertOption (const std::string &value)
 Converts the command-line option to a string value. More...
 
int convertOption (const std::string &value)
 Converts the command-line option to a bool value. More...
 
const DoubleVecgetValue () const
 Returns a vector of doubles command-line option value. More...
 
const IntVecgetValue () const
 Returns a vector of integers command-line option value. More...
 
- Public Member Functions inherited from FFaCmdLineEntryBase
virtual ~FFaCmdLineEntryBase ()
 Empty destructor. More...
 

Protected Member Functions

virtual std::string toString (const T &value) const
 Returns the string representation of the specified value. More...
 
std::string toString (const IntVec &value) const
 Returns a string representation of a vector of integers. More...
 
std::string toString (const DoubleVec &value) const
 Returns a string representation of a vector of doubles. More...
 
- Protected Member Functions inherited from FFaCmdLineEntryBase
 FFaCmdLineEntryBase (const std::string &text, bool showToAll)
 The constructor initializes the class attributes. More...
 

Private Attributes

myValue
 The assigned value of this command-line option. More...
 
myDefault
 The default value of this command-line option. More...
 

Additional Inherited Members

- Protected Attributes inherited from FFaCmdLineEntryBase
std::string myHelpText
 Text description of this command-line option. More...
 
bool iAmSetOnCmdLine
 true if this option has been specified More...
 
bool isPublic
 true unless this option is hidden More...
 

Detailed Description

template<class T>
class FFaCmdLineEntry< T >

Template class for command-line options of arbitrary value type.

Constructor & Destructor Documentation

◆ FFaCmdLineEntry()

template<class T >
FFaCmdLineEntry< T >::FFaCmdLineEntry ( const std::string &  text,
const T &  value,
bool  showToAll 
)
inline

The constructor initializes the class attributes and option values.

◆ ~FFaCmdLineEntry()

template<class T >
virtual FFaCmdLineEntry< T >::~FFaCmdLineEntry ( )
inlinevirtual

Empty destructor.

Member Function Documentation

◆ convertOption() [1/8]

template<class T >
virtual int FFaCmdLineEntry< T >::convertOption ( const std::string &  )
inlinevirtual

Converts the command-line option value from the given string.

Implements FFaCmdLineEntryBase.

◆ convertOption() [2/8]

int FFaCmdLineEntry< int >::convertOption ( const std::string &  value)
inlinevirtual

Converts the command-line option to an int value.

Implements FFaCmdLineEntryBase.

◆ convertOption() [3/8]

int FFaCmdLineEntry< float >::convertOption ( const std::string &  value)
inlinevirtual

Converts the command-line option to a float value.

Implements FFaCmdLineEntryBase.

◆ convertOption() [4/8]

int FFaCmdLineEntry< double >::convertOption ( const std::string &  value)
inlinevirtual

Converts the command-line option to a double value.

Implements FFaCmdLineEntryBase.

◆ convertOption() [5/8]

int FFaCmdLineEntry< IntVec >::convertOption ( const std::string &  value)
inlinevirtual

Converts the command-line option to a vector of integers.

Implements FFaCmdLineEntryBase.

◆ convertOption() [6/8]

int FFaCmdLineEntry< DoubleVec >::convertOption ( const std::string &  value)
inlinevirtual

Converts the command-line option to a vector of doubles.

Implements FFaCmdLineEntryBase.

◆ convertOption() [7/8]

int FFaCmdLineEntry< std::string >::convertOption ( const std::string &  value)
inlinevirtual

Converts the command-line option to a string value.

Implements FFaCmdLineEntryBase.

◆ convertOption() [8/8]

int FFaCmdLineEntry< bool >::convertOption ( const std::string &  value)
inlinevirtual

Converts the command-line option to a bool value.

Implements FFaCmdLineEntryBase.

◆ getDefaultString() [1/3]

template<class T >
virtual std::string FFaCmdLineEntry< T >::getDefaultString ( ) const
inlinevirtual

Composes the default section of the help text for this option.

Implements FFaCmdLineEntryBase.

◆ getDefaultString() [2/3]

std::string FFaCmdLineEntry< std::string >::getDefaultString ( ) const
inlinevirtual

Composes the default section of the help text for a string option.

Implements FFaCmdLineEntryBase.

◆ getDefaultString() [3/3]

std::string FFaCmdLineEntry< bool >::getDefaultString ( ) const
inlinevirtual

Composes the default section of the help text for a string option.

Implements FFaCmdLineEntryBase.

◆ getValue() [1/3]

template<class T >
const T& FFaCmdLineEntry< T >::getValue ( ) const
inline

Returns the actual command-line option value.

◆ getValue() [2/3]

const DoubleVec & FFaCmdLineEntry< DoubleVec >::getValue ( ) const
inline

Returns a vector of doubles command-line option value.

◆ getValue() [3/3]

const IntVec & FFaCmdLineEntry< IntVec >::getValue ( ) const
inline

Returns a vector of integers command-line option value.

◆ getValueString() [1/3]

template<class T >
virtual std::string FFaCmdLineEntry< T >::getValueString ( bool  noDefaults) const
inlinevirtual

Returns a string representation of the command-line option value.

Implements FFaCmdLineEntryBase.

◆ getValueString() [2/3]

std::string FFaCmdLineEntry< std::string >::getValueString ( bool  noDefaults) const
inlinevirtual

Returns a string representation of a string option value.

Implements FFaCmdLineEntryBase.

◆ getValueString() [3/3]

std::string FFaCmdLineEntry< bool >::getValueString ( bool  noDefaults) const
inlinevirtual

Returns a string representation of a bool option value.

Implements FFaCmdLineEntryBase.

◆ hasDefault() [1/4]

template<class T >
virtual bool FFaCmdLineEntry< T >::hasDefault ( ) const
inlinevirtual

Checks if this option has been assigned a non-empty default value.

Implements FFaCmdLineEntryBase.

◆ hasDefault() [2/4]

bool FFaCmdLineEntry< std::string >::hasDefault ( ) const
inlinevirtual

Checks if a string option has been assigned a non-empty default value.

Implements FFaCmdLineEntryBase.

◆ hasDefault() [3/4]

bool FFaCmdLineEntry< IntVec >::hasDefault ( ) const
inlinevirtual

Checks if an int vector option has been assigned a non-empty default value.

Implements FFaCmdLineEntryBase.

◆ hasDefault() [4/4]

bool FFaCmdLineEntry< DoubleVec >::hasDefault ( ) const
inlinevirtual

Checks if a double vector option has been assigned a non-empty default value.

Implements FFaCmdLineEntryBase.

◆ hasValue() [1/2]

template<class T >
virtual bool FFaCmdLineEntry< T >::hasValue ( ) const
inlinevirtual

Checks if this option has been assigned a non-empty value.

Implements FFaCmdLineEntryBase.

◆ hasValue() [2/2]

bool FFaCmdLineEntry< std::string >::hasValue ( ) const
inlinevirtual

Checks if a string option has been assigned a non-empty value.

Implements FFaCmdLineEntryBase.

◆ reset()

template<class T >
virtual void FFaCmdLineEntry< T >::reset ( )
inlinevirtual

Resets the option to its default value.

Implements FFaCmdLineEntryBase.

◆ toString() [1/3]

std::string FFaCmdLineEntry< DoubleVec >::toString ( const DoubleVec value) const
inlineprotected

Returns a string representation of a vector of doubles.

◆ toString() [2/3]

std::string FFaCmdLineEntry< IntVec >::toString ( const IntVec value) const
inlineprotected

Returns a string representation of a vector of integers.

◆ toString() [3/3]

template<class T >
virtual std::string FFaCmdLineEntry< T >::toString ( const T &  value) const
inlineprotectedvirtual

Returns the string representation of the specified value.

Member Data Documentation

◆ myDefault

template<class T >
T FFaCmdLineEntry< T >::myDefault
private

The default value of this command-line option.

◆ myValue

template<class T >
T FFaCmdLineEntry< T >::myValue
private

The assigned value of this command-line option.


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