Data Structures

Detailed Description

Classes

class  ArrayMapHelper< K, V, SORTED, COMPARE, ARRAY >
 
class  ArrayMapHelper< K, V, true, COMPARE, ARRAY >
 
class  ArrayMap< K, V, SORTED, COMPARE, ARRAY >
 
class  ArrayMapSelector< SORTED, COMPARE, ARRAY >
 
class  ArraySet< T, SORTED, COMPARE, ARRAY >
 
class  BaseArray< T, MINCHUNKSIZE, MEMFLAGS, ALLOCATOR >
 
struct  GenericCastMemberTrait< BaseArray< TO >, BaseArray< FROM >, SAFE >
 
class  BaseArraySelector< MINCHUNKSIZE, MEMFLAGS, ALLOCATOR >
 
class  BufferedBaseArraySelector< COUNT, MINCHUNKSIZE, MEMFLAGS, ALLOCATOR >
 
struct  IsZeroInitialized< BaseArray< T, MINCHUNKSIZE, MEMFLAGS, ALLOCATOR > >
 
class  BaseBitSet< ALLOCATOR >
 
struct  BaseListLinkPOD
 
class  BaseListLink< NODE >
 
class  BaseListNodeBase< NODE >
 
class  BaseListNode< T, hasCopyFrom >
 
class  BaseListNode< T, false >
 
class  BaseListNode< T, true >
 
class  BaseListNode< EmptyClass, false >
 
class  BaseListHead< T, NODE >
 
class  BaseList< T, NODE, HEAD, ALLOCATOR >
 
class  BaseListLegacyNode< T >
 
class  WeakRef< REFERENCE >
 
class  BaseRef< T, HANDLER >
 
class  PointerHandler
 
class  DeepConstnessPointerHandler
 
class  StrongRefHandler
 
class  StrongCOWRefHandler
 
class  StrongACOWRefHandler
 
class  UniqueRefHandler
 
struct  RawMem< T >
 
class  BaseRef< RawMem< T >, H >
 
class  BlockBase< T, STRIDED >
 
class  BlockBase< T, false >
 
class  BaseIterator< COLLECTION, STRIDED >
 
class  BaseIterator< COLLECTION, true >
 
class  Block< T, STRIDED, MOVE >
 
struct  CArray< T, N >
 
class  BlockArray< T, BLOCK_SIZE_EXPONENT, MEMFLAGS, ALLOCATOR >
 
class  BlockArraySelector< BLOCK_SIZE_EXPONENT, MEMFLAGS, ALLOCATOR >
 
class  PointerBurstTriePool< NODE, BUCKET >
 
class  ElementPool< T, INDEX >
 
class  ArrayBurstTriePool< NODE, BUCKET >
 
struct  BurstTrieNode< GROUP_BITS, INDEX >
 
struct  BurstTrieBucket< K, V, SIZE >
 
struct  BurstTrieBucket< K, UnitType, SIZE >
 
class  BurstTrieMap< K, V, GROUP_BITS, BUCKET_SIZE, SORT, POOL >
 
class  BurstTrieMapSelector< GROUP_BITS, BUCKET_SIZE, SORT, POOL >
 
class  BurstTrieSet< T, GROUP_BITS, BUCKET_SIZE, SORT, POOL >
 
class  PrivateGetMapKeyHelper
 
class  PrivateGetMapKey< C >
 
class  GetCollectionKind< COLLECTION, typename SFINAEHelper< void, typename std::decay< COLLECTION >::type::IsCollection >::type >
 
class  BaseCollection< COLLECTION, SUPER >
 
class  Collection< COLLECTION, VALUETYPE, SUPER >
 
class  BlockIterator< COLLECTION, VALUETYPE, CONSTITERATOR, STRIDED >
 
class  ArrayBase0< COLLECTION, VALUETYPE, SUPER, HASH >
 
class  ArrayImpl< ARRAY >
 
class  ArrayBase< COLLECTION, VALUETYPE, SUPER, HASH >
 
class  SetBase0< COLLECTION, VALUETYPE, SUPER, HASH >
 
class  SetImpl< SET >
 
class  SetBase< COLLECTION, VALUETYPE, SUPER, HASH >
 
class  MapBase0< COLLECTION, KEYTYPE, VALUETYPE, SUPER, HASH >
 
class  MapImpl< MAP >
 
class  MapBase< COLLECTION, KEYTYPE, VALUETYPE, SUPER, HASH >
 
class  ContiguousRangeMap< K, V, MAP >
 
class  FixedSizeBitSet< EXPONENT >
 
struct  GetIteratorType< C >
 
struct  GetIteratorType< T[N]>
 
class  ReverseIterator< IT >
 
class  ForEachIterator< ITERATOR, SUPER >
 
class  AutoIterator< C >
 
class  AutoIterator< T[N]>
 
class  NestedForEachIterator< I1, I2 >
 
class  CommonIteratorTypes< T, I1, I2 >
 
class  CommonIteratorTypes< void, I1, I2 >
 
class  ConcatForEachIterator< T, I1, I2 >
 
class  ConditionalForEachIterator< T, I1, I2 >
 
class  MapForEachIterator< MAP, I >
 
class  FilterForEachIterator< FILTER, I >
 
class  ZipForEachIterator< I1, I2 >
 
class  IndexForEachIterator< I >
 
class  SingletonForEachIterator< T >
 
class  EraseIterator< COLLECTION, SWAP_ERASE, IS_FOREACH_ITERATOR >
 
class  EraseIterator< COLLECTION, SWAP_ERASE, false >
 
class  Iterable
 
class  GenericBaseArray
 
class  HashBitSet< BASE_SET, INT_TYPE >
 
struct  DefaultHashMapEntryHandlerBase< HASHVALUE, L >
 
struct  HashMapKeyValuePair
 
struct  HashMapValueKeyPair
 
struct  HashMapKeyHashValuePair
 
class  HashMapEntryBase< K, V, ENTRY_HANDLER, LAYOUT >
 
class  HashMapEntryBase< K, V, ENTRY_HANDLER, HASHMAP_ENTRY_LAYOUT::HASH_KEY_VALUE >
 
class  HashMapEntryBase< K, V, ENTRY_HANDLER, HASHMAP_ENTRY_LAYOUT::KEY_VALUE >
 
class  HashMapEntryBase< K, V, ENTRY_HANDLER, HASHMAP_ENTRY_LAYOUT::VALUE >
 
class  HashMapEntryBase< K, V, ENTRY_HANDLER, HASHMAP_ENTRY_LAYOUT::KEY_HASH_VALUE >
 
class  HashMapEntryBase< K, V, ENTRY_HANDLER, HASHMAP_ENTRY_LAYOUT::HASH_VALUE_KEY >
 
class  HashMapEntryBase< K, UnitType, ENTRY_HANDLER, HASHMAP_ENTRY_LAYOUT::HASH_KEY_VALUE >
 
class  HashMapEntryBase< K, UnitType, ENTRY_HANDLER, HASHMAP_ENTRY_LAYOUT::KEY_HASH_VALUE >
 
class  HashMapEntryBase< K, UnitType, ENTRY_HANDLER, HASHMAP_ENTRY_LAYOUT::HASH_VALUE_KEY >
 
class  HashMapEntryBase< K, UnitType, ENTRY_HANDLER, HASHMAP_ENTRY_LAYOUT::KEY_VALUE >
 
class  HashMap< K, V, HASH, ENTRY_HANDLER, ALLOCATOR, MODE, INITIAL_CAPACITY, LOAD_FACTOR, ENTRY_ALLOCATOR >
 
class  HashMapSelector< HASH, ENTRY_HANDLER, ALLOCATOR, MODE, INITIAL_CAPACITY, LOAD_FACTOR, ENTRY_ALLOCATOR >
 
struct  GenericCastMemberTrait< HashMap< K_TO, V_TO >, HashMap< K_FROM, V_FROM >, SAFE >
 
class  HashSet< T, HASH, ENTRY_HANDLER, ALLOCATOR, MODE, INITIAL_CAPACITY, LOAD_FACTOR, ENTRY_ALLOCATOR >
 
struct  GenericCastMemberTrait< HashSet< TO >, HashSet< FROM >, SAFE >
 
class  HashMapStatistics
 
class  HybridMap< K, V, SMALL, LARGE, THRESHOLD, REVERSE_THRESHOLD >
 
class  HybridMapSelector< SMALL, LARGE, THRESHOLD, REVERSE_THRESHOLD >
 
class  HybridSet< T, SMALL, LARGE, THRESHOLD, REVERSE_THRESHOLD >
 
class  IndexIteratorDefaultAccess
 
class  IndexIterator< T, ARRAY, ACCESS >
 
class  OpaqueBase
 
class  ParallelSort< SORTCLASS, FLAGS, PARALLELIZATION_THRESHOLD >
 
class  SimpleParallelSort< COMPARE, FLAGS >
 
class  PointerArray< T, MINCHUNKSIZE, ALLOCATOR >
 
class  RangeMap< K, V, MAP >
 
class  RangeSet< T, MAP >
 
class  RefCountHashMapDefaultHandler
 
class  RefCountHashMap< K, V, HASH, HANDLER >
 
class  HelperClass< SORTCLASS, ITERATOR, CONTENT, FLAGS >
 
class  BaseSort< SORTCLASS, FLAGS >
 
class  SimpleSort< COMPARE, FLAGS >
 
class  HelperClass< SORTCLASS, ITERATOR, CONTENT, BASESORTFLAGS::NONE >
 
class  HelperClass< SORTCLASS, ITERATOR, CONTENT, BASESORTFLAGS::MOVEANDCOPYOBJECTS >
 
class  SortedArray< MYSELF, ARRAY, FLAGS, PARALLEL >
 
class  DefaultSortedArray< T >
 
class  TaggedBaseRef< T, HANDLER, TAG, TAG_BITS, DEFAULT_VALUE, ENABLE_POINTER_CONVERSION >
 
class  ThreadSafePtr< POINTER >
 
class  ThreadSafeRef< REFERENCE >
 
struct  WeakRefBase
 
struct  WeakRefTargetBase
 
struct  MemoryMetadataProxy
 
class  WeakRefServices
 
class  PerformanceBaseArray< T, MINCHUNKSIZE, MEMFLAGS, Allocator >
 
struct  KDTreeNode
 
struct  KDTreeNearest
 
struct  KDStackArray
 
class  KDTree
 

Macros

#define IMPLEMENT_CUSTOM_BASELISTNODE(NODE, linkPtr)
 
#define NewObjCopy(T, SRC)
 
#define PRIVATE_MAXON_C_ARRAY_B(count, T, ...)
 
#define PRIVATE_MAXON_C_ARRAY_A(count, T, ...)
 
#define MAXON_C_ARRAY(T, ...)
 

Typedefs

template<typename T , Int COUNT, Int MINCHUNKSIZE = COUNT, BASEARRAYFLAGS MEMFLAGS = BASEARRAYFLAGS::NONE, typename ALLOCATOR = DefaultAllocator>
using BufferedBaseArray = typename BufferedBaseArraySelector< COUNT, MINCHUNKSIZE, MEMFLAGS, ALLOCATOR >::template Type< T >
 
template<typename T >
using Pointer = BaseRef< T, PointerHandler >
 
template<typename T >
using UniqueRef = BaseRef< T, UniqueRefHandler >
 
template<typename T >
using StrongRef = BaseRef< T, StrongRefHandler >
 
template<typename T >
using StrongCOWRef = BaseRef< const T, StrongCOWRefHandler >
 
template<typename T >
using AutoMem = UniqueRef< RawMem< T > >
 
