Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
include
osl
hash
hashKeyStack.h
Go to the documentation of this file.
1
/* hashKeyStack.h
2
*/
3
#ifndef HASH_HASHKEYSTACK_H
4
#define HASH_HASHKEYSTACK_H
5
#include "
osl/hash/hashKey.h
"
6
#include "
osl/stl/vector.h
"
7
namespace
osl
8
{
9
namespace
hash
10
{
11
class
HashKeyStack
12
{
13
typedef
vector<HashKey>
vector_t
;
14
vector_t
data
;
15
public
:
16
explicit
HashKeyStack
(
size_t
capacity=0);
17
~HashKeyStack
();
18
19
void
push
(
const
HashKey
&);
20
void
pop
() { assert(!
data
.empty());
data
.pop_back(); }
21
void
clear
() {
data
.clear(); }
22
23
const
HashKey
&
top
(
size_t
n=0)
const
24
{
25
assert(n <
size
());
26
vector_t::const_reverse_iterator p=
data
.rbegin()+n;
27
return
*p;
28
}
29
bool
empty
()
const
{
return
data
.empty(); }
30
size_t
size
()
const
{
return
data
.size(); }
31
32
void
dump
()
const
;
33
34
friend
bool
operator==
(
const
HashKeyStack
&,
const
HashKeyStack
&);
35
};
36
}
// namespace hash
37
using
hash::HashKeyStack;
38
}
// namespace osl
39
40
#endif
/* HASH_HASHKEYSTACK_H */
41
// ;;; Local Variables:
42
// ;;; mode:c++
43
// ;;; c-basic-offset:2
44
// ;;; End:
Generated on Sun Jul 21 2013 13:37:24 by
1.8.4