1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef ARY_ESTACK_HXX
21 #define ARY_ESTACK_HXX
34 class EStack
: private std::list
<ELEM
>
37 typedef std::list
<ELEM
> base
;
38 const base
& Base() const { return *this; }
39 base
& Base() { return *this; }
42 typedef ELEM value_type
;
43 typedef typename
std::list
<ELEM
>::size_type size_type
;
48 const EStack
& i_rStack
)
49 : base( (const base
&)(i_rStack
) ) {}
53 const EStack
& i_rStack
)
54 { base::operator=( i_rStack
.Base() );
57 const EStack
<ELEM
> & ) const
58 { return std::operator==( Base(), this->i_rStack
.Base() ); }
60 const EStack
<ELEM
> & ) const
61 { return std::operator<( Base(), this->i_rStack
.Base() ); }
64 const value_type
& i_rElem
)
65 { base::push_front(i_rElem
); }
66 void pop() { base::pop_front(); }
67 void erase_all() { while (NOT
empty()) pop(); }
70 const value_type
& top() const { return base::front(); }
71 size_type
size() const { return base::size(); }
72 bool empty() const { return base::empty(); }
75 value_type
& top() { return base::front(); }
85 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */