JX Application Framework
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
JQueue< T, S > Class Template Reference

#include <JQueue.h>

Inheritance diagram for JQueue< T, S >:
[legend]

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)
 
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)
 
JContaineroperator= (const JContainer &source)
 
- Public Member Functions inherited from JCollection
 JCollection ()
 
 JCollection (const JCollection &source)
 
 ~JCollection () override
 
JCollectionoperator= (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 ()
 
JBroadcasteroperator= (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 JCollectionGetList () 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)
 

Detailed Description

template<class T, class S>
class JQueue< T, S >

Interface for JQueue class

Constructor & Destructor Documentation

◆ JQueue() [1/2]

template<class T , class S >
JQueue< T, S >::JQueue ( )
                        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.

◆ JQueue() [2/2]

template<class T , class S >
JQueue< T, S >::JQueue ( const JQueue< T, S > &  source)

◆ ~JQueue()

template<class T , class S >
JQueue< T, S >::~JQueue ( )
override

Member Function Documentation

◆ Append()

template<class T , class S >
void JQueue< T, S >::Append ( const T &  newElement)

Add a new element to the end of the queue.

◆ Discard()

template<class T , class S >
void JQueue< T, S >::Discard ( const JSize  numToDiscard)

Remove the first few elements from the queue.

◆ Flush()

template<class T , class S >
void JQueue< T, S >::Flush ( )

Remove all the elements from the queue.

◆ GetElements()

template<class T , class S >
S * JQueue< T, S >::GetElements ( )
protected

◆ GetNext() [1/2]

template<class T , class S >
T JQueue< T, S >::GetNext ( )

Remove the first element from the queue and return it.

◆ GetNext() [2/2]

template<class T , class S >
bool JQueue< T, S >::GetNext ( T *  element)

◆ NewIterator() [1/2]

template<class T , class S >
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.

◆ NewIterator() [2/2]

template<class T , class S >
JListIterator< T > * JQueue< T, S >::NewIterator ( ) const

◆ operator=()

template<class T , class S >
JQueue< T, S > & JQueue< T, S >::operator= ( const JQueue< T, S > &  source)

◆ PeekNext() [1/4]

template<class T , class S >
const T JQueue< T, S >::PeekNext ( ) const

Return the first element in the queue without removing it.

◆ PeekNext() [2/4]

template<class T , class S >
const T JQueue< T, S >::PeekNext ( const JIndex  index) const

Return the specified element in the queue without removing it.

◆ PeekNext() [3/4]

template<class T , class S >
bool JQueue< T, S >::PeekNext ( const JIndex  index,
T *  element 
) const

◆ PeekNext() [4/4]

template<class T , class S >
bool JQueue< T, S >::PeekNext ( T *  element) const

The documentation for this class was generated from the following files: