IWORKDirectCollector.h Source File documentation

IWORKDirectCollector.h
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2/*
3 * This file is part of the libetonyek project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
9
10#ifndef IWORKDIRECTCOLLECTOR_H_INCLUDED
11#define IWORKDIRECTCOLLECTOR_H_INCLUDED
12
13#include <deque>
14
15#include "IWORKXMLContext.h"
16
17namespace libetonyek
18{
19
20template<typename Type, class Container = std::deque<Type> >
21 class IWORKDirectCollector
22{
23public:
24 explicit IWORKDirectCollector(Container &collection)
25 : m_collection(collection)
26 {
27 }
28
29 template<class Context, class State>
30 IWORKXMLContextPtr_t makeContext(State &state) const
31 {
32 return std::make_shared<Context>(state, m_collection);
33 }
34
35 bool pending() const
36 {
37 return false;
38 }
39
40 void push()
41 {
42 }
43
44private:
45 Container &m_collection;
46};
47
48}
49
50#endif // IWORKDIRECTCOLLECTOR_H_INCLUDED
51
52/* vim:set shiftwidth=2 softtabstop=2 expandtab: */
IWORKXMLContext.h
libetonyek::IWORKDirectCollector::pending
bool pending() const
Definition IWORKDirectCollector.h:35
libetonyek::IWORKDirectCollector::makeContext
IWORKXMLContextPtr_t makeContext(State &state) const
Definition IWORKDirectCollector.h:30
libetonyek::IWORKDirectCollector::m_collection
Container & m_collection
Definition IWORKDirectCollector.h:45
libetonyek::IWORKDirectCollector::push
void push()
Definition IWORKDirectCollector.h:40
libetonyek::IWORKDirectCollector::IWORKDirectCollector
IWORKDirectCollector(Container &collection)
Definition IWORKDirectCollector.h:24
libetonyek
Definition IWORKBezierElement.cpp:21
libetonyek::IWORKXMLContextPtr_t
std::shared_ptr< IWORKXMLContext > IWORKXMLContextPtr_t
Definition IWORKXMLContext.h:20