RTTI
Run-time type information defining and querying.
Classes
-
IReflectable— Interface implemented by classes that provide run time type information. -
TRTTIType— Allows you to provide a run-time type information for a specific class, along with support for serialization/deserialization.
Structs
-
RTTIFieldInfo— Provides various optional information regarding a RTTI field. -
RTTIPlainType— Template that you may specialize with a class if you want to provide simple serialization for it. -
RTTIPlainTypeHelper— Helper that allows you to construct a RTTIPlainType <T > specialization more easily. -
RTTISchema— Contains serializable meta-data about a RTTIType. -
RTTIOperationContext— Provides information about the operation being performed on RTTIType objects.
Enums
-
RTTIFieldFlag— Various flags you can assign to RTTI fields. -
ReflectableObjectFlag— Flags that may be set on IReflectable objects. -
RTTIOperationType— List of operations that may be performed on a RTTIType object, to be used with RTTITypeOnOperationStarted/Ended notifies.
Free functions
B3DRTTISize
BitLength B3DRTTISize(const ElemType &data, bool compress = false)
Helper method when serializing known data types that have valid RTTIPlainType specialization.
Returns the size of the element when serialized.
B3DRTTIWrite
BitLength B3DRTTIWrite(const ElemType &data, Bitstream &stream, bool compress = false)
Helper method when serializing known data types that have valid RTTIPlainType specialization.
The data will be written to the provided stream and its write cursor advanced.
B3DRTTIRead
BitLength B3DRTTIRead(ElemType &data, Bitstream &stream, bool compress = false)
Helper method when serializing known data types that have valid RTTIPlainType specialization.
The data will be read from the provided stream and its read cursor advanced.
B3DRTTIWriteWithSizeHeader
BitLength B3DRTTIWriteWithSizeHeader(Bitstream &stream, const T &data, bool compress, P p)
Writes a set of data to the stream through the user provided function and then writes the size of that data as a header.
The size header is written as a 32-bit integer right before the data written by . The size value will include the size of the data from as well as the size of the header itself (32-bits). The size of the data is determined by the return value from . Returns the size written.
B3DRTTIReadSizeHeader
BitLength B3DRTTIReadSizeHeader(T &stream, bool compress, BitLength &size)
Reads the size header that was encoded with B3DRTTIWriteWithSizeHeader. contain the size value read from the stream, while the return value represents the number of bits read from the header itself (e.g. 4 bytes for uncompressed size).
B3DRTTIAddHeaderSize
inline void B3DRTTIAddHeaderSize(BitLength &size, bool compress)
Increments the provided size with the required size of the header.
B3DRTTIIsOfType
bool B3DRTTIIsOfType(IReflectable *object)
Returns true if the provided object can be safely cast into type T.
B3DRTTIIsOfType
bool B3DRTTIIsOfType(SPtr<IReflectable> object)
Returns true if the provided object can be safely cast into type T.
B3DRTTICreate
SPtr<IReflectable> B3DRTTICreate(u32 rttiId)
Creates a new object just from its type ID.
B3DRTTIIsSubclass
bool B3DRTTIIsSubclass(const IReflectable *object)
Checks is the current object a subclass of some type.
B3DRTTIIsSubclass
bool B3DRTTIIsSubclass(const SPtr<IReflectable> &object)
Checks is the current object a subclass of some type.
B3DRTTICast
T *B3DRTTICast(const IReflectable *object)
Attempts to cast the object to the provided type, or returns null if cast is not valid.
B3DRTTICast
SPtr<T> B3DRTTICast(const SPtr<IReflectable> object)
Attempts to cast the object to the provided type, or returns null if cast is not valid.
B3DGetTypeNameFromPrettyFunction
constexpr std::string_view B3DGetTypeNameFromPrettyFunction()
Returns the type name for the class , using the 'pretty function' macro provided by many compilers.
B3DGetTypeHash
constexpr HashType B3DGetTypeHash()
Computes a hash value for the current class name.
Uses B3DGetTypeNameFromPrettyFunction() to compute the hash from.
B3DGetRuntimeTypeId
constexpr TypeId B3DGetRuntimeTypeId()
Returns a unique type identifier for the provided type.
Internal
Symbols intended for engine-internal use. Not part of the public API.
Classes
-
IRTTIIterator— Interface for a RTTI iterator. -
TRTTIIterator— Wraps a container that can be used for sequentially reading container contents, inserting new elements in the container, and retrieving container element count. -
RTTIType— Provides an interface for accessing fields of a certain class.
Structs
-
TRTTIPlainTypeImplementation— Default implementation of RTTIPlainType for a particular type T. -
B3DHasRTTIPlainTypeSpecialization— Checks has the user specialized RTTIPlainType <T > for T. -
RTTIWriteProcessor— Helper that calls B3DRTTIWrite() using operator(), and accumulates written size. -
RTTIReadProcessor— Helper that calls B3DRTTIRead() using operator(). -
RTTISizeProcessor— Helper that calls B3DRTTISize() using operator(). -
TRTTIIteratorAdapter— Provides an adapter that allows TRTTIIterator <T > to iterate over some type T that might not provide the default iterator interface. -
TRTTIIterator::HasKeyType -
TRTTIIterator::HasFind -
TRTTIIteratorDeleter— Deleter that can be passed to unique pointer referencing TRTTIIterator <DataType , IsContainer>. -
RTTIFieldDataTypeSchema— Information about a type stored in a RTTIField. -
RTTIFieldSchema— Contains serializable meta-data about a single RTTI field. -
RTTIField— Structure that keeps meta-data concerning a single class field. -
RTTIIteratorField— Provides interface to be implemented by specializations of TRTTIIteratorField. -
TRTTIIteratorField— RTTI field type that supports iteration over arbitrary containers, including maps. -
RTTIDataBlockFieldBase— Base class containing common functionality for a data block class field. -
RTTIDataBlockField— Class containing a data block field containing a specific type. -
InitRTTIOnStart— Used for initializing a certain type as soon as the program is loaded. -
GetRttiType— Template that returns RTTI type of the specified type, unless the specified type is IReflectable in which case it returns a null.
Enums
-
RTTIFieldDataType— Data types we can serialize: - Reflectable - Reference to an object implementing the IReflectable interface. -
RTTIFieldType— Field type that is used for accessing data for a particular field in a RTTIType.
Free functions
IsReflectable
constexpr bool IsReflectable()
Checks is the provided type a value type deriving from IReflectable.
IsPlain
constexpr bool IsPlain()
Checks is the provided type a plain type (implements the RTTIPlainType <T > specialization).
CreateFieldTypeSchema
RTTIFieldDataTypeSchema CreateFieldTypeSchema(const RTTIFieldInfo &fieldInfo)
Creates a schema for a type stored in a field.
ReadPlainType
void ReadPlainType(T &value, Bitstream &stream, const RTTIFieldInfo &info, bool useCompression)
Reads the provided plain object from the stream.
WritePlainType
void WritePlainType(const T &value, Bitstream &stream, const RTTIFieldInfo &info, bool useCompression)
Writes the provided plain object to the stream.
GetPlainTypeSize
BitLength GetPlainTypeSize(const T &value, const RTTIFieldInfo &info, bool useCompression)
Returns the size of the provided plain object.
SetReflectableValue
void SetReflectableValue(T &value, const IReflectable &reflectable)
Assigns the reflectable value to the provided field value.
GetReflectableValue
const IReflectable &GetReflectableValue(const T &value)
Reads the reflectable value from the provided field value.
SetReflectablePointerValue
void SetReflectablePointerValue(T &value, const SPtr<IReflectable> &reflectable)
Assigns the reflectable pointer to the provided field value.
GetReflectablePointerValue
SPtr<IReflectable> GetReflectablePointerValue(const T &value)
Reads the reflectable pointer from the provided field value.