CatapultServer
v0.5.0.1 (Elephant)
|
Go to the documentation of this file.
24 namespace catapult {
namespace model {
30 template<
typename TDerived,
typename TVariableDataType>
40 return derived.Size != TDerived::CalculateRealSize(derived) ? nullptr :
ToBytePointer(derived) +
sizeof(T);
45 return reinterpret_cast<const TVariableDataType*>(pData);
50 return reinterpret_cast<TVariableDataType*>(pData);
55 return reinterpret_cast<const uint8_t*>(&derived);
59 return reinterpret_cast<uint8_t*>(&derived);
static auto PayloadStart(T &derived)
Gets the start of the variable data part of derived.
Definition: TrailingVariableDataLayout.h:39
static uint8_t * ToBytePointer(TDerived &derived)
Definition: TrailingVariableDataLayout.h:58
uint32_t Size
Data size.
Definition: TrailingVariableDataLayout.h:34
DEFINE_OBSERVER(AccountAddress, model::AccountAddressNotification, [](const auto ¬ification, const auto &context) { DefaultAccountVisitor visitor(context);visitor.visit(notification.Address);})
static const uint8_t * ToBytePointer(const TDerived &derived)
Definition: TrailingVariableDataLayout.h:54
static TVariableDataType * ToTypedPointer(uint8_t *pData)
Gets a typed pointer to the variable data pData.
Definition: TrailingVariableDataLayout.h:49
Definition: AddressExtractionExtension.cpp:28
static const TVariableDataType * ToTypedPointer(const uint8_t *pData)
Gets a typed pointer to the variable data pData.
Definition: TrailingVariableDataLayout.h:44
Definition: TrailingVariableDataLayout.h:31