![]() |
Botcraft 1.21.4
|
Go to the source code of this file.
Macros | |
#define | DEFINE_CONDITION(Name, ...) private: bool Name() const { return __VA_ARGS__; } static_assert(true, "Forcing ;") |
Define a condition that can be used later inside an Internal::Conditioned type. | |
#define | _OFFSETS_DECLARATION(Name) |
#define | _OFFSETS_FIELDS_DATA_DECLARATION(Name) |
#define | SERIALIZED_FIELD_WITHOUT_GETTER_SETTER(Name, ...) |
Define a field that will be automatically integrated in Read/Write and Json serialization We start by retrieving the SerializedType of the given type and create the actual class member. | |
#define | GETTER(Name) |
#define | SETTER(Name) |
#define | GETTER_SETTER(Name) GETTER(Name); SETTER(Name) |
#define | SERIALIZED_FIELD(Name, ...) |
#define | DECLARE_READ protected: virtual void ReadImpl(ReadIterator& iter, size_t& length) override |
Declare ReadImpl virtual function for auto serializable types. | |
#define | DECLARE_WRITE protected: virtual void WriteImpl(WriteContainer& container) const override |
Declare WriteImpl virtual function for auto serializable types. | |
#define | DECLARE_SERIALIZE protected: virtual Json::Value SerializeImpl() const override |
Declare SerializeImpl virtual function for auto serializable types. | |
#define | _DEFINE_OFFSETS_UTILITIES |
#define | DEFINE_UTILITIES |
Define some constexpr utilities used to deal with the auto serializable fields We use void as the unique identifier type template parameter for FieldsData as we are sure it'll be different from what was used for the fields. | |
#define | DECLARE_READ_WRITE_SERIALIZE DEFINE_UTILITIES; DECLARE_READ; DECLARE_WRITE; DECLARE_SERIALIZE |
Define auto serializable utilities and declare ReadImpl, WriteImpl and SerializeImpl virtual functions. | |
#define | _OFFSETS_POINTERS |
#define | DEFINE_READ(ClassName) |
Define ReadImpl virtual function that loops through all auto serializable fields. | |
#define | DEFINE_WRITE(ClassName) |
Define WriteImpl virtual function that loops through all auto serializable fields. | |
#define | DEFINE_SERIALIZE(ClassName) |
#define | DEFINE_NETWORK_TYPE(ClassName) |
#define | DEFINE_MESSAGE_CLASS(ClassName) |
#define _DEFINE_OFFSETS_UTILITIES |
Definition at line 100 of file AutoSerializedMacros.hpp.
#define _OFFSETS_DECLARATION | ( | Name | ) |
Definition at line 19 of file AutoSerializedMacros.hpp.
#define _OFFSETS_FIELDS_DATA_DECLARATION | ( | Name | ) |
Definition at line 20 of file AutoSerializedMacros.hpp.
#define _OFFSETS_POINTERS |
Definition at line 128 of file AutoSerializedMacros.hpp.
#define DECLARE_READ protected: virtual void ReadImpl(ReadIterator& iter, size_t& length) override |
Declare ReadImpl virtual function for auto serializable types.
Definition at line 82 of file AutoSerializedMacros.hpp.
#define DECLARE_READ_WRITE_SERIALIZE DEFINE_UTILITIES; DECLARE_READ; DECLARE_WRITE; DECLARE_SERIALIZE |
Define auto serializable utilities and declare ReadImpl, WriteImpl and SerializeImpl virtual functions.
Definition at line 123 of file AutoSerializedMacros.hpp.
#define DECLARE_SERIALIZE protected: virtual Json::Value SerializeImpl() const override |
Declare SerializeImpl virtual function for auto serializable types.
Definition at line 86 of file AutoSerializedMacros.hpp.
#define DECLARE_WRITE protected: virtual void WriteImpl(WriteContainer& container) const override |
Declare WriteImpl virtual function for auto serializable types.
Definition at line 84 of file AutoSerializedMacros.hpp.
#define DEFINE_CONDITION | ( | Name, | |
... | |||
) | private: bool Name() const { return __VA_ARGS__; } static_assert(true, "Forcing ;") |
Define a condition that can be used later inside an Internal::Conditioned type.
Definition at line 4 of file AutoSerializedMacros.hpp.
#define DEFINE_MESSAGE_CLASS | ( | ClassName | ) |
Definition at line 239 of file AutoSerializedMacros.hpp.
#define DEFINE_NETWORK_TYPE | ( | ClassName | ) |
Definition at line 233 of file AutoSerializedMacros.hpp.
#define DEFINE_READ | ( | ClassName | ) |
Define ReadImpl virtual function that loops through all auto serializable fields.
Definition at line 131 of file AutoSerializedMacros.hpp.
#define DEFINE_SERIALIZE | ( | ClassName | ) |
Definition at line 205 of file AutoSerializedMacros.hpp.
#define DEFINE_UTILITIES |
Define some constexpr utilities used to deal with the auto serializable fields We use void as the unique identifier type template parameter for FieldsData as we are sure it'll be different from what was used for the fields.
Definition at line 106 of file AutoSerializedMacros.hpp.
#define DEFINE_WRITE | ( | ClassName | ) |
Define WriteImpl virtual function that loops through all auto serializable fields.
Definition at line 175 of file AutoSerializedMacros.hpp.
#define GETTER | ( | Name | ) |
Definition at line 62 of file AutoSerializedMacros.hpp.
Definition at line 75 of file AutoSerializedMacros.hpp.
#define SERIALIZED_FIELD | ( | Name, | |
... | |||
) |
Definition at line 77 of file AutoSerializedMacros.hpp.
#define SERIALIZED_FIELD_WITHOUT_GETTER_SETTER | ( | Name, | |
... | |||
) |
Define a field that will be automatically integrated in Read/Write and Json serialization We start by retrieving the SerializedType of the given type and create the actual class member.
Then we find the index of this field by counting how many FieldsData<size_t, T> template class have already been defined. Last part defines a templated FieldsData struct with all the name/type/member pointer info for this field. For the name, we want to define it in PascalCase but we also need a camel_case litteral version for json serialization, hence the constexpr string processing For field_ptr we don't know the name of the current class so to avoid passing it to the macro we use a template class instead. See GetField in DEFINE_UTILITIES for example of how to use it.
name | field name |
... | field type (passed as VA_ARGS because it can contain some ,) /!\ if Name == Type, use the fully qualified type instead (like ProtocolCraft::Type instead of Type) |
Definition at line 35 of file AutoSerializedMacros.hpp.
#define SETTER | ( | Name | ) |
Definition at line 68 of file AutoSerializedMacros.hpp.