summaryrefslogtreecommitdiffstats
path: root/raul
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-08-14 06:52:05 +0000
committerDavid Robillard <d@drobilla.net>2012-08-14 06:52:05 +0000
commit1b8b57121623825a4af571042ce9d365b9d55f05 (patch)
tree9339a7e34064474f46944696dc80f7f8862160fa /raul
parent2f396225fea43f673c7ec32d526b0fd29ba7e817 (diff)
downloadraul-1b8b57121623825a4af571042ce9d365b9d55f05.tar.gz
raul-1b8b57121623825a4af571042ce9d365b9d55f05.tar.bz2
raul-1b8b57121623825a4af571042ce9d365b9d55f05.zip
Remove unused ArrayStack.
git-svn-id: http://svn.drobilla.net/lad/trunk/raul@4693 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'raul')
-rw-r--r--raul/ArrayStack.hpp73
1 files changed, 0 insertions, 73 deletions
diff --git a/raul/ArrayStack.hpp b/raul/ArrayStack.hpp
deleted file mode 100644
index c62e876..0000000
--- a/raul/ArrayStack.hpp
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- This file is part of Raul.
- Copyright 2007-2012 David Robillard <http://drobilla.net>
-
- Raul is free software: you can redistribute it and/or modify it under the
- terms of the GNU General Public License as published by the Free Software
- Foundation, either version 3 of the License, or any later version.
-
- Raul is distributed in the hope that it will be useful, but WITHOUT ANY
- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
- A PARTICULAR PURPOSE. See the GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with Raul. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#ifndef RAUL_ARRAYSTACK_HPP
-#define RAUL_ARRAYSTACK_HPP
-
-#include <algorithm>
-#include <cassert>
-#include <cstddef>
-
-#include "raul/Array.hpp"
-#include "raul/Deletable.hpp"
-
-namespace Raul {
-
-/** An array that can also be used as a stack (with a fixed maximum size).
- * \ingroup raul
- */
-template <class T>
-class ArrayStack : public Array<T>
-{
-public:
- explicit ArrayStack(size_t size = 0) : Array<T>(size), _top(0) {}
-
- ArrayStack(size_t size, T initial_value) : Array<T>(size, initial_value), _top(0) {}
-
- ArrayStack(size_t size, const Array<T>& contents) : Array<T>(size, contents), _top(size + 1) {}
-
- ~Array() {
- delete[] _elems;
- }
-
- void alloc(size_t num_elems) {
- Array<T>::alloc(num_elems);
- _top = 0;
- }
-
- void alloc(size_t num_elems, T initial_value) {
- Array<T>::alloc(num_elems, initial_value);
- _top = 0;
- }
-
- void push_back(T n) {
- assert(_top < _size);
- _elems[_top++] = n;
- }
-
- inline size_t size() const { return _size; }
-
- inline T& operator[](size_t i) const { assert(i < _size); return _elems[i]; }
-
- inline T& at(size_t i) const { assert(i < _size); return _elems[i]; }
-
-private:
- size_t _top; // Index of empty element following the top element
-};
-
-} // namespace Raul
-
-#endif // RAUL_ARRAY_HPP