|
JX Application Framework
|
#include <JQueue.h>
Public Member Functions | |
| JQueue () | |
| JQueue (const JQueue< T, S > &source) | |
| ~JQueue () override | |
| JQueue< T, S > & | operator= (const JQueue< T, S > &source) |
| void | Append (const T &newElement) |
| T | GetNext () |
| bool | GetNext (T *element) |
| const T | PeekNext () const |
| bool | PeekNext (T *element) const |
| const T | PeekNext (const JIndex index) const |
| bool | PeekNext (const JIndex index, T *element) const |
| void | Flush () |
| void | Discard (const JSize numToDiscard) |
| JListIterator< T > * | NewIterator () |
| JListIterator< T > * | NewIterator () const |
Public Member Functions inherited from JContainer | |
| JContainer () | |
| JContainer (const JContainer &source) | |
| JContainer & | operator= (const JContainer &source) |
Public Member Functions inherited from JCollection | |
| JCollection () | |
| JCollection (const JCollection &source) | |
| ~JCollection () override | |
| JCollection & | operator= (const JCollection &source) |
| JSize | GetItemCount () const |
| bool | IsEmpty () const |
| bool | IndexValid (const JIndex index) const |
| JIndex | GetIndexFromEnd (const JIndex index) const |
| JString | ToString () const override |
Public Member Functions inherited from JBroadcaster | |
| JBroadcaster () | |
| virtual | ~JBroadcaster () |
| JBroadcaster & | operator= (const JBroadcaster &source) |
| bool | HasSenders () const |
| JSize | GetSenderCount () const |
| bool | HasRecipients () const |
| JSize | GetRecipientCount () const |
| template<class T > | |
| void | ListenTo (const JBroadcaster *sender, const std::function< void(const T &)> &f) |
Protected Member Functions | |
| S * | GetElements () |
Protected Member Functions inherited from JContainer | |
| void | InstallCollection (JCollection *list) |
| const JCollection * | GetList () const |
| void | Receive (JBroadcaster *sender, const Message &message) override |
Protected Member Functions inherited from JCollection | |
| void | ItemAdded () |
| void | ItemRemoved () |
| void | SetItemCount (const JSize newItemCount) |
Protected Member Functions inherited from JBroadcaster | |
| JBroadcaster (const JBroadcaster &source) | |
| void | ListenTo (const JBroadcaster *sender) |
| void | StopListening (const JBroadcaster *sender) |
| void | ClearWhenGoingAway (const JBroadcaster *sender, void *pointerToMember) |
| void | StopListening (const JBroadcaster *sender, const std::type_info &messageType) |
| template<class T > | |
| void | Send (JBroadcaster *recipient, const T &message) |
| template<class T > | |
| void | Broadcast (const T &message) |
| void | SendWithFeedback (JBroadcaster *recipient, Message *message) |
| void | BroadcastWithFeedback (Message *message) |
| virtual void | ReceiveWithFeedback (JBroadcaster *sender, Message *message) |
| virtual void | ReceiveGoingAway (JBroadcaster *sender) |
Interface for JQueue class
The Queue Class
This class manages a queue. The first template argument must be a derived class of JList. The second template argument is the data type of the stack.
Refer to JArray.tmpl for warning associated with using JArray's.
| void JQueue< T, S >::Append | ( | const T & | newElement | ) |
Add a new element to the end of the queue.
Remove the first few elements from the queue.
| void JQueue< T, S >::Flush | ( | ) |
Remove all the elements from the queue.
|
protected |
| T JQueue< T, S >::GetNext | ( | ) |
Remove the first element from the queue and return it.
| JListIterator< T > * JQueue< T, S >::NewIterator | ( | ) |
This provides an iterator for looking at all the elements in the Queue. The caller must delete the iterator.
| JListIterator< T > * JQueue< T, S >::NewIterator | ( | ) | const |
| JQueue< T, S > & JQueue< T, S >::operator= | ( | const JQueue< T, S > & | source | ) |
| const T JQueue< T, S >::PeekNext | ( | ) | const |
Return the first element in the queue without removing it.
Return the specified element in the queue without removing it.
| bool JQueue< T, S >::PeekNext | ( | const JIndex | index, |
| T * | element | ||
| ) | const |