*/
virtual void push( const T& item ) = 0;
+ /**
+ * View the item from the head of the queue.
+ *
+ * @return T next available object.
+ */
+ virtual T front() = 0;
+
/**
* Get an item from the head of the queue.
*
fifo.push( item );
}
+ /**
+ * View the item from the head of the queue.
+ *
+ * @return T next available object.
+ */
+ virtual T front() {
+ SGGuard<SGLOCK> g(mutex);
+ assert( ! fifo.empty() );
+ T item = fifo.front();
+ return item;
+ }
+
/**
* Get an item from the head of the queue.
*
not_empty.signal();
}
+ /**
+ * View the item from the head of the queue.
+ * Calling thread is not suspended
+ *
+ * @return T next available object.
+ */
+ virtual T front() {
+ SGGuard<SGMutex> g(mutex);
+
+ assert(fifo.empty() != true);
+ //if (fifo.empty()) throw ??
+
+ T item = fifo.front();
+ return item;
+ }
+
/**
* Get an item from the head of the queue.
* If no items are available then the calling thread is suspended