|
Botcraft 26.3
|
A dynamic field that can hold different data inheriting a common BaseType (derived from NetworkType). More...
#include <DynamicType.hpp>
Static Public Member Functions | |
| template<typename C > | |
| static std::shared_ptr< BaseType > | Read (const C *c, std::vector< unsigned char >::const_iterator &iter, size_t &length) |
| template<typename C > | |
| static void | Write (const C *c, const std::shared_ptr< BaseType > &val, std::vector< unsigned char > &container) |
| template<typename C > | |
| static std::optional< Json::Value > | Serialize (const C *c, const std::shared_ptr< BaseType > &val) |
A dynamic field that can hold different data inheriting a common BaseType (derived from NetworkType).
Cannot be used inside a container like a vector
| BaseType | Common base class of every possible data type |
| TypeField | Pointer to the type field (e.g. &MyNetworkClass::Type) |
| Factory | Function pointer. Should have a signature std::shared_ptr<Base>(TypeValue) |
Definition at line 19 of file DynamicType.hpp.
|
inlinestatic |
Definition at line 22 of file DynamicType.hpp.
|
inlinestatic |
Definition at line 69 of file DynamicType.hpp.
|
inlinestatic |
Definition at line 55 of file DynamicType.hpp.