#include <object.hpp>
Public Types | |
| typedef std::map< std::string, attribute > | attribute_map |
| typedef std::list< object >::const_iterator | child_iterator |
Public Member Functions | |
| object (const object *parent=NULL) | |
| void | serialise (token_list &tokens) const |
| void | deserialise (const token_list &tokens, token_list::iterator &iter) |
| const object * | get_parent () const |
| object & | add_child () |
| const std::string & | get_name () const |
| void | set_name (const std::string &name) |
| attribute & | add_attribute (const std::string &name) |
| attribute * | get_attribute (const std::string &name) |
| const attribute * | get_attribute (const std::string &name) const |
| attribute & | get_required_attribute (const std::string &name) |
| const attribute & | get_required_attribute (const std::string &name) const |
| attribute_iterator | attributes_begin () const |
| attribute_iterator | attributes_end () const |
| child_iterator | children_begin () const |
| child_iterator | children_end () const |
| unsigned int | get_line () const |
| unsigned int | get_indentation () const |
Protected Attributes | |
| const object * | m_parent |
| std::string | m_name |
| attribute_map | m_attributes |
| std::list< object > | m_children |
| unsigned int | m_line |
Classes | |
| class | attribute_iterator |
Definition at line 33 of file object.hpp.
| typedef std::map<std::string, attribute> obby::serialise::object::attribute_map |
Definition at line 36 of file object.hpp.
| typedef std::list<object>::const_iterator obby::serialise::object::child_iterator |
Definition at line 54 of file object.hpp.
| obby::serialise::object::object | ( | const object * | parent = NULL |
) |
| void obby::serialise::object::serialise | ( | token_list & | tokens | ) | const |
Definition at line 62 of file object.cpp.
References obby::serialise::token_list::add(), attributes_begin(), attributes_end(), children_begin(), children_end(), get_indentation(), m_name, obby::serialise::token::TYPE_IDENTIFIER, and obby::serialise::token::TYPE_INDENTATION.
Referenced by obby::serialise::parser::serialise_memory().
| void obby::serialise::object::deserialise | ( | const token_list & | tokens, | |
| token_list::iterator & | iter | |||
| ) |
Definition at line 97 of file object.cpp.
References obby::_(), add_child(), obby::serialise::token_list::end(), get_indentation(), m_attributes, m_line, m_name, obby::serialise::token::TYPE_IDENTIFIER, and obby::serialise::token::TYPE_INDENTATION.
Referenced by obby::serialise::parser::deserialise_memory().
| const obby::serialise::object * obby::serialise::object::get_parent | ( | ) | const |
| obby::serialise::object & obby::serialise::object::add_child | ( | ) |
Definition at line 171 of file object.cpp.
References m_children, and object().
Referenced by deserialise(), obby::user_table::serialise(), obby::text::serialise(), obby::basic_document_info< Document, Selector >::serialise(), obby::chat::serialise(), and obby::basic_buffer< Document, Selector >::serialise().
| const std::string & obby::serialise::object::get_name | ( | ) | const |
Definition at line 177 of file object.cpp.
References m_name.
Referenced by obby::basic_server_buffer< Document, Selector >::open().
| void obby::serialise::object::set_name | ( | const std::string & | name | ) |
Definition at line 182 of file object.cpp.
References m_name.
Referenced by obby::chat::serialise(), and obby::basic_buffer< Document, Selector >::serialise().
| obby::serialise::attribute & obby::serialise::object::add_attribute | ( | const std::string & | name | ) |
Definition at line 189 of file object.cpp.
References m_attributes.
Referenced by obby::user::serialise(), obby::text::chunk::serialise(), obby::basic_document_info< Document, Selector >::serialise(), obby::chat::user_message::serialise(), obby::chat::message::serialise(), and obby::basic_buffer< Document, Selector >::serialise().
| obby::serialise::attribute * obby::serialise::object::get_attribute | ( | const std::string & | name | ) |
| const obby::serialise::attribute * obby::serialise::object::get_attribute | ( | const std::string & | name | ) | const |
| obby::serialise::attribute & obby::serialise::object::get_required_attribute | ( | const std::string & | name | ) |
Throws a serialise::error if the attribute is not defined.
Definition at line 215 of file object.cpp.
References obby::_(), m_attributes, m_line, and m_name.
Referenced by obby::basic_server_buffer< Document, Selector >::open(), and obby::user::user().
| const obby::serialise::attribute & obby::serialise::object::get_required_attribute | ( | const std::string & | name | ) | const |
Throws a serialise::error if the attribute is not defined.
Definition at line 229 of file object.cpp.
References obby::_(), m_attributes, m_line, and m_name.
| obby::serialise::object::attribute_iterator obby::serialise::object::attributes_begin | ( | ) | const |
| obby::serialise::object::attribute_iterator obby::serialise::object::attributes_end | ( | ) | const |
| obby::serialise::object::child_iterator obby::serialise::object::children_begin | ( | ) | const |
Definition at line 255 of file object.cpp.
References m_children.
Referenced by obby::basic_server_document_info< Document, Selector >::basic_server_document_info(), obby::user_table::deserialise(), obby::chat::deserialise(), obby::basic_server_buffer< Document, Selector >::open(), serialise(), and obby::text::text().
| obby::serialise::object::child_iterator obby::serialise::object::children_end | ( | ) | const |
Definition at line 261 of file object.cpp.
References m_children.
Referenced by obby::basic_server_document_info< Document, Selector >::basic_server_document_info(), obby::user_table::deserialise(), obby::chat::deserialise(), obby::basic_server_buffer< Document, Selector >::open(), serialise(), and obby::text::text().
| unsigned int obby::serialise::object::get_line | ( | ) | const |
Definition at line 266 of file object.cpp.
References m_line.
Referenced by obby::basic_server_buffer< Document, Selector >::open().
| unsigned int obby::serialise::object::get_indentation | ( | ) | const |
Definition at line 271 of file object.cpp.
References get_parent(), and m_parent.
Referenced by deserialise(), and serialise().
const object* obby::serialise::object::m_parent [protected] |
std::string obby::serialise::object::m_name [protected] |
Definition at line 106 of file object.hpp.
Referenced by deserialise(), get_name(), get_required_attribute(), serialise(), and set_name().
attribute_map obby::serialise::object::m_attributes [protected] |
Definition at line 107 of file object.hpp.
Referenced by add_attribute(), attributes_begin(), attributes_end(), deserialise(), get_attribute(), and get_required_attribute().
std::list<object> obby::serialise::object::m_children [protected] |
Definition at line 108 of file object.hpp.
Referenced by add_child(), children_begin(), and children_end().
unsigned int obby::serialise::object::m_line [protected] |
Definition at line 109 of file object.hpp.
Referenced by deserialise(), get_line(), and get_required_attribute().
1.5.1