1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
29 #ifndef ARY_ESTACK_HXX
30 #define ARY_ESTACK_HXX
43 class EStack
: private std::list
<ELEM
>
46 typedef std::list
<ELEM
> base
;
47 const base
& Base() const { return *this; }
48 base
& Base() { return *this; }
51 typedef ELEM value_type
;
52 typedef typename
std::list
<ELEM
>::size_type size_type
;
57 const EStack
& i_rStack
)
58 : base( (const base
&)(i_rStack
) ) {}
62 const EStack
& i_rStack
)
63 { base::operator=( i_rStack
.Base() );
66 const EStack
<ELEM
> & ) const
67 { return std::operator==( Base(), this->i_rStack
.Base() ); }
69 const EStack
<ELEM
> & ) const
70 { return std::operator<( Base(), this->i_rStack
.Base() ); }
73 const value_type
& i_rElem
)
74 { base::push_front(i_rElem
); }
75 void pop() { base::pop_front(); }
76 void erase_all() { while (NOT
empty()) pop(); }
79 const value_type
& top() const { return base::front(); }
80 size_type
size() const { return base::size(); }
81 bool empty() const { return base::empty(); }
84 value_type
& top() { return base::front(); }
94 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */