libsdr  0.1.0
A simple SDR library
Public Member Functions | Protected Types | Protected Attributes | List of all members
sdr::Options::Value Class Reference

The argument value. More...

#include <options.hh>

Public Member Functions

 Value ()
 Empty constructor. More...
 
 Value (long value)
 Integer constructor. More...
 
 Value (double value)
 Floating point constructor. More...
 
 Value (const std::string &value)
 String constructor. More...
 
 Value (const Value &other)
 Copy constructor. More...
 
 ~Value ()
 Destructor. More...
 
const Valueoperator= (const Value &other)
 Assignment. More...
 
bool isNone () const
 Returns true if the value is empty. More...
 
bool isInteger () const
 Returns true if the value is an integer. More...
 
bool isFloat () const
 Returns true if the value is a floating point number. More...
 
bool isString () const
 Returns true if the value is a string. More...
 
long toInteger () const
 Turns the value into an integer. More...
 
double toFloat () const
 Turns the value into a floating point number. More...
 
std::string toString () const
 Turns the value into a string. More...
 

Protected Types

enum  Type { NONE, INTEGER, FLOAT, STRING }
 Value type. More...
 

Protected Attributes

Type _type
 The type of the value. More...
 
union {
   long   as_int
 
   double   as_float
 
   char *   as_string
 
_value
 Values. More...
 

Detailed Description

The argument value.

Member Enumeration Documentation

enum sdr::Options::Value::Type
protected

Value type.

Enumerator
NONE 

Empty or invalid value.

INTEGER 

An integer (long int).

FLOAT 

A floating point number (double).

STRING 

An ASCII string.

Constructor & Destructor Documentation

Options::Value::Value ( )

Empty constructor.

Options::Value::Value ( long  value)

Integer constructor.

Options::Value::Value ( double  value)

Floating point constructor.

Options::Value::Value ( const std::string &  value)

String constructor.

Options::Value::Value ( const Value other)

Copy constructor.

Options::Value::~Value ( )

Destructor.

Member Function Documentation

bool Options::Value::isFloat ( ) const

Returns true if the value is a floating point number.

bool Options::Value::isInteger ( ) const

Returns true if the value is an integer.

bool Options::Value::isNone ( ) const

Returns true if the value is empty.

bool Options::Value::isString ( ) const

Returns true if the value is a string.

const Options::Value & Options::Value::operator= ( const Value other)

Assignment.

double Options::Value::toFloat ( ) const

Turns the value into a floating point number.

long Options::Value::toInteger ( ) const

Turns the value into an integer.

std::string Options::Value::toString ( ) const

Turns the value into a string.

Member Data Documentation

Type sdr::Options::Value::_type
protected

The type of the value.

union { ... } sdr::Options::Value::_value

Values.


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