- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- File List
- File Members

IWORKContainerContext.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 IWORKCONTAINERCONTEXT_H_INCLUDED
11 #define IWORKCONTAINERCONTEXT_H_INCLUDED
12
13 #include <deque>
14
15 #include "IWORKXMLContextBase.h"
16
17 namespace libetonyek
18 {
19
20 template<typename Type, class NestedParser, unsigned Id>
21 class IWORKContainerContext : public IWORKXMLElementContextBase
22 {
23 public:
24 IWORKContainerContext(IWORKXMLParserState &state, std::deque<Type> &elements)
25 : IWORKXMLElementContextBase(state)
26 , m_elements(elements)
27 {
28 }
29
30 private:
31 virtual IWORKXMLContextPtr_t element(const int name)
32 {
33 if (name == Id)
34 return makeContext<NestedParser>(getState(), m_elements);
35 return IWORKXMLContextPtr_t();
36 }
37
38 private:
39 std::deque<Type> &m_elements;
40 };
41
42 }
43
44 #endif // IWORKCONTAINERCONTEXT_H_INCLUDED
45
46 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
libetonyek
Definition: IWORKBezierElement.cpp:18
IWORKXMLContextBase.h
libetonyek::IWORKContainerContext::m_elements
std::deque< Type > & m_elements
Definition: IWORKContainerContext.h:39
libetonyek::IWORKContainerContext::element
virtual IWORKXMLContextPtr_t element(const int name)
Definition: IWORKContainerContext.h:31
libetonyek::IWORKXMLContextPtr_t
boost::shared_ptr< IWORKXMLContext > IWORKXMLContextPtr_t
Definition: IWORKXMLContext.h:18
libetonyek::IWORKXMLContextBase::getState
State & getState()
Definition: IWORKXMLContextBase.h:43
name
const char * name
Definition: IWORKToken.cpp:43
libetonyek::IWORKContainerContext
Definition: IWORKContainerContext.h:21
libetonyek::IWORKXMLContextBase
Definition: IWORKXMLContextBase.h:27
libetonyek::IWORKXMLParserState
Definition: IWORKXMLParserState.h:29
libetonyek::IWORKContainerContext::IWORKContainerContext
IWORKContainerContext(IWORKXMLParserState &state, std::deque< Type > &elements)
Definition: IWORKContainerContext.h:24