|
| JArray (const JSize blockSize=10) |
|
| JArray (const JArray< T > &source) |
|
| JArray (JArray< T > &&dyingSource) noexcept |
|
| ~JArray () override |
|
JArray< T > & | operator= (const JArray< T > &source) |
|
| operator const T * () const |
|
const T * | GetCArray () const |
|
T * | AllocateCArray () const |
|
T | GetItem (const JIndex index) const |
|
void | SetItem (const JIndex index, const T &data) |
|
T | GetItemFromEnd (const JIndex index) const |
|
void | SetItemFromEnd (const JIndex index, const T &data) |
|
T | GetFirstItem () const override |
|
T | GetLastItem () const override |
|
void | InsertItemAtIndex (const JIndex index, const T &data) |
|
void | PrependItem (const T &data) override |
|
void | AppendItem (const T &data) override |
|
void | RemoveItem (const JIndex index) |
|
void | RemoveNextItems (const JIndex firstIndex, const JSize count) |
|
void | RemovePrevItems (const JIndex lastIndex, const JSize count) |
|
void | RemoveItems (const JIndexRange &range) |
|
void | RemoveItems (const JListT::ItemsRemoved &info) |
|
void | RemoveAll () override |
|
void | MoveItemToIndex (const JIndex currentIndex, const JIndex newIndex) |
|
void | MoveItemToIndex (const JListT::ItemMoved &info) |
|
void | SwapItems (const JIndex index1, const JIndex index2) |
|
void | SwapItems (const JListT::ItemsSwapped &info) |
|
JListIterator< T > * | NewIterator (const JListT::Position start=JListT::kStartAtBeginning, const JIndex index=0) override |
|
JListIterator< T > * | NewIterator (const JListT::Position start=JListT::kStartAtBeginning, const JIndex index=0) const override |
|
JSize | GetBlockSize () const |
|
void | SetBlockSize (const JSize newBlockSize) |
|
void | Sort () |
|
bool | InsertSorted (const T &data, const bool insertIfDuplicate=true, JIndex *index=nullptr) |
|
JIndex | GetInsertionSortIndex (const T &data, bool *isDuplicate=nullptr) const |
|
bool | SearchSorted (const T &target, const JListT::SearchReturn which, JIndex *index) const |
|
JIndex | SearchSortedOTI (const T &target, const JListT::SearchReturn which, bool *found) const |
|
void | QuickSort (int(*compare)(const void *, const void *)) |
|
const T * | begin () const |
|
const T * | end () const |
|
| JList () |
|
| JList (const JList< T > &source) |
|
| ~JList () override |
|
void | SetCompareFunction (const std::function< std::weak_ordering(const T &, const T &)> compareFn) |
|
void | CopyCompareFunction (const JList< T > &source) |
|
void | ClearCompareFunction () |
|
JListT::SortOrder | GetSortOrder () const |
|
void | SetSortOrder (const JListT::SortOrder order) |
|
bool | IsSorted () 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) |
|
template<class T>
class JArray< T >
Interface for JArray class
The JArray Template Class
Template for a dynamically sized array. The data is stored contiguously.
Since memcpy and memmove are used for large scale rearrangement of
the array items, this can -only- be used for structs.
To store objects, use the JPtrArray template class.
We do not override ToString(): Since this function is virtual, it is always instantiated. Thus, we cannot print the values, because they might not have operator<<
template<class T >
void JArray< T >::QuickSort |
( |
int(*)(const void *, const void *) |
compare | ) |
|
Calls qsort() and broadcasts JListT::Sorted afterwards.
Since qsort() wants the sort order to be encoded in the comparison function, and since the comparison function prototype is different, we do -not- use the sorting information from JList.
Do NOT use this for JPtrArrays:
Downcasting or upcasting a pointer in C++ usually requires changing its value to include or exclude parts of the object data. Casting from void* to a base class is therefore fatal because the compiler can't perform the adjustment.