jaula API Reference  version 1.4.0
jaula_value.h
1 
2 /*
3  * jaula_value.h : JSON Analysis User Library Acronym
4  * Generic values definitions
5  *
6  * Copyright (C) 2007, 2008, 2009 Kombo Morongo <morongo666@gmail.com>
7  *
8  * This library is free software; you can redistribute it and/or modify it
9  * under the terms of the GNU Lesser General Public License as published by
10  * the Free Software Foundation; either version 2.1 of the License, or (at
11  * your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful, but
14  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
16  * License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public License
19  * along with this library; if not, write to the Free Software Foundation,
20  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
21  *
22  * svn info:
23  * $Author: morongo $
24  * $HeadURL: https://jaula.svn.sourceforge.net/svnroot/jaula/tags/jaula-1.4.0/jaula/jaula_value.h $
25  * $Id: jaula_value.h 45 2009-01-11 16:17:03Z morongo $
26  * $Revision: 45 $
27  */
28 
29 #ifndef _JAULA_VALUE_H_
30 #define _JAULA_VALUE_H_
31 
32 #include <jaula/jaula_bad_data_type.h>
33 
38 namespace JAULA
39 { // namespace JAULA
40 
52  class Value
53  { // class Value
54  public:
55 
59  enum ValueType
60  { // enum ValueType
74  , TYPE_OBJECT
75  }; // enum ValueType
76 
80  virtual ~Value();
81 
89  ValueType getType(void) const;
90 
99  virtual void repr(std::ostream &ostr) const = 0;
100 
110  virtual void set(Value const &origin) throw(Bad_Data_Type);
111 
130  Value &operator=(Value const &orig) throw(Bad_Data_Type);
131 
145  static Value *duplicate(Value const &orig);
146 
147  protected:
148 
161  Value(ValueType Type);
162 
163  private:
164 
169  }; // class Value
170 
171 } // namespace JAULA
172 
173 
192 std::ostream &operator<<(std::ostream &ostr, JAULA::Value const &val);
193 #endif
194 
195 // EOF $Id: jaula_value.h 45 2009-01-11 16:17:03Z morongo $
JAULA::Value_Object
Class for handling object values.
Definition: jaula_value_object.h:54
JAULA::Value_Boolean::getData
bool getData(void) const
Retrieves the value contained by the instance.
Definition: jaula_value_boolean.cc:50
JAULA::Value_Number::getData
double getData(void) const
Retrieves the value contained by the instance.
Definition: jaula_value_number.cc:50
JAULA::Value_Number
Class for handling numeric values.
Definition: jaula_value_number.h:51
JAULA::Value::ValueType
ValueType
Enumeration of available value types.
Definition: jaula_value.h:59
JAULA::Value::TYPE_NUMBER
@ TYPE_NUMBER
Definition: jaula_value.h:68
operator<<
std::ostream & operator<<(std::ostream &ostr, JAULA::Value const &val)
Insertion operator extension for values.
Definition: jaula_value.cc:157
JAULA::Exception
Base class for error handling exceptions.
Definition: jaula_exception.h:53
JAULA::Value::Type_
ValueType Type_
Container for error code.
Definition: jaula_value.h:168
JAULA::Value_Object::getData
const dataType & getData(void) const
Retrieves the map of values contained by the instance.
Definition: jaula_value_object.cc:61
JAULA::Value_Number_Int::getData
long getData(void) const
Retrieves the value contained by the instance.
Definition: jaula_value_number_int.cc:49
JAULA::Value::duplicate
static Value * duplicate(Value const &orig)
Creates a duplicate of a value.
Definition: jaula_value.cc:85
JAULA::Value::TYPE_NULL
@ TYPE_NULL
Definition: jaula_value.h:62
JAULA::Value_Boolean
Class for handling boolean values.
Definition: jaula_value_boolean.h:51
JAULA::Value::TYPE_BOOLEAN
@ TYPE_BOOLEAN
Definition: jaula_value.h:64
JAULA
Namespace for all library definitions.
Definition: jaula.h:438
JAULA::Value::set
virtual void set(Value const &origin)
Copies the contents of one instance into another.
Definition: jaula_value.cc:61
JAULA::Value_Array::getData
const dataType & getData(void) const
Retrieves the array of values contained by the instance.
Definition: jaula_value_array.cc:61
JAULA::Exception::addOrigin
void addOrigin(std::string const &origin)
Attachs a new origin after the existing ones.
Definition: jaula_exception.cc:144
JAULA::Value::repr
virtual void repr(std::ostream &ostr) const =0
Represents the instance in a stream.
JAULA::Value
Base class for handling values.
Definition: jaula_value.h:52
JAULA::Value::Value
Value(ValueType Type)
Constructor.
Definition: jaula_value.cc:150
JAULA::Value::TYPE_STRING
@ TYPE_STRING
Definition: jaula_value.h:66
JAULA::Value::operator=
Value & operator=(Value const &orig)
Assignment operator.
Definition: jaula_value.cc:69
JAULA::Value_String::getData
const std::string & getData(void) const
Retrieves the value contained by the instance.
Definition: jaula_value_string.cc:59
JAULA::Value::TYPE_NUMBER_INT
@ TYPE_NUMBER_INT
Definition: jaula_value.h:70
JAULA::Value_Array
Class for handling array values.
Definition: jaula_value_array.h:53
JAULA::Bad_Data_Type
class for incompatible data type exceptions
Definition: jaula_bad_data_type.h:52
JAULA::Value_Number_Int
Class for handling numeric (int) values.
Definition: jaula_value_number_int.h:52
JAULA::Value_Null
class for handling null values
Definition: jaula_value_null.h:50
JAULA::Value_String
Class for handling numeric values.
Definition: jaula_value_string.h:51
JAULA::Value::~Value
virtual ~Value()
Destructor.
Definition: jaula_value.cc:53
JAULA::Value::TYPE_ARRAY
@ TYPE_ARRAY
Definition: jaula_value.h:72
JAULA::Value::getType
ValueType getType(void) const
Retrieves the value type for the instance.
Definition: jaula_value.cc:56


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".

API Reference Generated for jaula by

doxygen

jaula project hosted by

SourceForge.net