hashKeyStack.h
Go to the documentation of this file.
/* hashKeyStack.h
*/
#ifndef HASH_HASHKEYSTACK_H
#define HASH_HASHKEYSTACK_H
#include "osl/hashKey.h"
#include <vector>
namespace osl
{
namespace hash
{
class HashKeyStack
{
typedef std::vector<HashKey> vector_t;
vector_t data;
public:
explicit HashKeyStack(size_t capacity=0);
~HashKeyStack();
void push(const HashKey&);
void pop() { assert(! data.empty()); data.pop_back(); }
void clear() { data.clear(); }
const HashKey& top(size_t n=0) const
{
assert(n < size());
vector_t::const_reverse_iterator p=data.rbegin()+n;
return *p;
}
bool empty() const { return data.empty(); }
size_t size() const { return data.size(); }
void dump() const;
friend bool operator==(const HashKeyStack&, const HashKeyStack&);
};
} // namespace hash
using hash::HashKeyStack;
} // namespace osl
#endif /* HASH_HASHKEYSTACK_H */
// ;;; Local Variables:
// ;;; mode:c++
// ;;; c-basic-offset:2
// ;;; End:
osl::hash::HashKeyStack
Definition hashKeyStack.h:12
osl::hash::HashKeyStack::data
vector_t data
Definition hashKeyStack.h:14
osl::hash::HashKeyStack::dump
void dump() const
Definition hashKeyStack.cc:24
osl::hash::HashKeyStack::size
size_t size() const
Definition hashKeyStack.h:30
osl::hash::HashKeyStack::operator==
friend bool operator==(const HashKeyStack &, const HashKeyStack &)
Definition hashKeyStack.cc:36
osl::hash::HashKeyStack::empty
bool empty() const
Definition hashKeyStack.h:29
osl::hash::HashKeyStack::vector_t
std::vector< HashKey > vector_t
Definition hashKeyStack.h:13
osl::hash::HashKeyStack::clear
void clear()
Definition hashKeyStack.h:21
osl::hash::HashKeyStack::pop
void pop()
Definition hashKeyStack.h:20
osl::hash::HashKeyStack::push
void push(const HashKey &)
Definition hashKeyStack.cc:18
osl::hash::HashKeyStack::~HashKeyStack
~HashKeyStack()
Definition hashKeyStack.cc:13
osl::hash::HashKeyStack::top
const HashKey & top(size_t n=0) const
Definition hashKeyStack.h:23
osl::hash::HashKeyStack::HashKeyStack
HashKeyStack(size_t capacity=0)
Definition hashKeyStack.cc:7
osl::hash::HashKey
Definition hashKey.h:153
hashKey.h
osl::hash
Definition hashKey.h:14
osl
Definition additionalEffect.h:6