template<typename T >
using StridedBlock = Block< T, true >
 
template<typename T , Bool STRIDED = false>
using MoveBlock = Block< T, STRIDED, true >
 
using OpaqueRef = StrongRef< OpaqueBase >
 
using MemoryObserverCallback = MEMORY_OBSERVER_FLAGS(*)(void *callbackData, const void *target, MEMORY_OBSERVER_STATE state)
 
using MemoryMetadataDestructor = void(*)(void *metadata)
 

Enumerations

enum class  BASEARRAYFLAGS {
  NONE ,
  MOVEANDCOPYOBJECTS
}
 
enum class  BLOCKARRAYFLAGS {
  NONE ,
  MOVEANDCOPYOBJECTS ,
  NOINSERTERASE ,
  GROW_SLOWLY
}
 
enum class  BURSTTRIE_SORT {
  NONE ,
  LINEAR_SEARCH ,
  BINARY_SEARCH
}
 
enum class  COLLECTION_RESIZE_FLAGS {
  NONE ,
  ON_SHRINK_KEEP_CAPACITY ,
  ON_SHRINK_FIT_TO_SIZE ,
  ON_GROW_RESERVE_CAPACITY ,
  ON_GROW_FIT_TO_SIZE ,
  ON_GROW_UNINITIALIZED ,
  ON_GROW_UNSPECIFIED ,
  ON_RESIZE_UNSPECIFIED ,
  FIT_TO_SIZE ,
  DEFAULT ,
  POD_UNINITIALIZED
}
 
enum class  HASHMAP_ENTRY_LAYOUT {
  HASH_KEY_VALUE ,
  KEY_HASH_VALUE ,
  HASH_VALUE_KEY ,
  HASH_VALUE ,
  KEY_VALUE ,
  VALUE
}
 
enum class  HASHMAP_MODE {
  DEFAULT ,
  SYNCHRONIZED ,
  NO_NONEMPTY_BUCKET_TABLE
}
 
enum class  BASESORTFLAGS {
  NONE ,
  MOVEANDCOPYOBJECTS
}
 
enum class  MEMORY_OBSERVER_FLAGS : Int {
  DEFAULT ,
  CLAIM_SHARED_OWNERSHIP ,
  CLAIM_EXCLUSIVE_OWNERSHIP ,
  KEEP_OBSERVER ,
  INVOKE_WITH_UNLOCKED_TARGET
}
 
enum class  MEMORY_OBSERVER_STATE : Int {
  DEFAULT ,
  TARGET_IS_LOCKED ,
  TARGET_HAS_EXCLUSIVE_OWNERSHIP
}
 

Functions

enum maxon::BASEARRAYFLAGS MAXON_ENUM_FLAGS (BASEARRAYFLAGS)
 
template<typename T >
T * PrivateInitCopy (void *ptr, const T &src)
 
template<typename T , Int N>
Block< T > ToBlock (T(&array)[N])
 
template<typename T >
Block< typename maxon::details::BlockType< T >::typeToBlock (T *ptr, Int size)
 
template<typename T >
Block< T > ToSingletonBlock (T &value)
 
template<typename T >
Block< const T > ToSingletonBlock (const T &value)
 
template<typename T >
StridedBlock< typename maxon::details::BlockType< T >::typeToBlock (T *ptr, Int size, Int stride)
 
Block< const CharCharToBlock (const Char *str)
 
Block< const UCharCharToBlock (const UChar *str)
 
template<Int N>
Block< const CharCharToBlock (const Char(&str)[N])
 
template<Int N>
Block< const UCharCharToBlock (const UChar(&str)[N])
 
template<Int N>
Block< const Utf32CharCharToBlock (const Utf32Char(&str)[N])
 
enum maxon::BLOCKARRAYFLAGS MAXON_ENUM_FLAGS (BLOCKARRAYFLAGS)
 
enum maxon::BURSTTRIE_SORT MAXON_ENUM_LIST (BURSTTRIE_SORT)
 
template<typename C >
Int PrivateGetCount (const C &collection, OverloadRank0)
 
template<typename T , Int N>
Int PrivateGetCount (T(&array)[N], OverloadRank1)
 
template<typename C >
SFINAEHelper< Int, typename C::IsCollection >::type PrivateGetCount (const C &collection, OverloadRank2)
 
template<typename ITERABLE >
Int GetCount (const ITERABLE &iterable)
 
template<typename SET , typename KEY >
MAXON_ATTRIBUTE_FORCE_INLINE Bool PrivateContains (const SET &set, const KEY &key, OverloadRank0)
 
template<typename T , Int N, typename KEY >
Bool PrivateContains (T(&array)[N], const KEY &key, OverloadRank1)
 
template<typename SET , typename KEY >
MAXON_ATTRIBUTE_FORCE_INLINE auto PrivateContains (const SET &set, const KEY &key, OverloadRank1) -> decltype(set.Contains(key))
 
template<typename SET , typename KEY >
MAXON_ATTRIBUTE_FORCE_INLINE SFINAEHelper< Bool, typename SET::IsCollection >::type PrivateContains (const SET &set, const KEY &key, OverloadRank2)
 
template<typename PREDICATE , typename KEY >
MAXON_ATTRIBUTE_FORCE_INLINE Bool Contains (const PREDICATE &predicate, const KEY &key)
 
template<typename COMPARE , typename T1 , typename T2 >
MAXON_ATTRIBUTE_FORCE_INLINE Bool PrivateIsEqual (COMPARE &&cmp, const T1 &a, const T2 &b, OverloadRank0)
 
template<typename COMPARE , typename T1 , typename T2 >
MAXON_ATTRIBUTE_FORCE_INLINE auto PrivateIsEqual (COMPARE &&cmp, const T1 &a, const T2 &b, OverloadRank1) -> decltype(cmp.IsEqual(a, b))
 
