#include <JAliasArray.h>
|
| JAliasArray (JArray< T > *data, const std::function< std::weak_ordering(const T &, const T &)> compareFn, const JListT::SortOrder order) |
|
| ~JAliasArray () override |
|
JArray< T > * | GetData () |
|
const JArray< T > & | GetData () const |
|
JIndex | GetItemIndex (const JIndex index) const |
|
JIndex | GetItemIndexFromEnd (const JIndex index) const |
|
const T | GetItem (const JIndex index) const |
|
void | SetItem (const JIndex index, const T &data) |
|
const T | GetFirstItem () const |
|
const T | GetLastItem () const |
|
const T | GetItemFromEnd (const JIndex index) const |
|
void | SetItemFromEnd (const JIndex index, const T &data) |
|
void | SetCompareFunction (const std::function< std::weak_ordering(const T &, const T &)> compareFn) |
|
JListT::SortOrder | GetSortOrder () const |
|
void | SetSortOrder (const JListT::SortOrder order) |
|
bool | SearchSorted (const T &target, const JListT::SearchReturn which, JIndex *index) const |
|
JIndex | SearchSortedOTI (const T &target, const JListT::SearchReturn which, bool *found) const |
|
| 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 |
|
| 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) |
|
◆ JAliasArray()
Template for an array of indices into a JArray. The indices are sorted by applying a comparison function to the data in the JArray. This allows you to sort a list in more than one way without having to duplicate the data itself.
We are obviously dead in the water if itsData is deleted. Rather than making a mess of the interface and returning bool everywhere, we instead require that the JAliasArray be tossed when the data goes away. By blowing up in any member function instead of blowing up in ReceiveGoingAway(), we allow the data to be deleted before the JAliasArray.
◆ ~JAliasArray()
◆ GetData() [1/2]
◆ GetData() [2/2]
◆ GetFirstItem()
◆ GetItem()
◆ GetItemFromEnd()
◆ GetItemIndex()
Returns the index into the data.
◆ GetItemIndexFromEnd()
◆ GetLastItem()
◆ GetSortOrder()
◆ Receive()
Process the given message from the given sender. This function is not pure virtual because not all classes will want to implement it.
Reimplemented from JBroadcaster.
◆ ReceiveGoingAway()
The given sender has been deleted.
Warning: Since this function may be called from within a -chain- of destructors, it is not usually safe to do anything inside this function other than directly changing instance variables (e.g. setting pointers to nullptr).
This function is not pure virtual because not all classes will want to implement it.
Reimplemented from JBroadcaster.
◆ SearchSorted()
Returns true if the specified target is found.
"which" specifies what to return if more than one item matches the given target.
◆ SearchSortedOTI()
Returns index where the item is or where it should be inserted in order to keep the list sorted. If there is an item that matches the given one, *found is set to true.
"which" specifies what to return if more than one item matches the given target.
◆ SetCompareFunction()
template<class T >
void JAliasArray< T >::SetCompareFunction |
( |
const std::function< std::weak_ordering(const T &, const T &)> |
compareFn | ) |
|
◆ SetItem()
◆ SetItemFromEnd()
◆ SetSortOrder()
The documentation for this class was generated from the following files: