HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GA_OffsetListType< FromType, INT_TYPE > Class Template Reference

#include <GA_OffsetList.h>

+ Inheritance diagram for GA_OffsetListType< FromType, INT_TYPE >:

Public Types

typedef INT_TYPE theIntType
 
- Public Types inherited from GA_ListType< FromType, GA_Offset, INT_TYPE >
typedef INT_TYPE theIntType
 
- Public Types inherited from GA_ListTypeRef< FromType, GA_Offset, INT_TYPE >
typedef INT_TYPE theIntType
 
using iterator = base_iterator< this_type >
 
using const_iterator = base_iterator< const this_type >
 

Public Member Functions

 GA_OffsetListType ()
 
 GA_OffsetListType (const GA_OffsetListType &src)
 
 GA_OffsetListType (const GA_ListTypeRef< FromType, GA_Offset, INT_TYPE > &src)
 
 GA_OffsetListType (const UT_Array< GA_Offset > &src, FromType start=FromType(0), FromType end=FromType(-1))
 
SYS_FORCE_INLINE
GA_OffsetListType
operator= (const GA_OffsetListType &src)=default
 Copy assignment operator. More...
 
SYS_FORCE_INLINE
GA_OffsetListType
operator= (const GA_ListTypeRef< FromType, GA_Offset, INT_TYPE > &src)
 
bool jsonPointArray (UT_JSONWriter &w, const GA_SaveMap &save) const
 Save the offsets by doing the mapping to the points in the save map. More...
 
bool jsonVertexArray (UT_JSONWriter &w, const GA_SaveMap &save) const
 Save the offsets by doing the mapping to the vertices in the save map. More...
 
bool jsonPrimitiveArray (UT_JSONWriter &w, const GA_SaveMap &save) const
 Save the offsets by doing the mapping to the primitives in the save map. More...
 
bool jsonPointArray (UT_JSONParser &p, const GA_LoadMap &load)
 Load a point list from a JSON stream. More...
 
bool jsonVertexArray (UT_JSONParser &p, const GA_LoadMap &load)
 Load a vertex list from a JSON stream. More...
 
bool jsonPrimitiveArray (UT_JSONParser &p, const GA_LoadMap &load)
 Load a primitive list from a JSON stream. More...
 
bool jsonLoad (UT_JSONParser &p, GA_Offset load_offset)
 Generic load given a load offset. More...
 
bool jsonLoadAppend (UT_JSONParser &p, GA_Offset load_offset)
 Load, appending to the current offset list without initial clear. More...
 
bool jsonLoadByIndex (UT_JSONParser &p, const GA_IndexMap &index_map, GA_Index load_offset)
 
bool jsonLoadAppendByIndex (UT_JSONParser &p, const GA_IndexMap &index_map, GA_Index load_offset)
 
SYS_FORCE_INLINE GA_OffsetListType (GA_OffsetListType &&src)=default
 
SYS_FORCE_INLINE
GA_OffsetListType
operator= (GA_OffsetListType &&src)=default
 
GA_Size swapOffsetValues (const GA_Defragment &defrag)
 
- Public Member Functions inherited from GA_ListType< FromType, GA_Offset, INT_TYPE >
SYS_FORCE_INLINE GA_ListType ()
 Default constructor. More...
 
SYS_FORCE_INLINE GA_ListType (const GA_ListType &src)
 Copy constructor. More...
 
SYS_FORCE_INLINE GA_ListType (GA_ListType &&src) noexcept
 Move constructor. More...
 
SYS_FORCE_INLINE GA_ListType (const Base &src)
 
SYS_FORCE_INLINE GA_ListType (GA_Offsetstartvalue, GA_Size size, bool flag_set=false)
 Trivial list constructor. More...
 
 GA_ListType (const UT_Array< GA_Offset > &src, FromType start=FromType(0), FromType end=FromType(-1))
 
SYS_FORCE_INLINE ~GA_ListType ()
 Destructor. More...
 
