activemq-cpp-3.6.0
Deque.h
Go to the documentation of this file.
1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 #ifndef _DECAF_UTIL_DEQUE_H_
19 #define _DECAF_UTIL_DEQUE_H_
20 
25 #include <decaf/util/Config.h>
26 #include <decaf/util/Queue.h>
27 
28 namespace decaf {
29 namespace util {
30 
41  template<typename E>
42  class Deque : public Queue<E> {
43  public:
44 
45  virtual ~Deque() {}
46 
62  virtual void addFirst( const E& element ) = 0;
63 
79  virtual void addLast( const E& element ) = 0;
80 
96  virtual bool offerFirst( const E& element ) = 0;
97 
113  virtual bool offerLast( const E& element ) = 0;
114 
123  virtual E removeFirst() = 0;
124 
133  virtual E removeLast() = 0;
134 
143  virtual bool pollFirst( E& element ) = 0;
144 
153  virtual bool pollLast( E& element ) = 0;
154 
163  virtual E& getFirst() = 0;
164  virtual const E& getFirst() const = 0;
165 
174  virtual E& getLast() = 0;
175  virtual const E& getLast() const = 0;
176 
185  virtual bool peekFirst( E& value ) const = 0;
186 
195  virtual bool peekLast( E& value ) const = 0;
196 
209  virtual bool removeFirstOccurrence( const E& value ) = 0;
210 
223  virtual bool removeLastOccurrence( const E& value ) = 0;
224 
242  virtual void push( const E& element ) = 0;
243 
255  virtual E pop() = 0;
256 
262  virtual Iterator<E>* descendingIterator() = 0;
263  virtual Iterator<E>* descendingIterator() const = 0;
264 
265  };
266 
267 }}
268 
269 #endif /* _DECAF_UTIL_DEQUE_H_ */