Apparatus
Version 1.23
ECS data-oriented workflow for Unreal Engine.
|
The trait-only fingerprint part. More...
#include <Traitmark.h>
Public Types | |
enum | { InvalidTraitId = -1 } |
typedef TArray< UScriptStruct * > | TraitsType |
The type of the traits array container. | |
Public Member Functions | |
const TraitsType & | GetTraits () const |
Get the traits of the traitmark. | |
bool | IsEmpty () const |
Check if the traitmark is empty. | |
int32 | TraitsNum () const |
The number of traits in the traitmark. | |
const FBitMask & | GetTraitsMask () const |
Get the traits mask of the traitmark. | |
UScriptStruct * | TraitAt (const int32 Index) const |
Get a trait type by its index. | |
UScriptStruct * | operator[] (const int32 Index) const |
Get a trait type by its index. | |
operator bool () const | |
Check if a traitmark is viable and has any actual effect. | |
operator const TraitsType & () const | |
Convert to a traits array. | |
int32 | IndexOf (const UScriptStruct *TraitType) const |
Get the index of a specific trait type. | |
template<typename T > | |
constexpr int32 | IndexOf () const |
Get the index of a specific trait type. | |
template<typename AllocatorTA , typename AllocatorTB > | |
EApparatusStatus | FindMappingFrom (const TArray< UScriptStruct *, AllocatorTA > &InTraitmark, TArray< int32, AllocatorTB > &OutMapping) const |
Get an indexing mapping from another traitmark defined by an array of traits. | |
template<typename AllocatorTA , int32 Size> | |
EApparatusStatus | FindMappingFrom (const TArray< UScriptStruct *, AllocatorTA > &InTraitmark, std::array< int32, Size > &OutMapping) const |
Get an indexing mapping from another traitmark defined by a standard array of traits. | |
template<typename AllocatorT > | |
EApparatusStatus | FindMappingFrom (const FTraitmark &InTraitmark, TArray< int32, AllocatorT > &OutMapping) const |
Get an indexing mapping from another traitmark's traits. | |
template<int32 Size> | |
EApparatusStatus | FindMappingFrom (const FTraitmark &InTraitmark, std::array< int32, Size > &OutMapping) const |
Get an indexing mapping from another traitmark's traits. | |
template<typename AllocatorT > | |
EApparatusStatus | FindMappingTo (const TArray< UScriptStruct * > &InTraitmark, TArray< int32, AllocatorT > &OutMapping) const |
Get an indexing mapping to an another traitmark defined by an array of traits. | |
template<typename AllocatorT > | |
EApparatusStatus | FindMappingTo (const FTraitmark &InTraitmark, TArray< int32, AllocatorT > &OutMapping) const |
Get an indexing traits mapping to another traitmark. | |
template<int32 Size> | |
EApparatusStatus | FindMappingTo (const FTraitmark &InTraitmark, std::array< int32, Size > &OutMapping) const |
Get an indexing traits mapping to another traitmark. | |
bool | operator== (const FTraitmark &Other) const |
Compare two traitmarks for equality. | |
bool | operator!= (const FTraitmark &Other) const |
Compare two traitmarks for inequality. | |
bool | Identical (const FTraitmark *Other, uint32 PortFlags) const |
Compare two traitmarks for equality. | |
bool | Contains (const UScriptStruct *const TraitType) const |
Check if the traitmark includes a trait type. | |
template<typename T > | |
bool | Contains () const |
Check if the traitmark includes a trait type. | |
bool | Matches (const FFilter &Filter) const |
Check if the traitmark matches a filter. | |
bool | Matches (const FTraitmark &Traitmark) const |
Check if the traitmark matches another traitmark acting as a filter. | |
FString | ToString () const |
Convert a traitmark to a string. | |
bool | Serialize (FArchive &Archive) |
Serialize the traitmark to the archive. | |
void | PostSerialize (const FArchive &Archive) |
Post-serialize the traitmark updating the mask. | |
FTraitmark () | |
Initialize a new traitmark with a list of traits. | |
FTraitmark (FTraitmark &&Traitmark) | |
Move to a new traitmark. | |
FTraitmark (const FTraitmark &Traitmark) | |
Initialize a new traitmark as a copy of another one. | |
FTraitmark (UScriptStruct *const TraitType) | |
Initialize a new traitmark with a single trait type. | |
FTraitmark (std::initializer_list< UScriptStruct * > InTraits) | |
Initialize a new traitmark with an initializer list of traits. | |
template<typename AllocatorT > | |
FTraitmark (const TArray< UScriptStruct *, AllocatorT > &InTraits) | |
Initialize a new traitmark with an array of traits. | |
Assignment | |
template<EParadigm Paradigm = EParadigm::Default> | |
TOutcome< Paradigm > | Set (const TArray< UScriptStruct * > &InTraits) |
Set a traitmark to an array of traits. | |
template<EParadigm Paradigm = EParadigm::Default> | |
TOutcome< Paradigm > | Set (FTraitmark &&InTraitmark) |
Move a traitmark to this traitmark. | |
template<EParadigm Paradigm = EParadigm::Default> | |
TOutcome< Paradigm > | Set (const FTraitmark &InTraitmark) |
Set a traitmark equal to another traitmark. | |
FTraitmark & | operator= (FTraitmark &&InTraitmark) |
Move-assign a traitmark. | |
FTraitmark & | operator= (const FTraitmark &InTraitmark) |
Set the traitmark equal to another traitmark. | |
Static Public Member Functions | |
static int32 | RegisteredTraitsNum () |
Get the total number of registered trait types. | |
static int32 | GetTraitId (const UScriptStruct *TraitType) |
Get a trait's unique identifier. | |
static const FBitMask & | GetTraitMask (const UScriptStruct *TraitType) |
Get the cached mask for a trait type. | |
template<class T > | |
static const FBitMask & | GetTraitMask () |
Get the mask of a trait. | |
template<typename... Ts, EParadigm Paradigm = EParadigm::Default> | |
static FTraitmark | Make () |
Make a new traitmark with a list of traits types. | |
template<EParadigm Paradigm, typename... Ts> | |
static FTraitmark | Make () |
Make a new traitmark with a list of traits types. | |
Static Public Attributes | |
static const FTraitmark | Zero |
An empty traitmark constant. | |
Friends | |
struct | FFingerprint |
struct | FFilter |
class | UChunk |
struct | FSubjectHandle |
class | UBelt |
class | AMechanism |
class | UApparatusFunctionLibrary |
FArchive & | operator<< (FArchive &Ar, FTraitmark &Traitmark) |
Serialization operator. | |
Addition | |
template<EParadigm Paradigm = EParadigm::Default> | |
TOutcome< Paradigm > | Add (std::initializer_list< UScriptStruct * > InTraits) |
Add trait types to a fingerprint through an initialization list. | |
template<EParadigm Paradigm = EParadigm::Default> | |
TOutcome< Paradigm > | Add (const FTraitmark &InTraitmark) |
Add a traitmark to the traitmark. | |
template<EParadigm Paradigm = EParadigm::Default> | |
TOutcome< Paradigm > | Add (UScriptStruct *const TraitType) |
Add a trait type. | |
template<EParadigm Paradigm = EParadigm::Default, typename TraitsExtractorT = void> | |
TOutcome< Paradigm > | Add (const TraitsExtractorT &InTraits) |
Add an array of traits and a boot state specification. | |
template<EParadigm Paradigm = EParadigm::Default, typename AllocatorT = void> | |
auto | Add (const TArray< UScriptStruct *, AllocatorT > &InTraits) |
Add an array of traits and a boot state specification. | |
template<EParadigm Paradigm, typename... Ts> | |
TOutcome< Paradigm > | Add () |
Add trait(s) to the traitmark. | |
template<typename... Ts, EParadigm Paradigm = EParadigm::Default> | |
auto | Add () |
Add trait(s) to the traitmark. | |
FTraitmark & | operator+= (std::initializer_list< UScriptStruct * > TraitTypes) |
Add variadic trait types. | |
FTraitmark & | operator+= (const TArray< UScriptStruct * > &TraitTypes) |
Add an array of trait types. | |
FTraitmark & | operator+= (UScriptStruct *const TraitType) |
Add a single trait type. | |
Removal | |
template<EParadigm Paradigm = EParadigm::Default> | |
TOutcome< Paradigm > | Remove (UScriptStruct *const TraitType) |
Remove a trait type from the traitmark specification. | |
template<EParadigm Paradigm, typename... Ts> | |
TOutcome< Paradigm > | Remove () |
Remove trait(s) from the traitmark. | |
template<typename... Ts, EParadigm Paradigm = EParadigm::Default> | |
auto | Remove () |
Remove trait(s) from the traitmark. | |
FTraitmark & | operator-= (UScriptStruct *const TraitType) |
Remove a trait type from the traitmark. | |
template<EParadigm Paradigm = EParadigm::Default> | |
TOutcome< Paradigm > | Reset () |
Clear the traitmark without any deallocations. | |
The trait-only fingerprint part.
typedef TArray<UScriptStruct*> FTraitmark::TraitsType |
The type of the traits array container.
|
inline |
Initialize a new traitmark with a list of traits.
|
inline |
Move to a new traitmark.
|
inline |
Initialize a new traitmark as a copy of another one.
|
inline |
Initialize a new traitmark with a single trait type.
TraitType | The trait type to initialize with. |
|
inline |
Initialize a new traitmark with an initializer list of traits.
|
inline |
Initialize a new traitmark with an array of traits.
Add trait(s) to the traitmark.
Templated paradigm version.
Paradigm | The paradigm to work under. |
Ts | The type(s) of the trait(s) to add. |
|
inline |
Add trait(s) to the traitmark.
Templated version.
Ts | The type(s) of the trait(s) to add. |
Paradigm | The paradigm to work under. |
|
inline |
Add a traitmark to the traitmark.
This is the same as adding a traitmark's list of traits, but performs additional optimizing checks.
Paradigm | The paradigm to work under. |
InTraitmark | The traitmark to add. |
|
inline |
Add an array of traits and a boot state specification.
Paradigm | The paradigm to work under. |
AllocatorT | The allocator type to use. |
InTraits | The generic traits provider. |
|
inline |
Add an array of traits and a boot state specification.
Paradigm version.
Paradigm | The paradigm to work under. |
TraitsExtractorT | The traits extractor type to use. |
InTraits | The generic traits provider. |
|
inline |
Add trait types to a fingerprint through an initialization list.
Paradigm | The paradigm to work under. |
|
inline |
Add a trait type.
Paradigm | The paradigm to work under. |
TraitType | The type of the trait to add. May be a nullptr . |
Check if the traitmark includes a trait type.
T | The trait type to check for. |
|
inline |
Check if the traitmark includes a trait type.
TraitType | The trait type to check for. |
|
inline |
Get an indexing mapping from another traitmark's traits.
Size | The size of the output buffer. |
[in] | InTraitmark | A traitmark to get a mapping from. |
[out] | OutMapping | The resulting traits mapping. |
|
inline |
Get an indexing mapping from another traitmark's traits.
[in] | InTraitmark | A traitmark to get a mapping from. |
[out] | OutMapping | The resulting traits mapping. |
|
inline |
Get an indexing mapping from another traitmark defined by a standard array of traits.
[in] | InTraitmark | A traitmark to get a mapping from as an array of trait types. |
[out] | OutMapping | The resulting mapping. |
|
inline |
Get an indexing mapping from another traitmark defined by an array of traits.
[in] | InTraitmark | A traitmark to get a mapping from as an array of trait types. |
[out] | OutMapping | The resulting mapping. |
|
inline |
Get an indexing traits mapping to another traitmark.
Standard array version.
Size | The size of the output array buffer. |
[in] | InTraitmark | A traitmark to get the traits mapping to. |
[out] | OutMapping | The resulting mapping. |
|
inline |
Get an indexing traits mapping to another traitmark.
AllocatorT | The type of the output array allocator. |
[in] | InTraitmark | A traitmark to get the traits mapping to. |
[out] | OutMapping | The resulting mapping. |
|
inline |
Get an indexing mapping to an another traitmark defined by an array of traits.
AllocatorT | The allocator of the output mapping. |
[in] | InTraitmark | A traitmark to get a mapping to. |
[out] | OutMapping | The resulting mapping. |
|
inlinestatic |
Get a trait's unique identifier.
Get the mask of a trait.
|
inlinestatic |
Get the cached mask for a trait type.
|
inline |
Get the traits of the traitmark.
|
inline |
Get the traits mask of the traitmark.
Constant version.
|
inline |
Compare two traitmarks for equality.
Editor-friendly method.
Other | The other traitmark to compare to. |
PortFlags | The contextual port flags. |
|
inlineconstexpr |
Get the index of a specific trait type.
Templated version.
INDEX_NONE
will be returned in such case.T | The type of the trait to find. |
|
inline |
Get the index of a specific trait type.
TraitType | The type of the trait to get an index of. |
INDEX_NONE
If there is no such trait within or TraitType
is nullptr
.
|
inline |
Check if the traitmark is empty.
|
inlinestatic |
Make a new traitmark with a list of traits types.
Ts | The types of traits to fill with. |
Paradigm | The paradigm to work under. |
|
inlinestatic |
Make a new traitmark with a list of traits types.
Paradigm | The paradigm to work under. |
Ts | The types of traits to fill with. |
Check if the traitmark matches a filter.
|
inline |
Check if the traitmark matches another traitmark acting as a filter.
|
inline |
Check if a traitmark is viable and has any actual effect.
|
inlineexplicit |
Convert to a traits array.
|
inline |
Compare two traitmarks for inequality.
Two traitmarks are considered to be unequal if their traits composition is different (regardless of the ordering).
Other | The other traitmark to compare to. |
|
inline |
Add an array of trait types.
|
inline |
Add variadic trait types.
|
inline |
Add a single trait type.
|
inline |
Remove a trait type from the traitmark.
|
inline |
Set the traitmark equal to another traitmark.
InTraitmark | The traitmark to copy. |
|
inline |
Move-assign a traitmark.
InTraitmark | The traitmark to move. |
|
inline |
Compare two traitmarks for equality.
Two traitmarks are considered to be equal if their traits composition is equal (regardless of the ordering).
|
inline |
Get a trait type by its index.
void FTraitmark::PostSerialize | ( | const FArchive & | Archive | ) |
Post-serialize the traitmark updating the mask.
|
inlinestatic |
Get the total number of registered trait types.
Remove trait(s) from the traitmark.
Templated paradigm version.
Paradigm | The paradigm to work under. |
Ts | The type(s) of the trait(s) to remove. |
|
inline |
Remove trait(s) from the traitmark.
Templated version.
Ts | The type of the trait(s) to remove. |
|
inline |
Remove a trait type from the traitmark specification.
Paradigm | The paradigm to work under. |
TraitType | The trait type to remove. May be a nullptr and will be ignored in that case. |
Clear the traitmark without any deallocations.
Paradigm | The paradigm to work under. |
|
inline |
Serialize the traitmark to the archive.
|
inline |
Set a traitmark equal to another traitmark.
Paradigm | The paradigm to work under. |
InTraitmark | The traitmark to copy. |
TOutcome< Paradigm > FTraitmark::Set | ( | const TArray< UScriptStruct * > & | InTraits | ) |
Set a traitmark to an array of traits.
Paradigm | The paradigm to work under. |
InTraits | The traits to add. May contain nullptr values which will be ignored silently. |
|
inline |
Move a traitmark to this traitmark.
Paradigm | The paradigm to work under. |
InTraitmark | The traitmark to move. |
FString FTraitmark::ToString | ( | ) | const |
Convert a traitmark to a string.
|
inline |
Get a trait type by its index.
|
inline |
The number of traits in the traitmark.
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
Serialization operator.
|
friend |
|
friend |
|
friend |
|
static |
An empty traitmark constant.