1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: stack.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef CONFIGMGR_STACK_HXX_
32 #define CONFIGMGR_STACK_HXX_
34 #ifndef INCLUDED_STACK
36 #define INCLUDED_STACK
38 #ifndef INCLUDED_VECTOR
40 #define INCLUDED_VECTOR
46 // simple wrapper for a vector-based stack
47 template <typename T_
>
48 struct Stack
: public std::stack
< T_
, std::vector
<T_
> >
50 typedef typename
std::vector
<T_
>::const_iterator bottomup_iterator
;
51 typedef typename
std::vector
<T_
>::const_reverse_iterator topdown_iterator
;
52 bottomup_iterator
begin_up() const { return this->c
.begin(); }
53 bottomup_iterator
end_up() const { return this->c
.end(); }
54 topdown_iterator
begin_down() const { return this->c
.rbegin(); }
55 topdown_iterator
end_down() const { return this->c
.rend(); }
59 #endif // CONFIGMGR_STACK_HXX_