template<typename PREDICATE , typename T1 , typename T2 >
MAXON_ATTRIBUTE_FORCE_INLINE Bool IsEqual (PREDICATE &&predicate, const T1 &a, const T2 &b)
 
 MAXON_MEMBERTYPE_DETECTOR (IsCollection, IsCollection, std::false_type)
 
enum maxon::COLLECTION_RESIZE_FLAGS MAXON_ENUM_FLAGS (COLLECTION_RESIZE_FLAGS, "net.maxon.datatype.enum.collection_resize_flags", EARLY)
 
template<typename COLLECTION , typename T >
std::conditional<!STD_IS_REPLACEMENT(reference, COLLECTION) &&(GetCollectionKind< COLLECTION >::value !=COLLECTION_KIND::NONE), T &&, T & >::type ValueForward (T &x)
 
template<typename COLLECTION , typename T , Bool STRIDED>
const Block< T, STRIDED, !STD_IS_REPLACEMENT(reference, COLLECTION) &&(GetCollectionKind< COLLECTION >::value !=COLLECTION_KIND::NONE)> & BlockForward (const Block< T, STRIDED > &block)
 
template<typename COLLECTION >
COLLECTION && PrivateGetMap (COLLECTION &&c, OverloadRank0)
 
template<typename COLLECTION >
Substitute< COLLECTION &&, typename std::remove_reference< COLLECTION >::type::MapType >::type PrivateGetMap (COLLECTION &&c, OverloadRank1)
 
 MAXON_MEMBERTYPE_DETECTOR (GetNonConstIteratorType, Iterator, std::false_type)
 
 MAXON_MEMBERTYPE_DETECTOR (GetConstIteratorType, ConstIterator, std::false_type)
 
 MAXON_MEMBERTYPE_DETECTOR (GetCollectionType, CollectionType, T)
 
 MAXON_MEMBERTYPE_DETECTOR (IsForEachIterator, IsForEachIterator, std::false_type)
 
template<typename I >
ReverseIterator< typename GetIteratorType< typename std::remove_reference< I >::type >::typeRBegin (I &&iterable)
 
template<typename I >
ReverseIterator< typename GetIteratorType< typename std::remove_reference< I >::type >::typeREnd (I &&iterable)
 
template<typename COLLECTION >
MAXON_ATTRIBUTE_FORCE_INLINE auto begin (COLLECTION &&c) -> decltype(c.Begin())
 
template<typename COLLECTION >
MAXON_ATTRIBUTE_FORCE_INLINE auto end (COLLECTION &&c) -> decltype(c.End())
 
enum maxon::HASHMAP_ENTRY_LAYOUT MAXON_ENUM_LIST (HASHMAP_ENTRY_LAYOUT)
 
enum maxon::HASHMAP_MODE MAXON_ENUM_LIST (HASHMAP_MODE)
 
template<typename RANGETYPE >
Int GetRangeItemCount (const RANGETYPE &data)
 
enum maxon::BASESORTFLAGS MAXON_ENUM_FLAGS (BASESORTFLAGS)
 
template<typename T , typename HANDLER , typename TAG , Int TAG_BITS, TAG DEFAULT_VALUE, Bool ENABLE_POINTER_CONVERSION>
SFINAEHelper< String, T >::type ToString (const TaggedBaseRef< T, HANDLER, TAG, TAG_BITS, DEFAULT_VALUE, ENABLE_POINTER_CONVERSION > &object, const FormatStatement *formatStatement, Bool checkDataType=true)
 
 MAXON_ASSERT_STANDARD_LAYOUT (WeakRefBase)
 
 MAXON_ASSERT_STANDARD_LAYOUT (WeakRefTargetBase)
 
enum maxon::MEMORY_OBSERVER_FLAGS Int MAXON_ENUM_FLAGS (MEMORY_OBSERVER_FLAGS)
 
enum maxon::MEMORY_OBSERVER_STATE Int MAXON_ENUM_FLAGS (MEMORY_OBSERVER_STATE)
 
Block< const CharToBlock () const
 
MAXON_ATTRIBUTE_NO_INLINE void DoSort () const
 

Variables

static const Int BASEARRAY_DEFAULT_CHUNK_SIZE
 
static constexpr Int BLOCKARRAY_DEFAULT_SIZE_EXPONENT
 

Macro Definition Documentation

◆ IMPLEMENT_CUSTOM_BASELISTNODE

#define IMPLEMENT_CUSTOM_BASELISTNODE (   NODE,
  linkPtr 
)

Use this macro to implement custom BaseListNodes where T and NODE are equal. NODE is the name of the class and linkPtr is the address of the BaseListLinkPOD. Don't forget that your custom node must have a destructor which has to call this->Remove(). If you want to implement legacy stile GetNext() or GetPrev() you must check IsListHead() when using _GetNext() or _GetPrev().

◆ NewObjCopy

#define NewObjCopy (   T,
  SRC 
)

◆ PRIVATE_MAXON_C_ARRAY_B

#define PRIVATE_MAXON_C_ARRAY_B (   count,
  T,
  ... 
)

◆ PRIVATE_MAXON_C_ARRAY_A

#define PRIVATE_MAXON_C_ARRAY_A (   count,
  T,
  ... 
)

◆ MAXON_C_ARRAY

#define MAXON_C_ARRAY (   T,
  ... 
)

Returns a CArray of type T. The number of elements is automatically determined. The macro can be used to specify an argument for a function parameter of Block type directly in the function call as in

void Func(const Block<const Int>& values);
Func(MAXON_C_ARRAY(Int, 1, 4, 42));
maxon::Int Int
Definition: ge_sys_math.h:64
#define MAXON_C_ARRAY(T,...)
Definition: block.h:1098
Parameters
[in]TType of the array elements.
[in]...Values for the array elements.

Typedef Documentation

◆ BufferedBaseArray

