engine
 
载入中...
搜索中...
未找到
Public 成员函数 | 友元 | 所有成员列表
TResourceArray< ElementType, Alignment > 模板类 参考

A array which allocates memory which can be used for UMA rendering resources. 更多...

#include <DynamicRHIResourceArray.h>

+ 类 TResourceArray< ElementType, Alignment > 继承关系图:

Public 成员函数

void BulkSerialize (FArchive &Ar, bool bForcePerElementSerialization=false)
 Serialize data as a single block. 更多...
 
virtual void Discard ()
 Called on non-UMA systems after the RHI has copied the resource data, and no longer needs the CPU's copy. 更多...
 
virtual bool GetAllowCPUAccess () const
 
virtual const void * GetResourceData () const
 
virtual uint32 GetResourceDataSize () const
 
virtual bool IsStatic () const
 
virtual void SetAllowCPUAccess (bool bInNeedsCPUAccess)
 Sets whether the resource array will be accessed by CPU.
 
 TResourceArray (bool InNeedsCPUAccess=false)
 Constructor
 
virtual void Discard ()=0
 Called on non-UMA systems after the RHI has copied the resource data, and no longer needs the CPU's copy.
 
virtual bool GetAllowCPUAccess () const =0
 
virtual const void * GetResourceData () const =0
 
virtual uint32 GetResourceDataSize () const =0
 
virtual bool IsStatic () const =0
 
virtual void SetAllowCPUAccess (bool bInNeedsCPUAccess)=0
 Sets whether the resource array will be accessed by CPU.
 
- Public 成员函数 继承自 TArray< InElementType, InAllocator >
FORCEINLINE SizeType Add (const ElementType &Item)
 Adds a new item to the end of the array, possibly reallocating the whole array to fit. 更多...
 
FORCEINLINE SizeType Add (ElementType &&Item)
 Adds a new item to the end of the array, possibly reallocating the whole array to fit. 更多...
 
FORCEINLINE ElementType & Add_GetRef (const ElementType &Item)
 Adds a new item to the end of the array, possibly reallocating the whole array to fit. 更多...
 
FORCEINLINE ElementType & Add_GetRef (ElementType &&Item)
 Adds a new item to the end of the array, possibly reallocating the whole array to fit. 更多...
 
SizeType AddDefaulted (SizeType Count=1)
 Adds new items to the end of the array, possibly reallocating the whole array to fit. 更多...
 
ElementType & AddDefaulted_GetRef ()
 Add a new item to the end of the array, possibly reallocating the whole array to fit. 更多...
 
FORCEINLINE SizeType AddUninitialized (SizeType Count=1)
 Adds a given number of uninitialized elements into the array. 更多...
 
FORCEINLINE SizeType AddUnique (const ElementType &Item)
 Adds unique element to array if it doesn't exist. 更多...
 
FORCEINLINE SizeType AddUnique (ElementType &&Item)
 Adds unique element to array if it doesn't exist. 更多...
 
SizeType AddZeroed (SizeType Count=1)
 Adds new items to the end of the array, possibly reallocating the whole array to fit. 更多...
 
ElementType & AddZeroed_GetRef ()
 Adds a new item to the end of the array, possibly reallocating the whole array to fit. 更多...
 
void Append (const ElementType *Ptr, SizeType Count)
 Adds a raw array of elements to the end of the TArray. 更多...
 
template<typename OtherElementType , typename OtherAllocator >
void Append (const TArray< OtherElementType, OtherAllocator > &Source)
 Appends the specified array to this array. 更多...
 
FORCEINLINE void Append (std::initializer_list< ElementType > InitList)
 Adds an initializer list of elements to the end of the TArray. 更多...
 
template<typename OtherElementType , typename OtherAllocator >
void Append (TArray< OtherElementType, OtherAllocator > &&Source)
 Appends the specified array to this array. 更多...
 