SYS_FORCE_INLINE GA_ListTypeoperator= (const GA_ListType &src)
 Copy assignment operator. More...
 
SYS_FORCE_INLINE GA_ListTypeoperator= (GA_ListType &&src) noexcept
 Move assignment operator. More...
 
SYS_FORCE_INLINE GA_ListTypeoperator= (const Base &src)
 
void countMemory (UT_MemoryCounter &counter, bool inclusive) const
 
SYS_FORCE_INLINE void clear ()
 clear removes all of the entries More...
 
void computeTrivial ()
 
void setTrivial (GA_Offsetstartvalue, GA_Size size)
 Makes the list a trivial list with the specified start value and size. More...
 
void setTrivial (GA_Offsetstartvalue, GA_Size size, bool flag)
 
void setEntries (FromType sz, bool doresize=true)
 
void reserve (FromType mincapacity)
 
void changeSize (FromType new_capacity)
 
FromType append (GA_Offsetvalue)
 Add a single entry (may grow array) More...
 
void append (const GA_ListTypeRef< FromType, GA_Offset, INT_TYPE > &src)
 
FromType insert (FromType i, GA_Offsetvalue)
 Insert a single entry (may grow array) More...
 
FromType multipleInsert (FromType i, GA_Size count)
 
FromType remove (FromType i)
 Remove the entry at the given offset. More...
 
FromType findAndRemove (GA_Offseti)
 Find an entry and remove it from the list. More...
 
FromType removeIndex (FromType i)
 Alias for remove to match UT array types. More...
 
GA_Size removeAll (GA_Offseti)
 Remove all matching entries from the list. More...
 
void removeLast ()
 Remove the last entry. More...
 
void sortAscending ()
 Sort entries into ascending order. More...
 
void sortAndRemoveDuplicates ()
 Sort entries into ascending order and remove duplicates. More...
 
void set (FromType index, GA_Offsetvalue)
 Set the index to the value. More...
 
void set (const S *data, exint size, GA_Offsetoffset)
 
void copyAdd (FromType destindex, const int *values, GA_Size srcindex, GA_Size n, GA_Offsetoffset)
 
void copyAdd (FromType destindex, const GA_ListTypeRef< FromType, GA_Offset > &values, FromType srcindex, GA_Size n, GA_Offsetoffset)
 
void setTrivialRange (FromType startindex, GA_Offsetstartvalue, GA_Size nelements)
 
void constant (GA_Offsetvalue)
 Set all entries to a constant value. More...
 
void cycle (GA_Size how_many)
 Cyclically shift the entire array by how_many. More...
 
void reverse ()
 Reverse the entire array. More...
 
void harden ()
 
void harden (exint mincapacity)
 
void incDataRef ()
 
- Public Member Functions inherited from GA_ListTypeRef< FromType, GA_Offset, INT_TYPE >
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 (GA_Offsetstartvalue, GA_Size size, bool flag_set=false)
 Trivial list constructor. More...
 
SYS_FORCE_INLINE ~GA_ListTypeRef ()=default
 Destructor. More...
 
SYS_FORCE_INLINE GA_ListTypeRefoperator= (const GA_ListTypeRef &src)=default
 Copy assignment operator. More...
 
