KarmaEngine
Game Engine for practical learning and research purposes
|
A class for managing the collection of UObjects (all or some?) More...
#include <UObjectGlobals.h>
Classes | |
class | TIterator |
Low level iterator. More... | |
Public Member Functions | |
void | AddUObject (UObject *Object) |
const std::vector< FUObjectItem * > & | GetObjectsList () const |
bool | IsValid (const UObjectBase *Object) const |
Checks if a UObject pointer is valid. | |
![]() | |
KarmaVector () | |
Constructor. | |
~KarmaVector () | |
Destructor. | |
uint32_t | Remove (FUObjectItem *aBlock) |
Removes an element from the vector. | |
void | Add (FUObjectItem *aBlock) |
Add an element to the vector. | |
FORCEINLINE int32_t | AddUnique (const FUObjectItem *&Item) |
int32_t | Find (const FUObjectItem *&Item) const |
bool | Contains (FUObjectItem *aBlock) const |
Sees if the vector contains the specified element. | |
uint32_t | Num () const |
Returns the total number of elements in a vector. | |
void | Reset () |
We just reset the vector. UE has the following implementation. | |
void | SmartReset () |
Just clear the elements. | |
void | SetVectorElementByIndex (int32_t Index, FUObjectItem *Value) |
Set the element of a vector using the vector index. | |
const std::vector< FUObjectItem * > & | GetElements () const |
Getter for the elements of vector. | |
std::vector< FUObjectItem * > & | ModifyElements () |
Getter for elements of vector for modification in appropriate way. | |
std::vector< FUObjectItem * >::iterator | begin () |
Getter for first vector element. | |
std::vector< FUObjectItem * >::iterator | end () |
Getter for the last vector element. | |
FORCEINLINE FUObjectItem *& | IndexToObject (int32_t Index) |
FORCEINLINE bool | IsValidIndex (int32_t Index) const |
Additional Inherited Members | |
![]() | |
std::vector< FUObjectItem * > | m_Elements |
A class for managing the collection of UObjects (all or some?)
Note from UE devlopers (for the class FUObjectArray): Note the layout of this data structure is mostly to emulate the old behavior and minimize code rework during code restructure. Better data structures could be used in the future, for example maybe all that is needed is a TSet<UObject *> One has to be a little careful with this, especially with the GC optimization. I have seen spots that assume that non-GC objects come before GC ones during iteration.
void Karma::FUObjectArray::AddUObject | ( | UObject * | Object | ) |
Add an element to the list
Object | The pointer to UObject object to be added to "array" |
Taken from Game Coding Complete 4th edition, page 169. There is variety of ways for indexing the UObjects, for simplicity we will start with number and based upon the complexity (if any?) we may transition to more appropriate indexing scheme as per the need.
|
inline |
Retrieve the list of the UObjects
bool Karma::FUObjectArray::IsValid | ( | const UObjectBase * | Object | ) | const |
Checks if a UObject pointer is valid.
Object | object to test for validity |