FORCEINLINE RangedForIteratorType begin ()
 DO NOT USE DIRECTLY STL-like iterators to enable range-based for loop support.
 
void BulkSerialize (FArchive &Ar, bool bForcePerElementSerialization=false)
 Bulk serialize array as a single memory blob when loading. 更多...
 
FORCEINLINE void CheckAddress (const ElementType *Addr) const
 Checks that the specified address is not part of an element within the container. 更多...
 
FORCEINLINE void CheckInvariants () const
 Checks array invariants: if array size is greater than zero and less than maximum.
 
template<typename ComparisonType >
bool Contains (const ComparisonType &Item) const
 Checks if this array contains the element. 更多...
 
template<typename Predicate >
FORCEINLINE bool ContainsByPredicate (Predicate Pred) const
 Checks if this array contains element for which the predicate is true. 更多...
 
void CountBytes (FArchive &Ar) const
 Count bytes needed to serialize this array. 更多...
 
TConstIterator CreateConstIterator () const
 Creates a const iterator for the contents of this array 更多...
 
TIterator CreateIterator ()
 Creates an iterator for the contents of this array 更多...
 
template<typename... ArgsType>
FORCEINLINE SizeType Emplace (ArgsType &&... Args)
 Constructs a new item at the end of the array, possibly reallocating the whole array to fit. 更多...
 
template<typename... ArgsType>
FORCEINLINE ElementType & Emplace_GetRef (ArgsType &&... Args)
 Constructs a new item at the end of the array, possibly reallocating the whole array to fit. 更多...
 
template<typename... ArgsType>
FORCEINLINE void EmplaceAt (SizeType Index, ArgsType &&... Args)
 Constructs a new item at a specified index, possibly reallocating the whole array to fit. 更多...
 
template<typename... ArgsType>
FORCEINLINE ElementType & EmplaceAt_GetRef (SizeType Index, ArgsType &&... Args)
 Constructs a new item at a specified index, possibly reallocating the whole array to fit. 更多...
 
void Empty (SizeType Slack=0)
 Empties the array. 更多...
 
template<typename Predicate >
TArray< ElementType > FilterByPredicate (Predicate Pred) const
 Filters the elements in the array based on a predicate functor. 更多...
 
SizeType Find (const ElementType &Item) const
 Finds element within the array. 更多...
 
FORCEINLINE bool Find (const ElementType &Item, SizeType &Index) const
 Finds element within the array. 更多...
 
template<typename KeyType >
ElementType * FindByKey (const KeyType &Key)
 Finds an item by key (assuming the ElementType overloads operator== for the comparison). 更多...
 
template<typename KeyType >
FORCEINLINE const ElementType * FindByKey (const KeyType &Key) const
 Finds an item by key (assuming the ElementType overloads operator== for the comparison). 更多...
 
template<typename Predicate >
ElementType * FindByPredicate (Predicate Pred)
 Finds an element which matches a predicate functor. 更多...
 
template<typename Predicate >
FORCEINLINE const ElementType * FindByPredicate (Predicate Pred) const
 Finds an element which matches a predicate functor. 更多...
 
template<typename SearchType >
bool FindItemByClass (SearchType **Item=nullptr, SizeType *ItemIndex=nullptr, SizeType StartIndex=0) const
 Searches for the first entry of the specified type, will only work with TArray<UObject*>. 更多...
 
SizeType FindLast (const ElementType &Item) const
 Finds element within the array starting from the end. 更多...
 
FORCEINLINE bool FindLast (const ElementType &Item, SizeType &Index) const
 Finds element within the array starting from the end. 更多...
 
template<typename Predicate >
FORCEINLINE SizeType FindLastByPredicate (Predicate Pred) const
 Searches the array for the last occurrence of an element which matches the specified predicate. 更多...
 
template<typename Predicate >
SizeType FindLastByPredicate (Predicate Pred, SizeType Count) const
 Searches an initial subrange of the array for the last occurrence of an element which matches the specified predicate. 更多...
 