SYS_FORCE_INLINE GA_ListTypeRefoperator= (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 (GA_Offsetstartvalue, GA_Size size)
 Makes the list a trivial list with the specified start value and size. More...
 
SYS_FORCE_INLINE void setTrivial (GA_Offsetstartvalue, 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 (GA_Offsetvalue, FromType s=FromType(0)) const
 
FromType findSorted (GA_Offsetvalue, FromType s=FromType(0)) const
 Find the target in a sorted list. More...
 
SYS_FORCE_INLINE GA_Offset get (FromType index) const
 Get the the value at the index. More...
 
SYS_FORCE_INLINE GA_Offset 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...
 
GA_Offset last () const
 Return the value of the last element. More...
 
SYS_FORCE_INLINE GA_Offset operator() (FromType i) const
 Convenience () operator to access the list entries. More...
 
SYS_FORCE_INLINE GA_Offset operator[] (FromType i) const
 
FromType findInRange (FromType start, FromType end, GA_Offsetsearch) const
 
FromType findInRangeNotEqual (FromType start, FromType end, GA_Offsetsearch) const
 
FromType findValidInRange (FromType start, FromType end) const
 
FromType findInvalidInRange (FromType start, FromType end) const
 
SYS_FORCE_INLINE void forEach (FUNCTOR &&functor) const
 
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 ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 

Additional Inherited Members

- Public Attributes inherited from GA_ListTypeRef< FromType, GA_Offset, INT_TYPE >
ListTypeData * myData
 
int64 myIsTrivial
 
int64 myTrivialOffset
 
uint64 myIsFlagSet
 
uint64 mySize
 
- Protected Types inherited from GA_ListType< FromType, GA_Offset, INT_TYPE >
using ListTypeData = typename Base::ListTypeData
 
- Protected Types inherited from GA_ListTypeRef< FromType, GA_Offset, INT_TYPE >
using this_type = GA_ListTypeRef< FromType, GA_Offset, INT_TYPE >
 
- Protected Attributes inherited from GA_ListTypeRef< FromType, GA_Offset, INT_TYPE >
union {
   ListTypeData *   myData
 
   struct {
      int64   myIsTrivial:1
 
      int64   myTrivialOffset:63
 
      uint64   myIsFlagSet:1
 
      uint64   mySize:63
 
   } 
 
}; 
 
- Static Protected Attributes inherited from GA_ListTypeRef< FromType, GA_Offset, INT_TYPE >
static const intptr_t POINTER_MASK
 
static const intptr_t TRIVIAL_MASK
 
static const intptr_t FLAG_MASK
 

Detailed Description

template<typename FromType, typename INT_TYPE = exint>
class GA_OffsetListType< FromType, INT_TYPE >

Definition at line 1580 of file GA_OffsetList.h.

Member Typedef Documentation

template<typename FromType, typename INT_TYPE = exint>
typedef INT_TYPE GA_ListTypeRef< FromType, ToType, INT_TYPE >::theIntType

Definition at line 57 of file GA_OffsetList.h.

Constructor & Destructor Documentation

template<typename FromType, typename INT_TYPE = exint>
GA_OffsetListType< FromType, INT_TYPE >::GA_OffsetListType ( )
inlineexplicit

Definition at line 1599 of file GA_OffsetList.h.

template<typename FromType, typename INT_TYPE = exint>
GA_OffsetListType< FromType, INT_TYPE >::GA_OffsetListType ( const GA_OffsetListType< FromType, INT_TYPE > &  src)
inline

Definition at line 1601 of file GA_OffsetList.h.

template<typename FromType, typename INT_TYPE = exint>
GA_OffsetListType< FromType, INT_TYPE >::GA_OffsetListType ( const GA_ListTypeRef< FromType, GA_Offset, INT_TYPE > &  src)
inlineexplicit

Definition at line 1603 of file GA_OffsetList.h.

template<typename FromType, typename INT_TYPE = exint>
GA_OffsetListType< FromType, INT_TYPE >::GA_OffsetListType ( const UT_Array< GA_Offset > &  src,
FromType  start = FromType(0),
FromType  end = FromType(-1) 
)
inline

Definition at line 1608 of file GA_OffsetList.h.

template<typename FromType, typename INT_TYPE = exint>
SYS_FORCE_INLINE GA_OffsetListType< FromType, INT_TYPE >::GA_OffsetListType ( GA_OffsetListType< FromType, INT_TYPE > &&  src)
default

Move operator

Member Function Documentation

template<typename FromType, typename INT_TYPE = exint>
bool GA_OffsetListType< FromType, INT_TYPE >::jsonLoad ( UT_JSONParser p,
GA_Offset  load_offset 
)

Generic load given a load offset.

template<typename FromType, typename INT_TYPE = exint>
bool GA_OffsetListType< FromType, INT_TYPE >::jsonLoadAppend ( UT_JSONParser p,
GA_Offset  load_offset 
)

Load, appending to the current offset list without initial clear.

template<typename FromType, typename INT_TYPE = exint>
bool GA_OffsetListType< FromType, INT_TYPE >::jsonLoadAppendByIndex ( UT_JSONParser p,
const GA_IndexMap index_map,
GA_Index  load_offset 
)

Load from a JSON stream saved by index, mapping the ordered index to an offset and appending to the current offset list without an initial clear.

template<typename FromType, typename INT_TYPE = exint>
bool GA_OffsetListType< FromType, INT_TYPE >::jsonLoadByIndex ( UT_JSONParser p,
const GA_IndexMap index_map,
GA_Index  load_offset 
)

Generic load from a JSON stream saved by index that maps the ordered index to an offset.

template<typename FromType, typename INT_TYPE = exint>
bool GA_OffsetListType< FromType, INT_TYPE >::jsonPointArray ( UT_JSONWriter w,
const GA_SaveMap save 
) const

Save the offsets by doing the mapping to the points in the save map.

JSON Schema: GA_OffsetList

{
"name" : "GA_OffsetList",
"description" : "An array of offsets/indicies",
"type" : "array",
"items" : "integer",
}
See Also
JSON_FileFormat
template<typename FromType, typename INT_TYPE = exint>
bool GA_OffsetListType< FromType, INT_TYPE >::jsonPointArray ( UT_JSONParser p,
const GA_LoadMap load 
)

Load a point list from a JSON stream.

template<typename FromType, typename INT_TYPE = exint>
bool GA_OffsetListType< FromType, INT_TYPE >::jsonPrimitiveArray ( UT_JSONWriter w,
const GA_SaveMap save 
) const

Save the offsets by doing the mapping to the primitives in the save map.

template<typename FromType, typename INT_TYPE = exint>
bool GA_OffsetListType< FromType, INT_TYPE >::jsonPrimitiveArray ( UT_JSONParser p,
const GA_LoadMap load 
)

Load a primitive list from a JSON stream.

template<typename FromType, typename INT_TYPE = exint>
bool GA_OffsetListType< FromType, INT_TYPE >::jsonVertexArray ( UT_JSONWriter w,
const GA_SaveMap save 
) const

Save the offsets by doing the mapping to the vertices in the save map.

template<typename FromType, typename INT_TYPE = exint>
bool GA_OffsetListType< FromType, INT_TYPE >::jsonVertexArray ( UT_JSONParser p,
const GA_LoadMap load 
)

Load a vertex list from a JSON stream.

template<typename FromType, typename INT_TYPE = exint>
SYS_FORCE_INLINE GA_OffsetListType& GA_OffsetListType< FromType, INT_TYPE >::operator= ( const GA_OffsetListType< FromType, INT_TYPE > &  src)
default

Copy assignment operator.

template<typename FromType, typename INT_TYPE = exint>
SYS_FORCE_INLINE GA_OffsetListType& GA_OffsetListType< FromType, INT_TYPE >::operator= ( GA_OffsetListType< FromType, INT_TYPE > &&  src)
default

Move operator

template<typename FromType, typename INT_TYPE = exint>
SYS_FORCE_INLINE GA_OffsetListType& GA_OffsetListType< FromType, INT_TYPE >::operator= ( const GA_ListTypeRef< FromType, GA_Offset, INT_TYPE > &  src)
inline

Copy assignment operator from GA_ListTypeRef. Although it may seem strange to have this at all, it should be safe, since the destination does take (shared) ownership of any non-trivial data. There should be a GA_OffsetListType somewhere else that already owns this.

Definition at line 1629 of file GA_OffsetList.h.

template<typename FromType, typename INT_TYPE = exint>
GA_Size GA_OffsetListType< FromType, INT_TYPE >::swapOffsetValues ( const GA_Defragment defrag)

Swap offset values for defragmentation process. When defragmenting, offsets will move. This method will update all references to offsets to their new values. This returns the number of values updated.


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