CatapultServer
v0.5.0.1 (Elephant)
|
Go to the documentation of this file.
25 namespace catapult {
namespace ionet {
53 template<
typename TValue>
55 require(
sizeof(TValue),
"readFixed");
59 const auto& value = reinterpret_cast<const TValue&>(*
m_pData);
65 template<
typename TEntity>
67 auto pSize = readFixed<uint32_t>();
73 require(*pSize,
"readVariable");
77 const auto& entity = reinterpret_cast<const TEntity&>(*
m_pData);
83 void require(uint32_t numBytes,
const char* message) {
#define CATAPULT_LOG(SEV)
Writes a log entry to the default logger with SEV severity.
Definition: Logging.h:340
A packet header with a data payload.
Definition: Packet.h:32
def warning(*args)
Definition: colorPrint.py:10
bool hasError() const
Returns true if a reading error has been encountered, false otherwise.
Definition: PacketReader.h:47
bool empty() const
Returns true if the reader has consumed all data, false otherwise.
Definition: PacketReader.h:42
PacketReader(const Packet &packet)
Creates a reader around packet.
Definition: PacketReader.h:32
const TEntity * readVariable()
Reads a variable-sized value from the packet.
Definition: PacketReader.h:66
void rewind(uint32_t numBytes)
Definition: PacketReader.h:96
std::vector< uint8_t > Data
Definition: tools/benchmark/main.cpp:33
bool m_hasError
Definition: PacketReader.h:104
Definition: PacketReader.h:29
void require(uint32_t numBytes, const char *message)
Definition: PacketReader.h:83
uint32_t m_numRemainingBytes
Definition: PacketReader.h:103
Definition: AddressExtractionExtension.cpp:28
const TValue * readFixed()
Reads a fixed-sized value from the packet.
Definition: PacketReader.h:54
void advance(uint32_t numBytes)
Definition: PacketReader.h:91
const uint8_t * m_pData
Definition: PacketReader.h:102