FORCEINLINE SIZE_T GetAllocatedSize (void) const
 Helper function to return the amount of memory allocated by this container. 更多...
 
FORCEINLINE ElementType * GetData ()
 Helper function for returning a typed pointer to the first array entry. 更多...
 
FORCEINLINE const ElementType * GetData () const
 Helper function for returning a typed pointer to the first array entry. 更多...
 
FORCEINLINE SizeType GetSlack () const
 Returns the amount of slack in this array in elements. 更多...
 
FORCEINLINE uint32 GetTypeSize () const
 Helper function returning the size of the inner type. 更多...
 
void Heapify ()
 Builds an implicit heap from the array. 更多...
 
template<class PREDICATE_CLASS >
FORCEINLINE void Heapify (const PREDICATE_CLASS &Predicate)
 Implicit heaps 更多...
 
void HeapPop (ElementType &OutItem, bool bAllowShrinking=true)
 Removes the top element from the heap. 更多...
 
template<class PREDICATE_CLASS >
void HeapPop (ElementType &OutItem, const PREDICATE_CLASS &Predicate, bool bAllowShrinking=true)
 Removes the top element from the heap. 更多...
 
void HeapPopDiscard (bool bAllowShrinking=true)
 Removes the top element from the heap. 更多...
 
template<class PREDICATE_CLASS >
void HeapPopDiscard (const PREDICATE_CLASS &Predicate, bool bAllowShrinking=true)
 Removes the top element from the heap. 更多...
 
SizeType HeapPush (const ElementType &InItem)
 Adds a new element to the heap. 更多...
 
template<class PREDICATE_CLASS >
SizeType HeapPush (const ElementType &InItem, const PREDICATE_CLASS &Predicate)
 Adds a new element to the heap. 更多...
 
SizeType HeapPush (ElementType &&InItem)
 Adds a new element to the heap. 更多...
 
template<class PREDICATE_CLASS >
SizeType HeapPush (ElementType &&InItem, const PREDICATE_CLASS &Predicate)
 Adds a new element to the heap. 更多...
 
void HeapRemoveAt (SizeType Index, bool bAllowShrinking=true)
 Removes an element from the heap. 更多...
 
template<class PREDICATE_CLASS >
void HeapRemoveAt (SizeType Index, const PREDICATE_CLASS &Predicate, bool bAllowShrinking=true)
 Removes an element from the heap. 更多...
 
void HeapSort ()
 Performs heap sort on the array. 更多...
 
template<class PREDICATE_CLASS >
void HeapSort (const PREDICATE_CLASS &Predicate)
 Performs heap sort on the array. 更多...
 
ElementType & HeapTop ()
 Returns the top element from the heap (does not remove the element). 更多...
 
const ElementType & HeapTop () const
 Returns the top element from the heap (does not remove the element). 更多...
 
template<typename KeyType >
SizeType IndexOfByKey (const KeyType &Key) const
 Finds an item by key (assuming the ElementType overloads operator== for the comparison). 更多...
 
template<typename Predicate >
SizeType IndexOfByPredicate (Predicate Pred) const
 Finds an item by predicate. 更多...
 
void Init (const ElementType &Element, SizeType Number)
 Sets the size of the array, filling it with the given element. 更多...
 
SizeType Insert (const ElementType &Item, SizeType Index)
 Inserts a given element into the array at given location. 更多...
 
SizeType Insert (const ElementType *Ptr, SizeType Count, SizeType Index)
 Inserts a raw array of elements at a particular index in the TArray. 更多...
 
template<typename OtherAllocator >
SizeType Insert (const TArray< ElementType, OtherAllocator > &Items, const SizeType InIndex)
 Inserts given elements into the array at given location. 更多...
 
SizeType Insert (ElementType &&Item, SizeType Index)
 Inserts a given element into the array at given location. 更多...
 