using BufferedBaseArray = typename BufferedBaseArraySelector<COUNT, MINCHUNKSIZE, MEMFLAGS, ALLOCATOR>::template Type<T>

BufferedBaseArray is a maxon::BaseArray which uses a maxon::FixedBufferAllocator. The allocator's buffer lies within the BufferedBaseArray, so no dynamic memory allocation is needed as long as the reserved space suffices. This can greatly improve performance if the number of elements in an array is usually small.

You shouldn't reserve a large amount of elements, and you shouldn't use BufferedBaseArray if it is likely that the reserved space won't be enough. E.g., the ports of a node are typically small in number, so a BufferedBaseArray can be used. But the points of polygon object are typically large in number, so don't use a BufferedBaseArray.

Example:

BufferedBaseArray<Utf32Char, 256> buffer;
const char ** buffer
Definition: abstract.h:327
Template Parameters
TType of the array elements.
COUNTNumber of elements of the internal buffer.
MINCHUNKSIZEThe minimum number of elements upon array creation.
MEMFLAGSUse BASEARRAYFLAGS::NONE unless you know the object can be moved and/or copied.
ALLOCATORClass for memory allocation if the internal buffer doesn't suffice.

◆ Pointer

The Pointer template behaves almost identical to an ordinary C++ pointer, with the exception that the default constructor automatically initializes the pointer with nullptr, and the destructor automatically resets the pointer to nullptr. Pointer is a template based on BaseRef with PointerHandler as template argument. As such, you can also use the helper methods of BaseRef for object creation, movement etc.

◆ UniqueRef

The UniqueRef template stores a pointer to an object (usually obtained by NewObj()), and it automatically deletes the object on destruction or reset by means of DeleteObj(). So you don't have to take care of the rather error-prone manual deleting of objects. Note that this behavior means that UniqueRef has the sole ownership on the object. You cannot have more than one UniqueRef pointing to the same Object. UniqueRef is a template based on BaseRef with UniqueRefHandler as template argument. As such, you can also use the helper methods of BaseRef for object creation, movement etc.

Template Parameters
TType of the object the UniqueRef points to.

◆ StrongRef

A StrongReference can point to a target object and ensures that the target object exists as long as there are strong references to it. As soon as there are no more strong references pointing to it the target object will be destructed.

Template Parameters
TType of the target object for the strong reference.
Note
The strong reference is implemented via a BaseRef.

◆ StrongCOWRef

A StrongCOWRef shares the basic behaviour of a StrongReference, but it supports copy-on-write semantics: If a modification of the object is to be made through the reference or if MakeWritable() is invoked, a copy of the object is made unless the reference is exclusive. This ensures that other COW references to the object aren't affected by the modification. If the allocation of a copy fails the reference will be set to null.

Template Parameters
TType of the target object for the strong reference.
Note
The strong reference is implemented via a BaseRef.

◆ AutoMem

using AutoMem = UniqueRef<RawMem<T> >

◆ StridedBlock

using StridedBlock = Block<T, true>

◆ MoveBlock

using MoveBlock = Block<T, STRIDED, true>

MoveBlock is a type alias for a Block with the MOVE template parameter set to true. MoveBlock can be used for function parameters where the values of the block may be moved to another place by the function. This prevents accidental moves of temporary Blocks (e.g. those returend by ToBlock()) which would happen with Block&&.

Template Parameters
TType of elements of the block.
STRIDEDTrue if a stride other than SIZEOF(T) shall be supported.

◆ OpaqueRef

A strong reference to a hidden class.

◆ MemoryObserverCallback

using MemoryObserverCallback = MEMORY_OBSERVER_FLAGS (*)(void* callbackData, const void* target, MEMORY_OBSERVER_STATE state)

◆ MemoryMetadataDestructor

using MemoryMetadataDestructor = void (*)(void* metadata)

Enumeration Type Documentation

◆ BASEARRAYFLAGS

enum BASEARRAYFLAGS
strong

Flags for the behaviour of BaseArray when moving objects, can be used to force memcpy/memmove/realloc.

Enumerator
NONE 

Use constructor/destructor or move operator unless the type is trivially copyable using memcpy, memmove or realloc.

MOVEANDCOPYOBJECTS 

Elements are PODs and can be copied using memcpy and moved using memmove/realloc (for Resize, Insert, Erase, Append etc.). Overrides the setting of std::is_trivially_copyable<T>

◆ BLOCKARRAYFLAGS

enum BLOCKARRAYFLAGS
strong

Flags for the behaviour of BlockArray when moving objects (only relevant for Insert() and Erase()).

Enumerator
NONE 

Use constructor/destructor or move operator unless the type is trivially copyable using memcpy, memmove or realloc.

MOVEANDCOPYOBJECTS 

Elements are PODs and can be copied using memcpy and moved using memmove/realloc (for Resize, Insert, Erase, Append etc.). Overrides the setting of std::is_trivially_copyable<T>.

NOINSERTERASE 

Do not support Insert() and Erase() (will make the subscript operator faster).

GROW_SLOWLY 

The first block will increase its size gradually (and might move memory) until it reaches 1 << BLOCK_SIZE_EXPONENT.

◆ BURSTTRIE_SORT

enum BURSTTRIE_SORT
strong

This enum defines the sorting modes for the buckets of a BurstTrieMap.

Enumerator
NONE 

Bucket entries won't be sorted at all. If a correct ordering of the entries isn't needed, this is generally the fastest option.

LINEAR_SEARCH 

Bucket entries will be sorted according to their keys. But for searching, they will be scanned in linear order nevertheless. Given small bucket sizes, this is typically faster than a binary search.

BINARY_SEARCH 

Bucket entries will be sorted according to their keys, and lookup will be done with a binary search. This will be faster than a linear search only for large bucket sizes which in general are not recommended.

◆ COLLECTION_RESIZE_FLAGS

Flags for Resize(). Depending on the type of collection the flags might be ignored (except for ON_GROW_UNINITIALIZED).

Enumerator
NONE 
ON_SHRINK_KEEP_CAPACITY 

Don't change capacity.

ON_SHRINK_FIT_TO_SIZE 

Copy the array to a new memory block that is as small as possible to hold the data.

ON_GROW_RESERVE_CAPACITY 

Allocate some extra capacity (based on ComputeArraySize()).

ON_GROW_FIT_TO_SIZE 

Grow the array exactly to the requested size.

ON_GROW_UNINITIALIZED 

Do not initialize added elements (usually PODs) when resizing the array (is supported by all collections).

ON_GROW_UNSPECIFIED 

Initialize added elements with unspecified (but legal) values. For example PODs can be left uninitialized, strong references can be zero-initialized for best performance.

ON_RESIZE_UNSPECIFIED 

The resize operation may use unspecified (but legal) values for existing elements as well as for added elements. After resize all elements may contain unspecified values.

FIT_TO_SIZE 

Fits the array to the requested size for growing and shrinking.

DEFAULT 

The default is to keep capacity on shrink and fit to size when growing the array.

POD_UNINITIALIZED 

◆ HASHMAP_ENTRY_LAYOUT

enum HASHMAP_ENTRY_LAYOUT
strong
Enumerator
HASH_KEY_VALUE 
KEY_HASH_VALUE 
HASH_VALUE_KEY 
HASH_VALUE 
KEY_VALUE 
VALUE 

◆ HASHMAP_MODE

enum HASHMAP_MODE
strong

HASHMAP_MODE can be used as template argument for HashMap to control its behavior.

Enumerator
DEFAULT 

The default mode.

SYNCHRONIZED 

Use atomic access to implement a lock-free hash map.

NO_NONEMPTY_BUCKET_TABLE 

Don't maintain a table of non-empty buckets. This reduces memory consumption, but makes iterations slower.

◆ BASESORTFLAGS

enum BASESORTFLAGS
strong

Flags for the behavior of BaseSort when moving objects. If you pass the default value BASESORTFLAGS::NONE an auto-detection checks for POD and sets BASESORTFLAGS::MOVEANDCOPYOBJECTS if applicable. For non-POD datatypes BASESORTFLAGS::MOVEANDCOPYOBJECTS can be manually set to increase performance (if your datatype allows memory operations).

Enumerator
NONE 

always use constructor/destructor or move operator, never memcpy, memmove or realloc

MOVEANDCOPYOBJECTS 

elements are PODs and can be moved and copied using memcpy and moved using memmove

◆ MEMORY_OBSERVER_FLAGS

enum MEMORY_OBSERVER_FLAGS : Int
strong

The observer might return several flags, if it just observes the destruction it should simply return DEFAULT.

Enumerator
DEFAULT 

Default behaviour: Continue with destruction, observer will be removed.

CLAIM_SHARED_OWNERSHIP 

The observer claims shared ownership of the target, do not destruct the object.

CLAIM_EXCLUSIVE_OWNERSHIP 

The first observer/creator claims exclusive ownership of the target, do not destruct the object.

KEEP_OBSERVER 

Do not delete the observer (usually only makes sense if ownership is claimed).

INVOKE_WITH_UNLOCKED_TARGET 

Ask to invoke the observer again without the target being locked (if you need to destruct associated objects).

◆ MEMORY_OBSERVER_STATE

enum MEMORY_OBSERVER_STATE : Int
strong

The observer gets information about the target via the state parameter.

Enumerator
DEFAULT 
TARGET_IS_LOCKED 

The target is locked and you must not directly or indireclty modify itself or any related objects.

TARGET_HAS_EXCLUSIVE_OWNERSHIP 

The target is exclusively owned and you cannot claim shared ownership.

Function Documentation

◆ MAXON_ENUM_FLAGS() [1/6]

enum maxon::BASEARRAYFLAGS maxon::MAXON_ENUM_FLAGS ( BASEARRAYFLAGS  )

◆ PrivateInitCopy()

T* maxon::PrivateInitCopy ( void *  ptr,
const T &  src 
)

◆ ToBlock() [1/4]

Block<T> maxon::ToBlock ( T(&)  array[N])

Converts a C++ fixed-size array to a block.

Parameters
[in]arrayThe array to wrap in a block.
Returns
A non-strided block which wraps the complete C++ array.

◆ ToBlock() [2/4]

Block<typename maxon::details::BlockType<T>::type> maxon::ToBlock ( T *  ptr,
Int  size 
)

Makes a non-strided block from a pointer and a size. This is the same as using the constructor Block<T>(ptr, size), but you save to specify the template argument for the type.

Parameters
[in]ptrPointer to the first element.
[in]sizeNumber of elements.
Returns
A non-strided block representing size elements starting at ptr.

◆ ToSingletonBlock() [1/2]

Block<T> maxon::ToSingletonBlock ( T &  value)

◆ ToSingletonBlock() [2/2]

Block<const T> maxon::ToSingletonBlock ( const T &  value)

◆ ToBlock() [3/4]

StridedBlock<typename maxon::details::BlockType<T>::type> maxon::ToBlock ( T *  ptr,
Int  size,
Int  stride 
)

Makes a strided block from a pointer, a size and a stride. This is the same as using the constructor StridedBlock<T>(ptr, size, stride), but you save to specify the template arguments.

Parameters
[in]ptrPointer to the first element.
[in]sizeNumber of elements.
[in]strideElement stride.
Returns
A strided block representing size elements starting at ptr with the given stride.

◆ CharToBlock() [1/5]

Block<const Char> maxon::CharToBlock ( const Char str)

Converts a null-terminated C-string to a block. The block contains all characters from the string except the null terminator.

Parameters
[in]strPointer to the null-terminated C-string, may be nullptr.
Returns
A non-strided block representing all characters from str.

◆ CharToBlock() [2/5]

Block<const UChar> maxon::CharToBlock ( const UChar str)

◆ CharToBlock() [3/5]

Block<const Char> maxon::CharToBlock ( const Char(&)  str[N])

◆ CharToBlock() [4/5]

Block<const UChar> maxon::CharToBlock ( const UChar(&)  str[N])

◆ CharToBlock() [5/5]

Block<const Utf32Char> maxon::CharToBlock ( const Utf32Char(&)  str[N])

◆ MAXON_ENUM_FLAGS() [2/6]

enum maxon::BLOCKARRAYFLAGS maxon::MAXON_ENUM_FLAGS ( BLOCKARRAYFLAGS  )

◆ MAXON_ENUM_LIST() [1/3]

enum maxon::BURSTTRIE_SORT maxon::MAXON_ENUM_LIST ( BURSTTRIE_SORT  )

◆ PrivateGetCount() [1/3]

Int maxon::PrivateGetCount ( const C &  collection,
OverloadRank0   
)

◆ PrivateGetCount() [2/3]

Int maxon::PrivateGetCount ( T(&)  array[N],
OverloadRank1   
)

◆ PrivateGetCount() [3/3]

SFINAEHelper<Int, typename C::IsCollection>::type maxon::PrivateGetCount ( const C &  collection,
OverloadRank2   
)

◆ GetCount()

Int maxon::GetCount ( const ITERABLE &  iterable)

Returns the number of elements of iterable. If the iterable is a collection or a C++ array, the true number of elements is returned, otherwise (e.g., for an iterator) -1.

Parameters
[in]iterableSome iterable object.
Returns
Element count of the iterable object, or -1 if the count is unknown.

◆ PrivateContains() [1/4]

MAXON_ATTRIBUTE_FORCE_INLINE Bool maxon::PrivateContains ( const SET &  set,
const KEY &  key,
OverloadRank0   
)

◆ PrivateContains() [2/4]

Bool maxon::PrivateContains ( T(&)  array[N],
const KEY &  key,
OverloadRank1   
)

◆ PrivateContains() [3/4]

MAXON_ATTRIBUTE_FORCE_INLINE auto maxon::PrivateContains ( const SET &  set,
const KEY &  key,
OverloadRank1   
) -> decltype(set.Contains(key))

◆ PrivateContains() [4/4]

MAXON_ATTRIBUTE_FORCE_INLINE SFINAEHelper<Bool, typename SET::IsCollection>::type maxon::PrivateContains ( const SET &  set,
const KEY &  key,
OverloadRank2   
)

◆ Contains()

MAXON_ATTRIBUTE_FORCE_INLINE Bool maxon::Contains ( const PREDICATE &  predicate,
const KEY &  key 
)

Checks if key is contained in the set defined by predicate. predicate has to be of a predicate type, i.e., either a collection, a C++ array, an object with Contains function or a Bool-valued unary function object.

Parameters
[in]predicateSome predicate object.
[in]keyKey to look up in the predicate object.
Returns
True if key is contained in predicate.

◆ PrivateIsEqual() [1/2]

MAXON_ATTRIBUTE_FORCE_INLINE Bool maxon::PrivateIsEqual ( COMPARE &&  cmp,
const T1 &  a,
const T2 &  b,
OverloadRank0   
)

◆ PrivateIsEqual() [2/2]

MAXON_ATTRIBUTE_FORCE_INLINE auto maxon::PrivateIsEqual ( COMPARE &&  cmp,
const T1 &  a,
const T2 &  b,
OverloadRank1   
) -> decltype(cmp.IsEqual(a, b))

◆ IsEqual()

MAXON_ATTRIBUTE_FORCE_INLINE Bool maxon::IsEqual ( PREDICATE &&  predicate,
const T1 &  a,
const T2 &  b 
)

Checks if #a and #b are equal according to the given predicate. The predicate has to be either an object callable with two parameters (such as a lambda), or an object with a function IsEqual with two parameters.

Parameters
[in]predicateSome predicate object.
[in]aFirst value to compare for equality.
[in]bSecond value to compare for equality.
Returns
True if #a and #b are equal according to predicate.

◆ MAXON_MEMBERTYPE_DETECTOR() [1/5]

maxon::MAXON_MEMBERTYPE_DETECTOR ( IsCollection  ,
IsCollection  ,
std::false_type   
)

◆ MAXON_ENUM_FLAGS() [3/6]

enum maxon::COLLECTION_RESIZE_FLAGS maxon::MAXON_ENUM_FLAGS ( COLLECTION_RESIZE_FLAGS  ,
"net.maxon.datatype.enum.collection_resize_flags"  ,
EARLY   
)

◆ ValueForward()

std::conditional<!STD_IS_REPLACEMENT(reference, COLLECTION) && (GetCollectionKind<COLLECTION>::value != COLLECTION_KIND::NONE), T&&, T&>::type maxon::ValueForward ( T &  x)

This helper functions serves a similar purpose as std::forward<X>(x). But in ValueForward<COLLECTION>(x), COLLECTION need not be the type of x itself, but can be an arbitrary type. If COLLECTION a collection type (but not a reference type to a collection type), x is forwarded as r-value reference, otherwise as l-value reference. The typical usage is in a function template which receives some collection via a parameter COLLECTION&& collection (with COLLECTION being a template parameter), and where the values of the collection shall be forwarded to another function. If a collection is passed as r-value to the function, its values should passed as r-values, too, to the other function. Example:

template <typename COLLECTION> Result<void> AppendAllImpl(COLLECTION&& other)
{
for (auto&& i : std::forward<COLLECTION>(other))
{
this->Append(ValueForward<COLLECTION>(i)) iferr_return;
}
return OK;
}
Py_ssize_t i
Definition: abstract.h:645
PyObject * other
Definition: dictobject.h:70
return OK
Definition: apibase.h:2690
#define iferr_scope
Definition: resultbase.h:1384
#define iferr_return
Definition: resultbase.h:1519
Parameters
[in]xThe value to forward.
Template Parameters
COLLECTIONA type to determine if x shall be forwarded as r-value (COLLECTION is a collection type, but not a reference type) or l-value (otherwise).
Returns
The forwarded value.

◆ BlockForward()

const Block<T, STRIDED, !STD_IS_REPLACEMENT(reference, COLLECTION) && (GetCollectionKind<COLLECTION>::value != COLLECTION_KIND::NONE)>& maxon::BlockForward ( const Block< T, STRIDED > &  block)

This helper functions serves a similar purpose as std::forward<X>(x). It receives a Block and returns the same block: Either as it is, or cast to a MoveBlock. The latter case happens when COLLECTION is a collection type (but not a reference type to a collection type). The typical usage is in a function template which receives some collection via a parameter COLLECTION&& collection (with COLLECTION being a template parameter), and where blocks of values of the collection shall be forwarded to another function. If a collection is passed as r-value to the function, its blocks should passed as MoveBlocks to the other function.

See also
ValueForward
Parameters
[in]blockThe block to forward.
Template Parameters
COLLECTIONA type to determine if x shall be forwarded as r-value (COLLECTION is a collection type, but not a reference type) or l-value (otherwise).
Returns
The forwarded block.

◆ PrivateGetMap() [1/2]

COLLECTION&& maxon::PrivateGetMap ( COLLECTION &&  c,
OverloadRank0   
)

◆ PrivateGetMap() [2/2]

Substitute<COLLECTION&&, typename std::remove_reference<COLLECTION>::type::MapType>::type maxon::PrivateGetMap ( COLLECTION &&  c,
OverloadRank1   
)

◆ MAXON_MEMBERTYPE_DETECTOR() [2/5]

maxon::MAXON_MEMBERTYPE_DETECTOR ( GetNonConstIteratorType  ,
Iterator  ,
std::false_type   
)

◆ MAXON_MEMBERTYPE_DETECTOR() [3/5]

maxon::MAXON_MEMBERTYPE_DETECTOR ( GetConstIteratorType  ,
ConstIterator  ,
std::false_type   
)

◆ MAXON_MEMBERTYPE_DETECTOR() [4/5]

maxon::MAXON_MEMBERTYPE_DETECTOR ( GetCollectionType  ,
CollectionType  ,
 
)

◆ MAXON_MEMBERTYPE_DETECTOR() [5/5]

maxon::MAXON_MEMBERTYPE_DETECTOR ( IsForEachIterator  ,
IsForEachIterator  ,
std::false_type   
)

◆ RBegin()

ReverseIterator<typename GetIteratorType<typename std::remove_reference<I>::type>::type> maxon::RBegin ( I &&  iterable)

◆ REnd()

ReverseIterator<typename GetIteratorType<typename std::remove_reference<I>::type>::type> maxon::REnd ( I &&  iterable)

◆ begin()

MAXON_ATTRIBUTE_FORCE_INLINE auto maxon::begin ( COLLECTION &&  c) -> decltype(c.Begin())

◆ end()

MAXON_ATTRIBUTE_FORCE_INLINE auto maxon::end ( COLLECTION &&  c) -> decltype(c.End())

◆ MAXON_ENUM_LIST() [2/3]

enum maxon::HASHMAP_ENTRY_LAYOUT maxon::MAXON_ENUM_LIST ( HASHMAP_ENTRY_LAYOUT  )

◆ MAXON_ENUM_LIST() [3/3]

enum maxon::HASHMAP_MODE maxon::MAXON_ENUM_LIST ( HASHMAP_MODE  )

◆ GetRangeItemCount()

Int GetRangeItemCount ( const RANGETYPE &  data)

Calculate the total item count in a range set. RangeSet::GetCount returns the number of "ranges".

Parameters
[in]dataThe RangeSet
Returns
Item count.

◆ MAXON_ENUM_FLAGS() [4/6]

enum maxon::BASESORTFLAGS maxon::MAXON_ENUM_FLAGS ( BASESORTFLAGS  )

◆ ToString()

SFINAEHelper<String, T>::type maxon::ToString ( const TaggedBaseRef< T, HANDLER, TAG, TAG_BITS, DEFAULT_VALUE, ENABLE_POINTER_CONVERSION > &  object,
const FormatStatement formatStatement,
Bool  checkDataType = true 
)

◆ MAXON_ASSERT_STANDARD_LAYOUT() [1/2]

maxon::MAXON_ASSERT_STANDARD_LAYOUT ( WeakRefBase  )

◆ MAXON_ASSERT_STANDARD_LAYOUT() [2/2]

maxon::MAXON_ASSERT_STANDARD_LAYOUT ( WeakRefTargetBase  )

◆ MAXON_ENUM_FLAGS() [5/6]

enum maxon::MEMORY_OBSERVER_FLAGS Int maxon::MAXON_ENUM_FLAGS ( MEMORY_OBSERVER_FLAGS  )

◆ MAXON_ENUM_FLAGS() [6/6]

enum maxon::MEMORY_OBSERVER_STATE Int maxon::MAXON_ENUM_FLAGS ( MEMORY_OBSERVER_STATE  )

◆ ToBlock() [4/4]

Block< const Char > ToBlock ( ) const

◆ DoSort()

MAXON_ATTRIBUTE_NO_INLINE void DoSort
private

Variable Documentation

◆ BASEARRAY_DEFAULT_CHUNK_SIZE

const Int BASEARRAY_DEFAULT_CHUNK_SIZE
static

◆ BLOCKARRAY_DEFAULT_SIZE_EXPONENT

constexpr Int BLOCKARRAY_DEFAULT_SIZE_EXPONENT
staticconstexpr

Default value for the BLOCK_SIZE_EXPONENT template parameter of BlockArray. The value is 10 which means a default block size of 1024 elements.