5 #include "protocol/command_table.h" 10 std::memcpy(header, &PROTOCOL_VERS, Block::VersionProtocol);
12 DateTime datetime(boost::posix_time::second_clock::universal_time());
14 std::memcpy(header + Block::VersionProtocol + Block::Command, &datetime, Block::Datetime);
17 virtual const void* get_header()
const override {
return header; }
18 virtual void* get_header()
override {
return header; }
19 virtual const void* get_data()
const override {
return nullptr; }
20 virtual void* get_data()
override {
return nullptr; }
22 virtual uint16_t get_protocol_version()
const override {
return *(uint16_t*)header; }
24 virtual TypeCommand get_type()
const override {
return TypeCommand::Unknown; }
25 virtual TypeCommand get_type_data()
const override {
return *(TypeCommand*)(header + Block::VersionProtocol) ; }
27 virtual DateTime get_datetime()
const override 30 std::memcpy(&dt, header + Block::VersionProtocol + Block::Command, Block::Datetime);
34 virtual uint32_t get_length_data()
const override {
return 0; }
37 char header[Block::Header];
40 using request_ptr = std::shared_ptr<Request>;
Definition: command_table.h:73