SizeType Insert (std::initializer_list< ElementType > InitList, const SizeType InIndex)
 Inserts given elements into the array at given location. 更多...
 
template<typename OtherAllocator >
SizeType Insert (TArray< ElementType, OtherAllocator > &&Items, const SizeType InIndex)
 Inserts given elements into the array at given location. 更多...
 
ElementType & Insert_GetRef (const ElementType &Item, SizeType Index)
 Inserts a given element into the array at given location. 更多...
 
ElementType & Insert_GetRef (ElementType &&Item, SizeType Index)
 Inserts a given element into the array at given location. 更多...
 
void InsertDefaulted (SizeType Index, SizeType Count=1)
 Inserts a given number of default-constructed elements into the array at a given location. 更多...
 
ElementType & InsertDefaulted_GetRef (SizeType Index)
 Inserts a default-constructed element into the array at a given location. 更多...
 
FORCEINLINE void InsertUninitialized (SizeType Index, SizeType Count=1)
 Inserts a given number of uninitialized elements into the array at given location. 更多...
 
void InsertZeroed (SizeType Index, SizeType Count=1)
 Inserts a given number of zeroed elements into the array at given location. 更多...
 
ElementType & InsertZeroed_GetRef (SizeType Index)
 Inserts a zeroed element into the array at given location. 更多...
 
FORCEINLINE bool IsValidIndex (SizeType Index) const
 Tests if index is valid, i.e. 更多...
 
FORCEINLINE ElementType & Last (SizeType IndexFromTheEnd=0)
 Returns n-th last element from the array. 更多...
 
FORCEINLINE const ElementType & Last (SizeType IndexFromTheEnd=0) const
 Returns n-th last element from the array. 更多...
 
FORCEINLINE SizeType Max () const
 Returns maximum number of elements in array. 更多...
 
FORCEINLINE SizeType Num () const
 Returns number of elements in array. 更多...
 
FORCEINLINE bool operator!= (const TArray &OtherArray) const
 Inequality operator. 更多...
 
TArray & operator+= (const TArray &Other)
 Appends the specified array to this array. 更多...
 
TArray & operator+= (std::initializer_list< ElementType > InitList)
 Appends the specified initializer list to this array. 更多...
 
TArray & operator+= (TArray &&Other)
 Appends the specified array to this array. 更多...
 
TArray & operator= (const TArray &Other)
 Assignment operator. 更多...
 
template<typename OtherAllocator >
TArray & operator= (const TArray< ElementType, OtherAllocator > &Other)
 Assignment operator. 更多...
 
TArray & operator= (std::initializer_list< InElementType > InitList)
 Initializer list assignment operator. 更多...
 
TArray & operator= (TArray &&Other)
 Move assignment operator. 更多...
 
bool operator== (const TArray &OtherArray) const
 Equality operator. 更多...
 
FORCEINLINE ElementType & operator[] (SizeType Index)
 Array bracket operator. 更多...
 
FORCEINLINE const ElementType & operator[] (SizeType Index) const
 Array bracket operator. 更多...
 
FORCEINLINE ElementType Pop (bool bAllowShrinking=true)
 Pops element from the array. 更多...
 
FORCEINLINE void Push (const ElementType &Item)
 Pushes element into the array. 更多...
 
FORCEINLINE void Push (ElementType &&Item)
 Pushes element into the array. 更多...
 
FORCEINLINE void RangeCheck (SizeType Index) const
 Checks if index is in array range. 更多...
 
SizeType Remove (const ElementType &Item)
 Removes as many instances of Item as there are in the array, maintaining order but not indices. 更多...
 
template<class PREDICATE_CLASS >
SizeType RemoveAll (const PREDICATE_CLASS &Predicate)
 Remove all instances that match the predicate, maintaining order but not indices Optimized to work with runs of matches/non-matches 更多...
 
template<class PREDICATE_CLASS >
SizeType RemoveAllSwap (const PREDICATE_CLASS &Predicate, bool bAllowShrinking=true)
 Remove all instances that match the predicate 更多...
 
FORCEINLINE void RemoveAt (SizeType Index)
 Removes an element (or elements) at given location optionally shrinking the array. 更多...
 
template<typename CountType >
FORCEINLINE void RemoveAt (SizeType Index, CountType Count, bool bAllowShrinking=true)
 Removes an element (or elements) at given location optionally shrinking the array. 更多...
 
FORCEINLINE void RemoveAtSwap (SizeType Index)
 Removes an element (or elements) at given location optionally shrinking the array. 更多...
 
template<typename CountType >
FORCEINLINE void RemoveAtSwap (SizeType Index, CountType Count, bool bAllowShrinking=true)
 Removes an element (or elements) at given location optionally shrinking the array. 更多...
 
SizeType RemoveSingle (const ElementType &Item)
 Removes the first occurrence of the specified item in the array, maintaining order but not indices. 更多...
 
SizeType RemoveSingleSwap (const ElementType &Item, bool bAllowShrinking=true)
 Removes the first occurrence of the specified item in the array. 更多...
 
SizeType RemoveSwap (const ElementType &Item, bool bAllowShrinking=true)
 Removes item from the array. 更多...
 
FORCEINLINE void Reserve (SizeType Number)
 Reserves memory such that the array can contain at least Number elements. 更多...
 
void Reset (SizeType NewSize=0)
 Same as empty, but doesn't change memory allocations, unless the new size is larger than the current array. 更多...
 
void SetNum (SizeType NewNum, bool bAllowShrinking=true)
 Resizes array to given number of elements. 更多...
 
void SetNumUninitialized (SizeType NewNum, bool bAllowShrinking=true)
 Resizes array to given number of elements. 更多...
 
void SetNumUnsafeInternal (SizeType NewNum)
 Does nothing except setting the new number of elements in the array. 更多...
 
void SetNumZeroed (SizeType NewNum, bool bAllowShrinking=true)
 Resizes array to given number of elements. 更多...
 
FORCEINLINE void Shrink ()
 Shrinks the array's used memory to smallest possible to store elements currently in it. 更多...
 
void Sort ()
 Sorts the array assuming < operator is defined for the item type. 更多...
 
template<class PREDICATE_CLASS >
void Sort (const PREDICATE_CLASS &Predicate)
 Sorts the array using user define predicate class. 更多...
 
void StableSort ()
 Stable sorts the array assuming < operator is defined for the item type. 更多...
 
template<class PREDICATE_CLASS >
void StableSort (const PREDICATE_CLASS &Predicate)
 Stable sorts the array using user defined predicate class. 更多...
 
FORCEINLINE void Swap (SizeType FirstIndexToSwap, SizeType SecondIndexToSwap)
 Element-wise array element swap. 更多...
 
FORCEINLINE void SwapMemory (SizeType FirstIndexToSwap, SizeType SecondIndexToSwap)
 Element-wise array memory swap. 更多...
 
FORCEINLINE TArray ()
 Constructor, initializes element number counters.
 
FORCEINLINE TArray (const ElementType *Ptr, SizeType Count)
 Constructor from a raw array of elements. 更多...
 
FORCEINLINE TArray (const TArray &Other)
 Copy constructor. 更多...
 
FORCEINLINE TArray (const TArray &Other, SizeType ExtraSlack)
 Copy constructor. 更多...
 
template<typename OtherElementType , typename OtherAllocator >
FORCEINLINE TArray (const TArray< OtherElementType, OtherAllocator > &Other)
 Copy constructor with changed allocator. 更多...
 
 TArray (std::initializer_list< InElementType > InitList)
 Initializer list constructor
 
FORCEINLINE TArray (TArray &&Other)
 Move constructor. 更多...
 
template<typename OtherElementType >
 TArray (TArray< OtherElementType, Allocator > &&Other, SizeType ExtraSlack)
 Move constructor. 更多...
 
