jaula API Reference  version 1.4.0
jaula_value_object.h
1 
2 /*
3  * jaula_value_object.h : JSON Analysis User Library Acronym
4  * JSON object 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_object.h $
25  * $Id: jaula_value_object.h 45 2009-01-11 16:17:03Z morongo $
26  * $Revision: 45 $
27  */
28 
29 #ifndef _JAULA_VALUE_OBJECT_H_
30 #define _JAULA_VALUE_OBJECT_H_
31 
32 #include <map>
33 
34 #include <jaula/jaula_name_duplicated.h>
35 #include <jaula/jaula_value_complex.h>
36 
41 namespace JAULA
42 { // namespace JAULA
43 
54  class Value_Object : public Value_Complex
55  { // class Value_Object
56  public:
57 
69  typedef std::map<std::string, Value *> dataType;
70 
77  Value_Object(void);
78 
88  Value_Object(dataType const &data);
89 
98  virtual ~Value_Object();
99 
103  dataType const &getData(void) const;
104 
113  virtual void repr(std::ostream &ostr) const;
114 
121  virtual bool empty(void) const;
122 
128  virtual size_t size(void) const;
129 
139  void set(dataType const &data);
140 
154  virtual void set(Value const &origin) throw(Bad_Data_Type);
155 
171  void insertItem(std::string const &name, Value const &item)
172  throw(Name_Duplicated);
173 
184  virtual void clear(void);
185 
186  private:
187 
191  dataType data_;
192  }; // class Value_Object
193 
194 } // namespace JAULA
195 #endif
196 
197 // EOF $Id: jaula_value_object.h 45 2009-01-11 16:17:03Z morongo $
dataType data_
Container to hold the value itself.
Definition: jaula_value_object.h:191
virtual void repr(std::ostream &ostr) const
Represents the instance in a stream.
Definition: jaula_value_object.cc:66
void insertItem(std::string const &name, Value const &item)
Inserts one item to the object.
Definition: jaula_value_object.cc:113
Class for bad object property name exceptions.
Definition: jaula_name_duplicated.h:61
Value_Object(void)
Default Constructor.
Definition: jaula_value_object.cc:43
virtual void clear(void)
Empties the contents of an instance.
Definition: jaula_value_object.cc:121
std::map< std::string, Value * > dataType
Data type for value contents.
Definition: jaula_value_object.h:69
virtual size_t size(void) const
Number of elements contained.
Definition: jaula_value_object.cc:84
dataType const & getData(void) const
Retrieves the map of values contained by the instance.
Definition: jaula_value_object.cc:61
Namespace for all library definitions.
Definition: jaula.h:438
virtual ~Value_Object()
Destructor.
Definition: jaula_value_object.cc:56
virtual bool empty(void) const
True if the instance is empty.
Definition: jaula_value_object.cc:79
Class for handling object values.
Definition: jaula_value_object.h:54
Base class for handling complex values.
Definition: jaula_value_complex.h:52
Base class for handling values.
Definition: jaula_value.h:52
class for incompatible data type exceptions
Definition: jaula_bad_data_type.h:52


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 Logo