IWORKOutputManager.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 IWORKOUTPUTMANAGER_H_INCLUDED
11 #define IWORKOUTPUTMANAGER_H_INCLUDED
12
13 #include <deque>
14 #include <stack>
15
16 #include "IWORKOutputElements.h"
17 #include "IWORKTypes.h"
18
19 namespace libetonyek
20 {
21
29 class IWORKOutputManager
30 {
31 // disable copying
32 IWORKOutputManager(const IWORKOutputManager &);
33 IWORKOutputManager &operator=(const IWORKOutputManager &);
34
35 typedef std::deque<IWORKOutputElements> OutputList_t;
36 typedef std::stack<IWORKOutputElements> OutputStack_t;
37
38 public:
39 IWORKOutputManager();
40 ~IWORKOutputManager();
41
44 void push();
45
48 void pop();
49
56 IWORKOutputID_t save();
57
62 IWORKOutputElements &get(IWORKOutputID_t id);
67 const IWORKOutputElements &get(IWORKOutputID_t id) const;
68
71 IWORKOutputElements &getCurrent();
74 const IWORKOutputElements &getCurrent() const;
75
76 private:
77 OutputStack_t m_active;
78 OutputList_t m_saved;
79 };
80
81 }
82
83 #endif // IWORKOUTPUTMANAGER_H_INCLUDED
84
85 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
libetonyek
Definition: IWORKBezierElement.cpp:20
libetonyek::IWORKOutputElements
Definition: IWORKOutputElements.h:32
IWORKOutputElements.h
libetonyek::IWORKOutputManager
A manager for output elements.
Definition: IWORKOutputManager.h:29
libetonyek::IWORKOutputManager::operator=
IWORKOutputManager & operator=(const IWORKOutputManager &)
id
int id
Definition: IWORKToken.cpp:44
libetonyek::IWORKOutputID_t
unsigned IWORKOutputID_t
Definition: IWORKTypes_fwd.h:28
libetonyek::IWORKOutputManager::OutputList_t
std::deque< IWORKOutputElements > OutputList_t
Definition: IWORKOutputManager.h:35
libetonyek::IWORKOutputManager::save
IWORKOutputID_t save()
Save the current output element.
Definition: IWORKOutputManager.cpp:39
libetonyek::IWORKOutputManager::getCurrent
IWORKOutputElements & getCurrent()
Get the current output element.
Definition: IWORKOutputManager.cpp:57
libetonyek::IWORKOutputManager::m_active
OutputStack_t m_active
Definition: IWORKOutputManager.h:77
libetonyek::IWORKOutputManager::OutputStack_t
std::stack< IWORKOutputElements > OutputStack_t
Definition: IWORKOutputManager.h:36
libetonyek::IWORKOutputManager::push
void push()
Push a new output element onto the stack.
Definition: IWORKOutputManager.cpp:28
libetonyek::IWORKOutputManager::~IWORKOutputManager
~IWORKOutputManager()
Definition: IWORKOutputManager.cpp:22
IWORKTypes.h
libetonyek::IWORKOutputManager::m_saved
OutputList_t m_saved
Definition: IWORKOutputManager.h:78
libetonyek::IWORKOutputManager::IWORKOutputManager
IWORKOutputManager()
Definition: IWORKOutputManager.cpp:15
libetonyek::IWORKOutputManager::pop
void pop()
Pop a output element from the stack.
Definition: IWORKOutputManager.cpp:33