HDK
|
#include <GA_OffsetList.h>
Classes | |
class | base_iterator |
class | ListTypeData |
Public Types | |
typedef INT_TYPE | theIntType |
using | iterator = base_iterator< this_type > |
using | const_iterator = base_iterator< const this_type > |
Public Member Functions | |
SYS_FORCE_INLINE | GA_ListTypeRef () |
Default constructor. More... | |
SYS_FORCE_INLINE | GA_ListTypeRef (const GA_ListTypeRef &src)=default |
Copy constructor. More... | |
SYS_FORCE_INLINE | GA_ListTypeRef (GA_ListTypeRef &&src) noexcept=default |
Move constructor. More... | |
SYS_FORCE_INLINE | GA_ListTypeRef (ToType startvalue, GA_Size size, bool flag_set=false) |
Trivial list constructor. More... | |
SYS_FORCE_INLINE | ~GA_ListTypeRef ()=default |
Destructor. More... | |
SYS_FORCE_INLINE GA_ListTypeRef & | operator= (const GA_ListTypeRef &src)=default |
Copy assignment operator. More... | |
SYS_FORCE_INLINE GA_ListTypeRef & | operator= (GA_ListTypeRef &&src) noexcept=default |
Move assignment operator. More... | |
SYS_FORCE_INLINE void | clear () |
clear removes all of the entries More... | |
SYS_FORCE_INLINE void | setTrivial (ToType startvalue, GA_Size size) |
Makes the list a trivial list with the specified start value and size. More... | |
SYS_FORCE_INLINE void | setTrivial (ToType startvalue, GA_Size size, bool flag) |
SYS_FORCE_INLINE GA_Size | capacity () const |
Returns the allocated capacity of the list. More... | |
SYS_FORCE_INLINE FromType | entries () const |
Returns the number of used elements in the list (always <= capacity()) More... | |
SYS_FORCE_INLINE FromType | size () const |
Returns the number of used elements in the list (always <= capacity()) More... | |
SYS_FORCE_INLINE bool | isTrivial () const |
SYS_FORCE_INLINE bool | getExtraFlag () const |
Synonym for isClosed() More... | |
SYS_FORCE_INLINE bool | isClosed () const |
Synonym for getExtraFlag() More... | |
SYS_FORCE_INLINE void | setExtraFlag (bool v) |
Synonym for setClosed(bool) More... | |
SYS_FORCE_INLINE void | setClosed (bool v) |
Synonym for setExtraFlag(bool) More... | |
bool | isSame (const GA_ListTypeRef &that) const |
bool | isAscending () const |
Identifies whether the data is in ascending order. More... | |
FromType | find (ToType value, FromType s=FromType(0)) const |
FromType | findSorted (ToType value, FromType s=FromType(0)) const |
Find the target in a sorted list. More... | |
SYS_FORCE_INLINE ToType | get (FromType index) const |
Get the the value at the index. More... | |
SYS_FORCE_INLINE ToType | trivialStart () const |
Returns the start, assuming this list is trivial. More... | |
bool | isEqual (const GA_ListTypeRef &other, FromType start, FromType end) const |
Test a sub-block for equality with another list. More... | |
ToType | last () const |
Return the value of the last element. More... | |
SYS_FORCE_INLINE ToType | operator() (FromType i) const |
Convenience () operator to access the list entries. More... | |
SYS_FORCE_INLINE ToType | operator[] (FromType i) const |
FromType | findInRange (FromType start, FromType end, ToType search) const |
FromType | findInRangeNotEqual (FromType start, FromType end, ToType search) const |
FromType | findValidInRange (FromType start, FromType end) const |
FromType | findInvalidInRange (FromType start, FromType end) const |
template<typename FUNCTOR > | |
SYS_FORCE_INLINE void | forEach (FUNCTOR &&functor) const |
template<typename FUNCTOR > | |
SYS_FORCE_INLINE void | forEachReverse (FUNCTOR &&functor) const |
Like forEach() except iterates in reverse order. More... | |
SYS_FORCE_INLINE int64 | getMemoryUsage (bool inclusive) const |
Report memory usage (includes all shared memory) More... | |
SYS_FORCE_INLINE const INT_TYPE * | getArray () const |
SYS_FORCE_INLINE INT_TYPE * | getArray () |
iterator | begin () |
iterator | end () |
const_iterator | begin () const |
const_iterator | end () const |
Protected Types | |
using | this_type = GA_ListTypeRef< FromType, ToType, INT_TYPE > |
Protected Attributes | |
union { | |
ListTypeData * myData | |
struct { | |
int64 myIsTrivial:1 | |
int64 myTrivialOffset:63 | |
uint64 myIsFlagSet:1 | |
uint64 mySize:63 | |
} | |
}; | |
Static Protected Attributes | |
static const intptr_t | POINTER_MASK = ~0x1 |
static const intptr_t | TRIVIAL_MASK = 0x1 |
static const intptr_t | FLAG_MASK = 0x1 |
Friends | |
template<typename FromType2 , typename ToType2 , typename INT_TYPE2 > | |
class | GA_ListTypeRef |
template<typename FromType2 , typename ToType2 , typename INT_TYPE2 > | |
class | GA_ListType |
GA_OffsetList implements an array of GA_Offsets. Copy-on-write is used to reduce memory usage and make the copying of a GA_OffsetList an inexpensive operation.
See also: JSON Schema: GA_OffsetList
Definition at line 48 of file GA_OffsetList.h.
using GA_ListTypeRef< FromType, ToType, INT_TYPE >::const_iterator = base_iterator<const this_type> |
Definition at line 925 of file GA_OffsetList.h.
using GA_ListTypeRef< FromType, ToType, INT_TYPE >::iterator = base_iterator<this_type> |
Definition at line 924 of file GA_OffsetList.h.
typedef INT_TYPE GA_ListTypeRef< FromType, ToType, INT_TYPE >::theIntType |
Definition at line 57 of file GA_OffsetList.h.
|
protected |
Definition at line 60 of file GA_OffsetList.h.
|
inlineexplicit |
Default constructor.
Definition at line 476 of file GA_OffsetList.h.
|
default |
Copy constructor.
|
defaultnoexcept |
Move constructor.
|
inline |
Trivial list constructor.
Definition at line 524 of file GA_OffsetList.h.
|
default |
Destructor.
|
inline |
forEach()
than iterators Definition at line 929 of file GA_OffsetList.h.
|
inline |
forEach()
than iterators Definition at line 931 of file GA_OffsetList.h.
|
inline |
Returns the allocated capacity of the list.
Definition at line 616 of file GA_OffsetList.h.
|
inline |
clear removes all of the entries
Definition at line 582 of file GA_OffsetList.h.
|
inline |
forEach()
than iterators Definition at line 930 of file GA_OffsetList.h.
|
inline |
forEach()
than iterators Definition at line 932 of file GA_OffsetList.h.
|
inline |
Returns the number of used elements in the list (always <= capacity())
Definition at line 622 of file GA_OffsetList.h.
FromType GA_ListTypeRef< FromType, ToType, INT_TYPE >::find | ( | ToType | value, |
FromType | s = FromType(0) |
||
) | const |
Linearly search for the specified entry. Returns the index of first matching element found, -1 otherwise. An optional starting index can be specified in s.
|
inline |
Finds the first instance of the search pattern in the given range. Returns end if not found.
Definition at line 722 of file GA_OffsetList.h.
|
inline |
Definition at line 734 of file GA_OffsetList.h.
|
inline |
Definition at line 763 of file GA_OffsetList.h.
FromType GA_ListTypeRef< FromType, ToType, INT_TYPE >::findSorted | ( | ToType | value, |
FromType | s = FromType(0) |
||
) | const |
Find the target in a sorted list.
|
inline |
Definition at line 749 of file GA_OffsetList.h.
|
inline |
Calls a functor (e.g. a lambda) for each entry, only checking for triviality once, to reduce overhead.
Definition at line 782 of file GA_OffsetList.h.
|
inline |
Like forEach() except iterates in reverse order.
Definition at line 807 of file GA_OffsetList.h.
|
inline |
Get the the value at the index.
Definition at line 680 of file GA_OffsetList.h.
|
inline |
Definition at line 943 of file GA_OffsetList.h.
|
inline |
Definition at line 948 of file GA_OffsetList.h.
|
inline |
Synonym for isClosed()
Definition at line 642 of file GA_OffsetList.h.
|
inline |
Report memory usage (includes all shared memory)
Definition at line 937 of file GA_OffsetList.h.
bool GA_ListTypeRef< FromType, ToType, INT_TYPE >::isAscending | ( | ) | const |
Identifies whether the data is in ascending order.
|
inline |
Synonym for getExtraFlag()
Definition at line 645 of file GA_OffsetList.h.
bool GA_ListTypeRef< FromType, ToType, INT_TYPE >::isEqual | ( | const GA_ListTypeRef< FromType, ToType, INT_TYPE > & | other, |
FromType | start, | ||
FromType | end | ||
) | const |
Test a sub-block for equality with another list.
|
inline |
Returns true iff this and that are either both trivial and equal or if both are not trivial and share the same ListTypeData pointer. This does not fully check for equality!
Definition at line 656 of file GA_OffsetList.h.
|
inline |
Check whether this offset list is stored in a compact (non-allocated) form. NOTE: It must be threadsafe to call this while hardening a non-trivial list and get false as a return value. GA_IndexMap::compactIndices() may be called at the same time as GA_IndexMap::isTrivial(), and this must return false, no matter what the race.
Definition at line 638 of file GA_OffsetList.h.
|
inline |
Return the value of the last element.
Definition at line 705 of file GA_OffsetList.h.
|
inline |
Convenience () operator to access the list entries.
Definition at line 715 of file GA_OffsetList.h.
|
default |
Copy assignment operator.
|
defaultnoexcept |
Move assignment operator.
|
inline |
Definition at line 718 of file GA_OffsetList.h.
|
inline |
Synonym for setExtraFlag(bool)
Definition at line 651 of file GA_OffsetList.h.
|
inline |
Synonym for setClosed(bool)
Definition at line 648 of file GA_OffsetList.h.
|
inline |
Makes the list a trivial list with the specified start value and size.
Definition at line 594 of file GA_OffsetList.h.
|
inline |
Makes the list a trivial list with the specified start value and size, and also sets the extra flag.
Definition at line 605 of file GA_OffsetList.h.
|
inline |
Returns the number of used elements in the list (always <= capacity())
Definition at line 626 of file GA_OffsetList.h.
|
inline |
Returns the start, assuming this list is trivial.
Definition at line 692 of file GA_OffsetList.h.
|
friend |
Definition at line 55 of file GA_OffsetList.h.
|
friend |
Definition at line 53 of file GA_OffsetList.h.
union { ... } |
|
staticprotected |
Definition at line 956 of file GA_OffsetList.h.
ListTypeData* GA_ListTypeRef< FromType, ToType, INT_TYPE >::myData |
Definition at line 961 of file GA_OffsetList.h.
uint64 GA_ListTypeRef< FromType, ToType, INT_TYPE >::myIsFlagSet |
Definition at line 973 of file GA_OffsetList.h.
int64 GA_ListTypeRef< FromType, ToType, INT_TYPE >::myIsTrivial |
Definition at line 966 of file GA_OffsetList.h.
uint64 GA_ListTypeRef< FromType, ToType, INT_TYPE >::mySize |
Definition at line 974 of file GA_OffsetList.h.
int64 GA_ListTypeRef< FromType, ToType, INT_TYPE >::myTrivialOffset |
Definition at line 967 of file GA_OffsetList.h.
|
staticprotected |
Definition at line 954 of file GA_OffsetList.h.
|
staticprotected |
Definition at line 955 of file GA_OffsetList.h.