LTL  2.0.x
Public Member Functions | Protected Attributes | Related Functions | List of all members
util::FloatArrayOption Class Reference

Hold an array of N floats. More...

Inherits util::Option.

Public Member Functions

 FloatArrayOption (const char *name, const char *defaultVal, const char *usage, const char &cmd, const int &N, float *const storage=NULL)
 
 FloatArrayOption (const std::string &name, const std::string &defaultVal, const std::string &usage, const char &cmd, const int &N, float *const storage=NULL)
 
 FloatArrayOption (const FloatArrayOption &other)
 
 ~FloatArrayOption ()
 
virtual std::string getTypeName () const
 Return the type name of the option as a std::string. More...
 
void setValue (const std::string &s) throw (UException)
 This function is the heart of the Option class: it parses the value of the option from the supplied string. More...
 
virtual float * getFloatArray () const
 
virtual std::string toString () const
 Return the option's value as a string. More...
 
virtual bool needsValue () const
 
const std::string & getName () const
 Return the (long) option name. More...
 
char getCmdLineChar () const
 Return the short option char. More...
 
const std::string & getDefault () const
 Return the string representation of the default value. More...
 
const std::string & getUsage () const
 Return the help string. More...
 
virtual int getInt () const
 
virtual float getFloat () const
 
virtual std::string getString () const
 
virtual bool getBool () const
 

Protected Attributes

const int N_
 
float *const storage_
 
float *const value_
 
std::string name_
 long option name (e.g. –long-option or long-option=value) More...
 
std::string default_
 string representation of default value More...
 
std::string usage_
 help string More...
 
char cmdlinechar_
 short option char, for command line use More...
 

Related Functions

(Note that these are not member functions.)

std::ostream & operator<< (std::ostream &os, Option &op)
 

Detailed Description

Hold an array of N floats.

Constructor & Destructor Documentation

util::FloatArrayOption::FloatArrayOption ( const char *  name,
const char *  defaultVal,
const char *  usage,
const char &  cmd,
const int N,
float *const  storage = NULL 
)
util::FloatArrayOption::FloatArrayOption ( const std::string &  name,
const std::string &  defaultVal,
const std::string &  usage,
const char &  cmd,
const int N,
float *const  storage = NULL 
)
util::FloatArrayOption::FloatArrayOption ( const FloatArrayOption other)
util::FloatArrayOption::~FloatArrayOption ( )

Member Function Documentation

virtual std::string util::FloatArrayOption::getTypeName ( ) const
inlinevirtual

Return the type name of the option as a std::string.

Reimplemented from util::Option.

void util::FloatArrayOption::setValue ( const std::string &  s)
throw (UException
)
virtual

This function is the heart of the Option class: it parses the value of the option from the supplied string.

Implements util::Option.

virtual float* util::FloatArrayOption::getFloatArray ( ) const
virtual
virtual std::string util::FloatArrayOption::toString ( ) const
virtual

Return the option's value as a string.

Implements util::Option.

virtual int util::Option::getInt ( ) const
inlinevirtualinherited

Acess the value of the option. Usually subclasses will not implement all of these, in fact, mostly just one of these.

Reimplemented in util::IntOption.

virtual float util::Option::getFloat ( ) const
inlinevirtualinherited

Reimplemented in util::DoubleOption, and util::FloatOption.

virtual std::string util::Option::getString ( ) const
inlinevirtualinherited

Reimplemented in util::ShellOption, and util::StringOption.

virtual bool util::Option::getBool ( ) const
inlinevirtualinherited

Reimplemented in util::BoolOption.

virtual bool util::Option::needsValue ( ) const
inlinevirtualinherited

Return true if the option needs a value, false if it is a toggle-switch needing no value. On the command line, values are given as –long-option value, or -x value. In a config file, long-option = value. '#' can be used to delineate comments. See CommandLineReader and ConfigFileReader.

Reimplemented in util::BoolOption.

const std::string& util::Option::getName ( ) const
inherited

Return the (long) option name.

char util::Option::getCmdLineChar ( ) const
inherited

Return the short option char.

const std::string& util::Option::getDefault ( ) const
inherited

Return the string representation of the default value.

const std::string& util::Option::getUsage ( ) const
inherited

Return the help string.

Member Data Documentation

const int util::FloatArrayOption::N_
protected
float* const util::FloatArrayOption::storage_
protected
float* const util::FloatArrayOption::value_
protected
std::string util::Option::name_
protectedinherited

long option name (e.g. –long-option or long-option=value)

std::string util::Option::default_
protectedinherited

string representation of default value

std::string util::Option::usage_
protectedinherited

help string

char util::Option::cmdlinechar_
protectedinherited

short option char, for command line use