commandWriter.h (521B)
1 #pragma once 2 3 #include "commands.h" 4 5 #include "baseLib/binarystream.h" 6 7 namespace networkLib 8 { 9 class Stream; 10 } 11 12 namespace bridgeLib 13 { 14 class CommandWriter 15 { 16 public: 17 CommandWriter(); 18 19 baseLib::BinaryStream& build(Command _command); 20 21 baseLib::BinaryStream& build(const Command _command, const CommandStruct& _data); 22 23 void write(networkLib::Stream& _stream, bool _flush = true); 24 void write(baseLib::BinaryStream& _out); 25 26 private: 27 baseLib::BinaryStream m_stream; 28 Command m_command = Command::Invalid; 29 }; 30 }