fdo#74697 Add Bluez 5 support for impress remote.
[LibreOffice.git] / autodoc / source / inc / estack.hxx
blobae260f10410a2fac4b1548c6fe9f2780f4365fe3
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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
25 // USED SERVICES
26 // BASE CLASSES
27 #include <list>
28 // COMPONENTS
29 // PARAMETERS
33 template <class ELEM>
34 class EStack : private std::list<ELEM>
36 private:
37 typedef std::list<ELEM> base;
38 const base & Base() const { return *this; }
39 base & Base() { return *this; }
41 public:
42 typedef ELEM value_type;
43 typedef typename std::list<ELEM>::size_type size_type;
45 // LIFECYCLE
46 EStack() {}
47 EStack(
48 const EStack & i_rStack )
49 : base( (const base &)(i_rStack) ) {}
50 ~EStack() {}
51 // OPERATORS
52 EStack & operator=(
53 const EStack & i_rStack )
54 { base::operator=( i_rStack.Base() );
55 return *this; }
56 bool operator==(
57 const EStack<ELEM> & ) const
58 { return std::operator==( Base(), this->i_rStack.Base() ); }
59 bool operator<(
60 const EStack<ELEM> & ) const
61 { return std::operator<( Base(), this->i_rStack.Base() ); }
62 // OPERATIONS
63 void push(
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(); }
69 // INQUIRY
70 const value_type & top() const { return base::front(); }
71 size_type size() const { return base::size(); }
72 bool empty() const { return base::empty(); }
74 // ACCESS
75 value_type & top() { return base::front(); }
80 // IMPLEMENTATION
83 #endif
85 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */