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>
22 {
23 public:
24  IWORKContainerContext(IWORKXMLParserState &state, std::deque<Type> &elements)
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: */
Definition: IWORKBezierElement.cpp:18
std::deque< Type > & m_elements
Definition: IWORKContainerContext.h:39
virtual IWORKXMLContextPtr_t element(const int name)
Definition: IWORKContainerContext.h:31
boost::shared_ptr< IWORKXMLContext > IWORKXMLContextPtr_t
Definition: IWORKXMLContext.h:18
State & getState()
Definition: IWORKXMLContextBase.h:43
const char * name
Definition: IWORKToken.cpp:43
Definition: IWORKContainerContext.h:21
Definition: IWORKXMLContextBase.h:27
Definition: IWORKXMLParserState.h:29
IWORKContainerContext(IWORKXMLParserState &state, std::deque< Type > &elements)
Definition: IWORKContainerContext.h:24

Generated for libetonyek by doxygen 1.8.10