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

#include <JPtrStack.h>

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

Public Member Functions

 JPtrStack (const JPtrArrayT::CleanUpAction action)
 
 ~JPtrStack () override
 
void PushCopy (const T &newElement)
 
void ClearDelete ()
 
void ClearDeleteAsArrays ()
 
void UnwindDelete (const JSize numToUnwind)
 
void UnwindDeleteAsArrays (const JSize numToUnwind)
 
JPtrArrayT::CleanUpAction GetCleanUpAction () const
 
void SetCleanUpAction (const JPtrArrayT::CleanUpAction action)
 
- Public Member Functions inherited from JStack< T *, S >
 JStack ()
 
 JStack (const JStack< T *, S > &source)
 
 ~JStack () override
 
JStack< T *, S > & operator= (const JStack< T *, S > &source)
 
void Push (const T * &newElement)
 
T * Pop ()
 
bool Pop (T * *element)
 
T * Peek () const
 
bool Peek (T * *element) const
 
T * Peek (const JIndex index) const
 
bool Peek (const JIndex index, T * *element) const
 
void Clear ()
 
void Unwind (const JSize numToUnwind)
 
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)
 

Additional Inherited Members

- Protected Member Functions inherited from JStack< T *, S >
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 JPtrStack< T, S >

Interface for JPtrStack class

Constructor & Destructor Documentation

◆ JPtrStack()

template<class T , class S >
JPtrStack< T, S >::JPtrStack ( const JPtrArrayT::CleanUpAction  action)

This class provides extra functions that are useful when storing a stack of pointers.

◆ ~JPtrStack()

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

Member Function Documentation

◆ ClearDelete()

template<class T , class S >
void JPtrStack< T, S >::ClearDelete ( )

Delete all the elements and remove them from the stack.

◆ ClearDeleteAsArrays()

template<class T , class S >
void JPtrStack< T, S >::ClearDeleteAsArrays ( )

Delete all the elements and remove them from the stack.

◆ GetCleanUpAction()

template<class T , class S >
JPtrArrayT::CleanUpAction JPtrStack< T, S >::GetCleanUpAction ( ) const
inline

What to do when the destructor is called. This is especially useful for objects allocated on the stack, because one can set the appropriate action and then never have to worry about short-circuit returns.

◆ PushCopy()

template<class T , class S >
void JPtrStack< T, S >::PushCopy ( const T &  data)

Not called Push() to avoid shadowing function in base class.

◆ SetCleanUpAction()

template<class T , class S >
void JPtrStack< T, S >::SetCleanUpAction ( const JPtrArrayT::CleanUpAction  action)
inline

◆ UnwindDelete()

template<class T , class S >
void JPtrStack< T, S >::UnwindDelete ( const JSize  numToUnwind)

Delete the top few elements and remove them from the stack.

◆ UnwindDeleteAsArrays()

template<class T , class S >
void JPtrStack< T, S >::UnwindDeleteAsArrays ( const JSize  numToUnwind)

Delete the top few elements and remove them from the stack.


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