Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

commandl::float_arg Class Reference

An argument class that acts like a float. More...

#include <float_arg.hpp>

Inheritance diagram for commandl::float_arg:

commandl::argument List of all members.

Public Methods

 float_arg (std::vector< std::string >, std::string="", std::string="", bool=false, bool=false)
 float_arg (std::string, std::string="", std::string="", bool=false, bool=false)
 operator float () const
 This operator allows automatic conversion of a float_arg to an float. More...

void operator() (const std::string &, const std::string &, const unsigned long)
 This operator is called when there is no value to pass in. More...

void operator() (const std::string &, const std::string &, const std::string &, const std::string &, const unsigned long)
 Used when there is a single string to be passed as the value. More...

void operator() (const std::vector< std::string > &, const std::string &, const std::string &, const std::string &, const unsigned long)
 Can be used to pass a value contained in a vector. More...

float_arg & operator= (const float &)
 This operator allows assignment of a float value. More...


Protected Attributes

float arguments_float
 The underlying float that this class is wrapping. More...


Detailed Description

An argument class that acts like a float.


Constructor & Destructor Documentation

commandl::float_arg::float_arg std::vector< std::string >   ,
std::string    = "",
std::string    = "",
bool    = false,
bool    = false
 

commandl::float_arg::float_arg std::string   ,
std::string    = "",
std::string    = "",
bool    = false,
bool    = false
 


Member Function Documentation

commandl::float_arg::operator float   const
 

This operator allows automatic conversion of a float_arg to an float.

Returns:
A float.

void commandl::float_arg::operator() const std::vector< std::string > &    values,
const std::string &    prefix,
const std::string &    key,
const std::string &    assign,
const unsigned    long
[virtual]
 

Can be used to pass a value contained in a vector.

It is important to note that float_arg can take only a single float as its value. If the vector passed in has more than a single element, this operator will throw.

Implements commandl::argument.

void commandl::float_arg::operator() const std::string &    value,
const std::string &    prefix,
const std::string &    key,
const std::string &    assign,
const unsigned    long
[virtual]
 

Used when there is a single string to be passed as the value.

This operator should be used to pass a value in to be converted to the internal representation of a float within this class.

Implements commandl::argument.

void commandl::float_arg::operator() const std::string &    prefix,
const std::string &    key,
const unsigned    long
[virtual]
 

This operator is called when there is no value to pass in.

This operator should only be called when there is no corresponding value to be set. If values_size() returns anything other than zero, this version of the operator will

Implements commandl::argument.

commandl::float_arg & commandl::float_arg::operator= const float &    new_float
 

This operator allows assignment of a float value.


Member Data Documentation

float commandl::float_arg::arguments_float [protected]
 

The underlying float that this class is wrapping.


The documentation for this class was generated from the following files:
Generated on Sat Apr 5 21:17:28 2003 for commandl Library by doxygen1.2.15