1 #ifndef CONTROLRESPONSE_H 2 #define CONTROLRESPONSE_H 9 std::memcpy(__data, &PROTOCOL_VERS, Block::VersionProtocol);
10 std::memcpy(__data+Block::VersionProtocol, &type_response, Block::Command);
13 virtual const void* get_data()
const override {
return __data; }
14 virtual void* get_data()
override {
return __data; }
16 virtual identifier_t get_loginid()
const {
17 return *(identifier_t *)(__data);
19 virtual uint32_t get_length_data()
const override {
return LengthResponse;}
20 virtual void set_loginid(identifier_t
id = 0) {
21 std::memcpy(__data, &
id, Block::LoginId);
24 const TypeCommand type_response = TypeCommand::Unknown;
25 static constexpr
auto LengthResponse = Block::LoginId;
26 char __data[LengthResponse];
37 std::memcpy(header, &PROTOCOL_VERS, Block::VersionProtocol);
38 std::memcpy(header+Block::VersionProtocol, &type_response, Block::Command);
41 std::memcpy(header, &PROTOCOL_VERS, Block::VersionProtocol);
42 std::memcpy(header+Block::VersionProtocol, &type_response, Block::Command);
43 std::memcpy(__data, &
id, Block::LoginId);
47 const TypeCommand type_response = TypeCommand::RegistrationResponse;
57 std::memcpy(header, &PROTOCOL_VERS, Block::VersionProtocol);
58 std::memcpy(header+Block::VersionProtocol, &type_response, Block::Command);
61 std::memcpy(header, &PROTOCOL_VERS, Block::VersionProtocol);
62 std::memcpy(header+Block::VersionProtocol, &type_response, Block::Command);
63 std::memcpy(__data, &
id, Block::LoginId);
66 std::memcpy(header, packet.get_data(), Block::Header);
69 std::memcpy(header, packet->get_data(), Block::Header);
72 const TypeCommand type_response = TypeCommand::AutorisationResponse;
75 using response_ptr = std::shared_ptr<Response>;
76 using input_res_ptr = std::shared_ptr<InputResponse>;
77 using registr_response_ptr = std::shared_ptr<RegistrationResponse>;
78 using autor_response_ptr = std::shared_ptr<AutorisationResponse>;
80 #endif // CONTROLRESPONSE_H
The RegistrationResponse class.
Definition: input_response.h:34
The AutorisationResponse class.
Definition: input_response.h:54