Wolframe, 0.0.3

ddlFormParser.hpp
Go to the documentation of this file.
1 /************************************************************************
2 Copyright (C) 2011 - 2014 Project Wolframe.
3 All rights reserved.
4 
5 This file is part of Project Wolframe.
6 
7 Commercial Usage
8 Licensees holding valid Project Wolframe Commercial licenses may
9 use this file in accordance with the Project Wolframe
10 Commercial License Agreement provided with the Software or,
11 alternatively, in accordance with the terms contained
12 in a written agreement between the licensee and Project Wolframe.
13 
14 GNU General Public License Usage
15 Alternatively, you can redistribute this file and/or modify it
16 under the terms of the GNU General Public License as published by
17 the Free Software Foundation, either version 3 of the License, or
18 (at your option) any later version.
19 
20 Wolframe is distributed in the hope that it will be useful,
21 but WITHOUT ANY WARRANTY; without even the implied warranty of
22 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 GNU General Public License for more details.
24 
25 You should have received a copy of the GNU General Public License
26 along with Wolframe. If not, see <http://www.gnu.org/licenses/>.
27 
28 If you have questions regarding the use of this file, please contact
29 Project Wolframe.
30 
31 ************************************************************************/
34 #ifndef _Wolframe_serialize_DDL_FORM_PARSER_HPP_INCLUDED
35 #define _Wolframe_serialize_DDL_FORM_PARSER_HPP_INCLUDED
36 #include "utils/typeSignature.hpp"
37 #include "types/form.hpp"
38 #include "types/variantStruct.hpp"
42 
43 namespace _Wolframe {
44 namespace serialize {
45 
50 {
51 public:
53  explicit DDLFormParser( const types::FormR& form_)
54  :DDLStructParser(form_.get())
55  ,m_form(form_){}
56 
58  DDLFormParser( const types::FormR& form_, types::VariantStruct* substructure)
59  :DDLStructParser(substructure)
60  ,m_form(form_){}
61 
64  :DDLStructParser(o)
65  ,m_form(o.m_form){}
66 
68  virtual ~DDLFormParser(){}
69 
72  {
74  m_form = o.m_form;
75  return *this;
76  }
77 
79  const types::FormR& form() const {return m_form;}
80 
81 private:
83 };
84 
85 }}//namespace
86 #endif
87 
Defines the DDL structure deserialization.
DDLStructParser & operator=(const DDLStructParser &o)
Assignment operator.
types::FormR m_form
reference to the form structure of this parser
Definition: ddlFormParser.hpp:82
DDLFormParser(const DDLFormParser &o)
Copy constructor.
Definition: ddlFormParser.hpp:63
boost::shared_ptr< Form > FormR
shared ownership reference to form data structure
Definition: form.hpp:173
Structure of variant type atoms or substructures.
Definition: variantStruct.hpp:57
Parser of a form from a serialization defined by a DDL.
Definition: ddlFormParser.hpp:48
Interface for signature for structures to detect memory problems.
Defines the unified form data structure as defined by a DDL (data definition language). A form data structure represents the document unit of a wolframe request or answer.
Defines the DDL structure serialization.
DDLFormParser & operator=(const DDLFormParser &o)
Assignment operator.
Definition: ddlFormParser.hpp:71
Initializer of a DDL structure from an iterator (serialization)
Definition: ddlStructParser.hpp:50
const types::FormR & form() const
Get a shared reference to the form structure filled by this parser.
Definition: ddlFormParser.hpp:79
DDLFormParser(const types::FormR &form_)
Constructor.
Definition: ddlFormParser.hpp:53
virtual ~DDLFormParser()
Destructor.
Definition: ddlFormParser.hpp:68
Structures of variant types.
DDLFormParser(const types::FormR &form_, types::VariantStruct *substructure)
Constructor.
Definition: ddlFormParser.hpp:58
Description of structures of variant types.