Wolframe, 0.0.3

ddlStructSerializer.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 
35 #ifndef _Wolframe_SERIALIZE_DDL_STRUCT_SERIALIZER_HPP_INCLUDED
36 #define _Wolframe_SERIALIZE_DDL_STRUCT_SERIALIZER_HPP_INCLUDED
37 #include "serialize/flags.hpp"
38 #include "filter/typedfilter.hpp"
39 #include "types/variant.hpp"
40 #include "serialize/mapContext.hpp"
42 #include "types/variantStruct.hpp"
43 #include <cstddef>
44 
45 namespace _Wolframe {
46 namespace serialize {
47 
52 {
53 public:
56  :langbind::TypedInputFilter("serializer"){}
58  explicit DDLStructSerializer( const types::VariantStruct* st);
59 
64 
67 
70 
74  bool call();
75 
78  virtual TypedInputFilter* copy() const {return new DDLStructSerializer(*this);}
79 
85  virtual bool setFlags( Flags f);
86 
87 private:
92 };
93 
94 }}//namespace
95 #endif
96 
virtual TypedInputFilter * copy() const
Get a self copy.
Definition: ddlStructSerializer.hpp:78
Iterator on a DDL structure (serializer of VariantStruct)
Definition: ddlStructSerializer.hpp:50
Context m_ctx
Definition: ddlStructSerializer.hpp:89
Flags flags() const
Get all flags.
Definition: filterbase.hpp:120
virtual ~DDLStructSerializer()
Destructor.
Definition: ddlStructSerializer.hpp:63
Defines the Parsing STM for DDL serialization.
Structure of variant type atoms or substructures.
Definition: variantStruct.hpp:57
Set of flags to negotiate source behaviour in serialization and sink behaviour in validation...
Definition: flags.hpp:43
langbind::TypedOutputFilterR m_out
Definition: ddlStructSerializer.hpp:90
DDLSerializeStateStack m_stk
Definition: ddlStructSerializer.hpp:91
DDLStructSerializer & operator=(const DDLStructSerializer &o)
Assignment operator.
Variant value type that represents a variant copy without content ownership.
Definition: variant.hpp:286
Variant value type.
DDLStructSerializer()
Default constructor.
Definition: ddlStructSerializer.hpp:55
ElementType
Content element type that describes the role of the element in the structured input.
Definition: filterbase.hpp:66
TypedInputFilter(const char *name_)
Constructor.
Definition: typedfilter.hpp:55
Defines the data structure holding the global serialization state variables (without the stack) ...
const types::VariantStruct * m_st
Definition: ddlStructSerializer.hpp:88
boost::shared_ptr< TypedOutputFilter > TypedOutputFilterR
Shared output filter (langbind::TypedOutputFilter) reference.
Definition: typedfilter.hpp:149
bool call()
Call of one processing step the serializer.
Enum
the enumeration that can also be interpreted as bit set
Definition: flags.hpp:47
Defines the flags for serialization behaviour.
std::vector< DDLSerializeState > DDLSerializeStateStack
State stack for an iterator on a DDL structure (serializer of VariantStruct)
Definition: ddlSerializeStack.hpp:125
virtual bool getNext(langbind::FilterBase::ElementType &type, types::VariantConst &value)
Get the next element of the serialization.
Empty flag set (no flags set)
Definition: flags.hpp:49
Structures of variant types.
Typed interface for input/output filter.
Global state variables of a running serialization/deserialization procedure (without the stack) ...
Definition: mapContext.hpp:46
Input filter with atomic values having a type.
Definition: typedfilter.hpp:48
virtual bool setFlags(Flags f)
Set the flags stearing the serialization.
void init(const langbind::TypedOutputFilterR &out, serialize::Flags::Enum flags=serialize::Flags::None)
Serialize start initialization.