JAULA::Value_Number Class Reference
JAULA: JSON Values containers

Class for handling numeric values. More...

`#include <jaula_value_number.h>`

Inheritance diagram for JAULA::Value_Number:

## Public Member Functions

double | getData (void) const
| Retrieves the value contained by the instance.
virtual void | repr (std::ostream &ostr) const
| Represents the instance in a stream.
void | set (double data)
| Establishes the contents of the instance.
virtual void | set (Value const &origin) throw (Bad_Data_Type)
| Copies the contents of one instance into another.
| Value_Number (double data=0)
| Constructor.
virtual | ~Value_Number ()
| Destructor.
Public Member Functions inherited from JAULA::Value
ValueType | getType (void) const
| Retrieves the value type for the instance.
Value & | operator= (Value const &orig) throw (Bad_Data_Type)
| Assignment operator.
virtual | ~Value ()
| Destructor.

## Private Attributes

double | data_
| Container to hold the value itself.

## Additional Inherited Members

Public Types inherited from JAULA::Value
enum | ValueType { TYPE_NULL , TYPE_BOOLEAN , TYPE_STRING , TYPE_NUMBER , TYPE_NUMBER_INT , TYPE_ARRAY , TYPE_OBJECT }
| Enumeration of available value types. More...
Static Public Member Functions inherited from JAULA::Value
static Value * | duplicate (Value const &orig)
| Creates a duplicate of a value.
Protected Member Functions inherited from JAULA::Value
| Value (ValueType Type)
| Constructor.

## Detailed Description

Class for handling numeric values.

  This class is a container for JSON numeric values.

Author
  Kombo Morongo moron.nosp@m.go66.nosp@m.6@gma.nosp@m.il.c.nosp@m.om

## Constructor & Destructor Documentation

## Value_Number()

JAULA::Value_Number::Value_Number | ( | double | data = 0 | ) |

Constructor.

Parameters

  data | Initial value to be hold by the conatiner

References data_, JAULA::Value::TYPE_NUMBER, and JAULA::Value::Value().

Referenced by set().

## ~Value_Number()

JAULA::Value_Number::~Value_Number | ( |  | ) |

virtual

Destructor.

## Member Function Documentation

## getData()

double JAULA::Value_Number::getData | ( | void |  | ) | const

Retrieves the value contained by the instance.

References data_.

Referenced by JAULA::Value::duplicate(), and set().

## repr()

void JAULA::Value_Number::repr | ( | std::ostream & | ostr | ) | const

virtual

Represents the instance in a stream.

Parameters

  ostr | Stream where the instance is to be represented.

Description
  writes the instance content in JSON notation in a stream.

Implements JAULA::Value.

References data_.

## set() [1/2]

void JAULA::Value_Number::set | ( | double | data | ) |

Establishes the contents of the instance.

Parameters

  data | Value to assign to the instance

References data_.

## set() [2/2]

void JAULA::Value_Number::set | ( | Value const & | origin | ) |
throw | ( | Bad_Data_Type ) |  |  |

virtual

Copies the contents of one instance into another.

Parameters

  origin | Reference to the value to be copied.

Exceptions

  Bad_Data_Type | This exception is launched in case that origin and destination value types are different.

Reimplemented from JAULA::Value.

References JAULA::Exception::addOrigin(), data_, getData(), JAULA::Value::set(), JAULA::Value::Value(), and Value_Number().

## Field Documentation

## data_

double JAULA::Value_Number::data_

private

Container to hold the value itself.

Referenced by getData(), repr(), set(), set(), and Value_Number().

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

- jaula_value_number.h
- jaula_value_number.cc

Back to JAULA Project Documentation Page.

Go to JAULA Project Home Page.

Copyright (c) 2007, 2008, 2009 Kombo Morongo.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License".

SourceForge.net