template<typename OtherElementType , typename OtherAllocator >
FORCEINLINE TArray (TArray< OtherElementType, OtherAllocator > &&Other)
 Move constructor. 更多...
 
FORCEINLINE ElementType & Top ()
 Returns the top element, i.e. 更多...
 
FORCEINLINE const ElementType & Top () const
 Returns the top element, i.e. 更多...
 
template<class PREDICATE_CLASS >
void VerifyHeap (const PREDICATE_CLASS &Predicate)
 Verifies the heap. 更多...
 
 ~TArray ()
 Destructor.
 

友元

FArchive & operator<< (FArchive &Ar, TResourceArray< ElementType, Alignment > &ResourceArray)
 Serializer for this class 更多...
 

详细描述

template<typename ElementType, uint32 Alignment = DEFAULT_ALIGNMENT>
class TResourceArray< ElementType, Alignment >

A array which allocates memory which can be used for UMA rendering resources.

In the dynamically bound RHI, it isn't any different from the default array type, since none of the dynamically bound RHI implementations have UMA.

参数
Alignment- memory alignment to use for the allocation

成员函数说明

◆ BulkSerialize()

template<typename ElementType , uint32 Alignment = DEFAULT_ALIGNMENT>
void TResourceArray< ElementType, Alignment >::BulkSerialize ( FArchive &  Ar,
bool  bForcePerElementSerialization = false 
)
inline

Serialize data as a single block.

See TArray::BulkSerialize for more info.

IMPORTANT:

  • This is Overridden from UnrealTemplate.h TArray::BulkSerialize Please make certain changes are propogated accordingly
参数
ArFArchive to bulk serialize this TArray to/from

◆ Discard()

template<typename ElementType , uint32 Alignment = DEFAULT_ALIGNMENT>
virtual void TResourceArray< ElementType, Alignment >::Discard ( )
inlinevirtual

Called on non-UMA systems after the RHI has copied the resource data, and no longer needs the CPU's copy.

Only discard the resource memory on clients, and if the CPU doesn't need access to it. Non-clients can't discard the data because they may need to serialize it.

实现了 FResourceArrayInterface.

◆ GetAllowCPUAccess()

template<typename ElementType , uint32 Alignment = DEFAULT_ALIGNMENT>
virtual bool TResourceArray< ElementType, Alignment >::GetAllowCPUAccess ( ) const
inlinevirtual
返回
true if the resource keeps a copy of its resource data after the RHI resource has been created

实现了 FResourceArrayInterface.

◆ GetResourceData()

template<typename ElementType , uint32 Alignment = DEFAULT_ALIGNMENT>
virtual const void * TResourceArray< ElementType, Alignment >::GetResourceData ( ) const
inlinevirtual
返回
A pointer to the resource data.

实现了 FResourceArrayInterface.

◆ GetResourceDataSize()

template<typename ElementType , uint32 Alignment = DEFAULT_ALIGNMENT>
virtual uint32 TResourceArray< ElementType, Alignment >::GetResourceDataSize ( ) const
inlinevirtual
返回
size of resource data allocation

实现了 FResourceArrayInterface.

◆ IsStatic()

template<typename ElementType , uint32 Alignment = DEFAULT_ALIGNMENT>
virtual bool TResourceArray< ElementType, Alignment >::IsStatic ( ) const
inlinevirtual
返回
true if the resource array is static and shouldn't be modified

实现了 FResourceArrayInterface.

友元及相关函数文档

◆ operator<<

template<typename ElementType , uint32 Alignment = DEFAULT_ALIGNMENT>
FArchive & operator<< ( FArchive &  Ar,
TResourceArray< ElementType, Alignment > &  ResourceArray 
)
friend

Serializer for this class

参数
Ar- archive to serialize to
ResourceArray- resource array data to serialize

该类的文档由以下文件生成: