libUTL++
Queue.h
1 #pragma once
2 
4 
5 #include <libutl/Deque.h>
6 
8 
9 UTL_NS_BEGIN;
10 
12 
21 
23 template <class T = Object>
24 class Queue : public TDeque<T>
25 {
28 
29 public:
34  Queue(bool owner)
35  : TDeque<T>(owner)
36  {
37  }
38 
40  T*
41  deQ()
42  {
43  return utl::cast<T>(Deque::popFront());
44  }
45 
52  bool
53  enQ(const T& object)
54  {
55  return Deque::pushBack(const_cast<T&>(object));
56  }
57 
62  bool
63  enQ(const T* object)
64  {
65  return Deque::pushBack(const_cast<T*>(object));
66  }
67 };
68 
70 
71 UTL_NS_END;
72 
74 
#define UTL_CLASS_IMPL_TPL(className, T)
Implementation of standard UTL++ functionality for a template class.
Definition: macros.h:906
#define UTL_CLASS_DEFID
Default init() and deInit() (which are merely place-holders).
Definition: macros.h:532
bool enQ(const T *object)
Add the given object to the end of the queue.
Definition: Queue.h:63
FIFO (first-in, first-out) data structure.
Definition: Queue.h:24
Template version of Deque.
Definition: TDeque.h:25
T * deQ()
Return the object at the head of the queue.
Definition: Queue.h:41
#define UTL_CLASS_DECL_TPL(DC, T, BC)
Declaration of standard UTL++ functionality for a template class with one parameter.
Definition: macros.h:713
Queue(bool owner)
Constructor.
Definition: Queue.h:34
bool enQ(const T &object)
Add the given object to the end of the queue.
Definition: Queue.h:53