claraty::Parse_Tree_Data Class Reference
#include <parse_tree.h>
Collaboration diagram for claraty::Parse_Tree_Data:

Protected Types | |
| enum | Nodetype { PT_ATOM, PT_ARRAY, PT_MAP, PT_NULL } |
Protected Member Functions | |
| Parse_Tree_Data () | |
| Parse_Tree_Data (const Parse_Tree_Data &rhs, bool dummy_deep_copy) | |
| void | ref () |
| void | unref () |
| void | set_nodetype (Nodetype nodetype) |
Protected Attributes | |
| int | _refcount |
| Nodetype | _nodetype |
| std::vector< Parse_Tree > | _array |
| std::map< std::string, Parse_Tree > | _map |
| std::vector< std::string > | _map_fields |
| std::string | _atom |
Friends | |
| class | Parse_Tree |
Detailed Description
Definition at line 40 of file parse_tree.h.
Member Enumeration Documentation
enum claraty::Parse_Tree_Data::Nodetype [protected] |
Constructor & Destructor Documentation
| claraty::Parse_Tree_Data::Parse_Tree_Data | ( | ) | [protected] |
| claraty::Parse_Tree_Data::Parse_Tree_Data | ( | const Parse_Tree_Data & | rhs, | |
| bool | dummy_deep_copy | |||
| ) | [protected] |
Definition at line 38 of file parse_tree.cc.
References _array, _map, _nodetype, Parse_Tree, PT_ARRAY, and PT_MAP.
00039 : _refcount(1), _nodetype(rhs._nodetype), _array(rhs._array.size()), _map(), 00040 _map_fields(rhs._map_fields), _atom(rhs._atom) 00041 { 00042 if (_nodetype == PT_ARRAY) 00043 for (size_t i = 0; i < _array.size(); i++) 00044 _array[i] = Parse_Tree(rhs._array[i], true); 00045 else if (_nodetype == PT_MAP) { 00046 for (map<string, Parse_Tree>::const_iterator it = rhs._map.begin(); 00047 it != rhs._map.end(); ++it) 00048 _map[it->first] = Parse_Tree(it->second, true); 00049 } 00050 }
Member Function Documentation
| void claraty::Parse_Tree_Data::ref | ( | ) | [protected] |
Definition at line 53 of file parse_tree.cc.
References _refcount.
Referenced by claraty::Parse_Tree::operator=(), and claraty::Parse_Tree::Parse_Tree().
00054 { 00055 _refcount++; 00056 }
| void claraty::Parse_Tree_Data::unref | ( | ) | [protected] |
Definition at line 58 of file parse_tree.cc.
References _refcount.
Referenced by claraty::Parse_Tree::operator=(), and claraty::Parse_Tree::~Parse_Tree().
| void claraty::Parse_Tree_Data::set_nodetype | ( | Nodetype | nodetype | ) | [protected] |
Definition at line 64 of file parse_tree.cc.
References _array, _atom, _map, _map_fields, _nodetype, PT_ARRAY, PT_ATOM, and PT_MAP.
00065 { 00066 if (_nodetype == nodetype) return; 00067 if (_nodetype != PT_MAP) { _map.clear(); _map_fields.clear(); } 00068 if (_nodetype != PT_ARRAY) { _array.clear(); } 00069 if (_nodetype != PT_ATOM) { _atom=""; } 00070 _nodetype= nodetype; 00071 }
Friends And Related Function Documentation
friend class Parse_Tree [friend] |
Member Data Documentation
int claraty::Parse_Tree_Data::_refcount [protected] |
Nodetype claraty::Parse_Tree_Data::_nodetype [protected] |
Definition at line 60 of file parse_tree.h.
Referenced by claraty::Parse_Tree::is_array(), claraty::Parse_Tree::is_atom(), claraty::Parse_Tree::is_map(), claraty::Parse_Tree::is_null(), Parse_Tree_Data(), claraty::Parse_Tree::pretty_print(), and set_nodetype().
std::vector<Parse_Tree> claraty::Parse_Tree_Data::_array [protected] |
Definition at line 61 of file parse_tree.h.
Referenced by Parse_Tree_Data(), set_nodetype(), and claraty::Parse_Tree::size().
std::map<std::string, Parse_Tree> claraty::Parse_Tree_Data::_map [protected] |
Definition at line 62 of file parse_tree.h.
Referenced by claraty::Parse_Tree::get_field(), Parse_Tree_Data(), claraty::Parse_Tree::pretty_print_map(), set_nodetype(), and claraty::Parse_Tree::size().
std::vector<std::string> claraty::Parse_Tree_Data::_map_fields [protected] |
Definition at line 63 of file parse_tree.h.
Referenced by claraty::Parse_Tree::pretty_print_map(), and set_nodetype().
std::string claraty::Parse_Tree_Data::_atom [protected] |
Definition at line 64 of file parse_tree.h.
Referenced by claraty::Parse_Tree::operator::std::string(), claraty::Parse_Tree::pretty_print_atom(), and set_nodetype().
The documentation for this class was generated from the following files: