BaseCollection< COLLECTION, SUPER > Class Template Reference Data Structures

#include <collection.h>

Inheritance diagram for BaseCollection< COLLECTION, SUPER >:

详细描述

template<typename COLLECTION, typename SUPER>
class maxon::BaseCollection< COLLECTION, SUPER >

BaseCollection is a helper template to be used as base class for collections which have Begin()/End() functions returning iterators, and a GetCount() function. It will then add iterator-based utility functions such as ToString.

Template Parameters
COLLECTION The actual collection class, this has to have BaseCollection as (direct or indirect) base class.
SUPER The class to be used as base class for BaseCollection .
另请参阅
$ref collections

Public Types

using  IsCollection = std::true_type

公共成员函数

template<typename... ARGS>
MAXON_ATTRIBUTE_FORCE_INLINE   BaseCollection (ARGS &&... args)
template<typename COLLECTION2 >
MAXON_ATTRIBUTE_FORCE_INLINE std::enable_if< maxon::IsCollection< COLLECTION2 >::value, Bool >::type  operator== (const COLLECTION2 &other) const
template<typename COLLECTION2 >
MAXON_ATTRIBUTE_FORCE_INLINE std::enable_if< maxon::IsCollection< COLLECTION2 >::value, Bool >::type  operator!= (const COLLECTION2 &other) const
template<typename COMPARE = EqualityCompare, typename COLLECTION2 >
MAXON_ATTRIBUTE_FORCE_INLINE std::enable_if< maxon::IsCollection< COLLECTION2 >::value &&! STD_IS_REPLACEMENT (same, typename std::decay< COMPARE >::type, EQUALITY ), Bool >::type  IsEqual (const COLLECTION2 &other, COMPARE &&cmp=COMPARE()) const
template<typename COLLECTION2 >
MAXON_ATTRIBUTE_FORCE_INLINE Result < void >  AppendAll (COLLECTION2 &&other, COLLECTION_RESIZE_FLAGS resizeFlags= COLLECTION_RESIZE_FLAGS::ON_GROW_RESERVE_CAPACITY )
template<typename COLLECTION2 >
MAXON_ATTRIBUTE_FORCE_INLINE Result < void >  CopyFrom (COLLECTION2 &&other, COLLECTION_RESIZE_FLAGS resizeFlags= COLLECTION_RESIZE_FLAGS::FIT_TO_SIZE )
template<typename COLLECTION2 >
MAXON_ATTRIBUTE_FORCE_INLINE Result < void >  Subtract (COLLECTION2 &&other)
template<typename COLLECTION2 >
MAXON_ATTRIBUTE_FORCE_INLINE Result < void >  Intersect (const COLLECTION2 &other)
template<typename COLLECTION2 >
Bool   Intersects (const COLLECTION2 &other) const
template<typename COLLECTION2 >
MAXON_ATTRIBUTE_FORCE_INLINE Result < void >  CopyFromImpl (COLLECTION2 &&other, COLLECTION_RESIZE_FLAGS resizeFlags, OverloadRank0 )
template<typename COLLECTION2 >
Result < void >  AppendAllImpl (COLLECTION2 &&other, COLLECTION_RESIZE_FLAGS resizeFlags, Bool overwrite, OverloadRank0 )
template<typename COLLECTION2 >
Result < void >  IntersectImpl (COLLECTION2 &&other, OverloadRank0 )
MAXON_ATTRIBUTE_FORCE_INLINE Bool   IsEmpty () const
MAXON_ATTRIBUTE_FORCE_INLINE Bool   IsPopulated () const
String   ToString (const FormatStatement *formatStatement=nullptr) const
template<typename COLLECTION2 >
MAXON_ATTRIBUTE_FORCE_INLINE Bool   ContainsAll (COLLECTION2 &&other) const
template<typename COLLECTION2 >
Bool   ContainsAllImpl (COLLECTION2 &&other, OverloadRank0 ) const

Member Typedef Documentation

◆  IsCollection

using IsCollection = std::true_type

构造函数 & 析构函数文档编制

◆  BaseCollection()

MAXON_ATTRIBUTE_FORCE_INLINE BaseCollection ( ARGS &&...  args )
explicit

成员函数文档编制

◆  operator==()

MAXON_ATTRIBUTE_FORCE_INLINE std::enable_if<maxon::IsCollection<COLLECTION2>::value, Bool >::type operator== ( const COLLECTION2 &  other ) const

◆  operator!=()

MAXON_ATTRIBUTE_FORCE_INLINE std::enable_if<maxon::IsCollection<COLLECTION2>::value, Bool >::type operator!= ( const COLLECTION2 &  other ) const

◆  IsEqual()

MAXON_ATTRIBUTE_FORCE_INLINE std::enable_if<maxon::IsCollection<COLLECTION2>::value && ! STD_IS_REPLACEMENT (same, typename std::decay<COMPARE>::type, EQUALITY ), Bool >::type IsEqual ( const COLLECTION2 &  other ,
COMPARE &&  cmp = COMPARE()  
) const

◆  AppendAll()

MAXON_ATTRIBUTE_FORCE_INLINE Result <void> AppendAll ( COLLECTION2 &&  other ,
COLLECTION_RESIZE_FLAGS   resizeFlags = COLLECTION_RESIZE_FLAGS::ON_GROW_RESERVE_CAPACITY  
)

Appends all elements from another collection other to this collection. If this doesn't succeed for all entries, the collection will be left in a valid, but intermediate state with only some entries from other added.

参数
[in] other Another collection, may be any iterable object.
[in] resizeFlags If ON_GROW_FIT_TO_SIZE is set, the collection will use only as much memory as needed to hold the data.
返回
OK on success.

◆  CopyFrom()

MAXON_ATTRIBUTE_FORCE_INLINE Result <void> CopyFrom ( COLLECTION2 &&  other ,
COLLECTION_RESIZE_FLAGS   resizeFlags = COLLECTION_RESIZE_FLAGS::FIT_TO_SIZE  
)

Makes this collection a copy of other . If copying doesn't succeed for all entries, the collection will be left in a valid, but intermediate state with only some entries from other added.

参数
[in] other Another collection, may be any iterable object.
[in] resizeFlags If ON_GROW_FIT_TO_SIZE is set, the collection will use only as much memory as needed to hold the data.
返回
OK on success.

◆  Subtract()

MAXON_ATTRIBUTE_FORCE_INLINE Result <void> Subtract ( COLLECTION2 &&  other )

Removes all elements of another collection other from this collection. Elements of this collection which are not part of other are kept. For a map, only the keys are considered, i.e., an entry is removed from this map if its key is contained in other , regardless of the corresponding values.

参数
[in] other Another collection, may be any iterable object.
返回
OK on success.

◆  Intersect()

MAXON_ATTRIBUTE_FORCE_INLINE Result <void> Intersect ( const COLLECTION2 &  other )

Intersects this collection with the other collection. I.e., elements which are not contained in other are removed. For a map, only the keys are considered, i.e., an entry is kept in this map if its key is contained in other , regardless of the corresponding values.

参数
[in] other Another collection, may be any predicate object.
返回
OK on success.

◆  Intersects()

Bool Intersects ( const COLLECTION2 &  other ) const

◆  CopyFromImpl()

MAXON_ATTRIBUTE_FORCE_INLINE Result <void> CopyFromImpl ( COLLECTION2 &&  other ,
COLLECTION_RESIZE_FLAGS   resizeFlags ,
OverloadRank0    
)

◆  AppendAllImpl()

Result <void> AppendAllImpl ( COLLECTION2 &&  other ,
COLLECTION_RESIZE_FLAGS   resizeFlags ,
Bool   overwrite ,
OverloadRank0    
)

◆  IntersectImpl()

Result <void> IntersectImpl ( COLLECTION2 &&  other ,
OverloadRank0    
)

◆  IsEmpty()

MAXON_ATTRIBUTE_FORCE_INLINE Bool IsEmpty ( ) const

Checks if the collection is empty. This is the same as GetCount() == 0

返回
True if the collection does not contain any elements.

◆  IsPopulated()

MAXON_ATTRIBUTE_FORCE_INLINE Bool IsPopulated ( ) const

Checks if the collection is populated. This is the same as GetCount() != 0

返回
True if the collection contains any elements.

◆  ContainsAll()

MAXON_ATTRIBUTE_FORCE_INLINE Bool ContainsAll ( COLLECTION2 &&  other ) const

Returns true if this collection contains all elements from another collection.

参数
[in] other Another collection, may be any iterable object.
返回
True if this collection contains all elements from other , false otherwise.

◆  ContainsAllImpl()

Bool ContainsAllImpl ( COLLECTION2 &&  other ,
OverloadRank0    
) const