![]() |
Apparatus
Version 1.3.0
ECS data-driven workflow for Unreal Engine.
|
The main containter of subjects' traits. More...
#include <Chunk.h>
Public Types | |
enum | { InvalidId = 0 , FirstId = 1 , InvalidLineIndex = -1 , InvalidSubjectIndex = FSubjectInfo::InvalidIndex } |
Public Member Functions | |
const FTraitmark & | GetTraitmark () const |
Get the traitmark of the chunk. More... | |
const FFilter & | GetLockingFilter () const |
Get the active locking filter. More... | |
UScriptStruct * | GetTraitType (int32 LineIndex) const |
Get a trait type given line index. More... | |
int32 | GetTraitSize (int32 LineIndex) const |
Get the size of a trait given its line index. More... | |
void * | GetTraitDataGivenSubjectAndLineIndices (const int32 SubjectIndex, const int32 LineIndex) const |
Get the trait data pointer given subject's index and a line index. More... | |
EApparatusStatus | CopyTraitGivenSubjectAndLineIndices (const int32 SubjectIndex, const int32 LineIndex, void *const OutTraitData, bool bTraitDataInitialized=true) const |
Copy a trait's data given a subject and line indices. More... | |
int32 | LinesNum () const |
The number of trait lines in the chunk. More... | |
UScriptStruct * | GetLineType (const int32 LineIndex) const |
Get the type of the line at a specific index. More... | |
~UChunk () | |
Finalize the chunk, freeing all of its resources. More... | |
EApparatusStatus | Lock (const FFilter &InFilter) const |
Lock the chunk, increasing its current lock count. More... | |
EApparatusStatus | Lock () const |
Lock the chunk using the currently locking filter. More... | |
EApparatusStatus | Unlock () const |
Unlock the chunk, decreasing its current lock count. More... | |
bool | IsLocked () const |
Is the chunk currently locked. More... | |
bool | IsSubjectLocked (const int32 SubjectIndex) const |
Check if the subject at specified place is locked. More... | |
int32 | Num () const |
Get the total number of subjects, currently in the chunk. More... | |
void | Reserve (const int32 InCapacity) |
Reserve a certain capacity. More... | |
EApparatusStatus | Begin (struct FChunkIt &Iterator, const FFilter &Filter) const |
Get the first iterator for the chunk. More... | |
FChunkIt | Begin (const FFilter &Filter) const |
Get the first iterator for the chunk. More... | |
FChunkIt | Begin () const |
Get the first iterator for the chunk under the current locking filter. More... | |
EApparatusStatus | Advance (struct FChunkIt &Iterator) |
Get the next iterator for the chunk. More... | |
bool | IsEnd (struct FChunkIt &Iterator) |
Has the iterator reached a chunk's end. More... | |
EApparatusStatus | GetSubjectTrait (const int32 SubjectIndex, const UScriptStruct *const TraitType, void *const OutTraitData, const bool bTraitDataInitialized=true) const |
Copy a trait from the chunk's subject by its type identifier. More... | |
EApparatusStatus | SetSubjectTrait (const int32 SubjectIndex, const UScriptStruct *const TraitType, const void *const InTraitData) |
Set the trait for the chunk's subject by its type identifier. More... | |
EApparatusStatus | FetchTraitsPtrs (const int32 SubjectIndex, const TArray< int32 > &Mapping, void **OutTraits) |
Fetch the traits for a subject into a traits data array. More... | |
EApparatusStatus | CopyTraitsGivenSubjectIndices (const int32 SrcSubjectIndex, class UChunk *const DstChunk, const int32 DstSubjectIndex) const |
Copy the traits from this chunk to another one, given subject indices. More... | |
bool | Matches (const FFilter &Filter) const |
Check whether the chunk matches a filter. More... | |
Static Public Member Functions | |
static class UChunk * | New (UObject *Owner, const int32 Id, const FTraitmark &InTraitmark) |
Create a new chunk instance. More... | |
Friends | |
struct | FSubjectHandle |
struct | FMechanicInfo |
struct | FChunkIt |
struct | FChunkChain |
struct | FFingerprint |
class | UMachine |
The main containter of subjects' traits.
anonymous enum |
|
inline |
Finalize the chunk, freeing all of its resources.
|
inline |
Get the next iterator for the chunk.
true
. Otherwise, returns false
.
|
inline |
Get the first iterator for the chunk under the current locking filter.
Get the first iterator for the chunk.
Get the first iterator for the chunk.
|
inline |
Copy a trait's data given a subject and line indices.
SubjectIndex | The index of the subject which trait to copy. |
LineIndex | The index of the trait line. |
OutTraitData | The output buffer to copy to. |
bTraitDataInitialized | Is the trait data initialized or a raw buffer? |
|
inline |
Copy the traits from this chunk to another one, given subject indices.
If the trait is missing within the new chunk it is safely skipped.
SrcSubjectIndex | The subject's index within the source chunk. |
DstChunk | The destination chunk to copy to. |
DstSubjectIndex | The subject's index within the destination chunk. |
|
inline |
Fetch the traits for a subject into a traits data array.
SubjectIndex | The index of the subject within the belt. |
Mapping | The mapping to use while fetching. |
OutTraits | Initialized traits data to fill. |
|
inline |
Get the type of the line at a specific index.
|
inline |
Get the active locking filter.
|
inline |
Copy a trait from the chunk's subject by its type identifier.
SubjectIndex | The index of the subject within the chunk. |
TraitType | The trait type identifier. |
OutTraitData | The trait data receiver. |
bTraitDataInitialized | Is the OutTraitData actually initialized? |
|
inline |
Get the trait data pointer given subject's index and a line index.
SubjectIndex | An index of the subject. |
LineIndex | An index of the line. |
|
inline |
Get the traitmark of the chunk.
|
inline |
Get the size of a trait given its line index.
LineIndex | The index of the line. |
|
inline |
Get a trait type given line index.
LineIndex | An index of the line. |
|
inline |
Has the iterator reached a chunk's end.
|
inline |
Is the chunk currently locked.
|
inline |
Check if the subject at specified place is locked.
|
inline |
The number of trait lines in the chunk.
chunk | A chunk to examine. Must not be a nullptr |
|
inline |
Lock the chunk using the currently locking filter.
|
inline |
Lock the chunk, increasing its current lock count.
A chunk always has to be locked while iterating on it. The number of locks has to be matched by the respective number of unlocks, in order for chunk to be unlocked again.
|
inline |
Check whether the chunk matches a filter.
Filter | A filter to match. |
|
inlinestatic |
Create a new chunk instance.
|
inline |
Get the total number of subjects, currently in the chunk.
|
inline |
Reserve a certain capacity.
|
inline |
Set the trait for the chunk's subject by its type identifier.
SubjectIndex | The index of the subject within the chunk. |
TraitType | The type of the trait to set. |
InTraitData | The trait data to set. |
|
inline |
Unlock the chunk, decreasing its current lock count.
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |