enhance io options
This commit is contained in:
@@ -25,16 +25,23 @@ class Stream {
|
||||
protected:
|
||||
MessageDispatcher m_Dispatcher;
|
||||
IOInterface<IOTag> m_Interface;
|
||||
std::tuple<TOptions...> m_Options;
|
||||
|
||||
using MessageBase = typename MessageDispatcher::MessageBaseType;
|
||||
|
||||
public:
|
||||
Stream() {}
|
||||
Stream(IOInterface<IOTag>&& a_Interface);
|
||||
Stream(IOInterface<IOTag>&& a_Interface, TOptions&&... a_Options);
|
||||
Stream(Stream&& a_Stream);
|
||||
|
||||
void RecieveMessages(const TOptions&... a_Options);
|
||||
void SendMessage(const MessageBase& a_Message, const TOptions&... a_Options);
|
||||
void RecieveMessages();
|
||||
void SendMessage(const MessageBase& a_Message);
|
||||
|
||||
|
||||
template <typename TOption>
|
||||
TOption& GetOption() {
|
||||
return std::get<TOption>(m_Options);
|
||||
}
|
||||
|
||||
MessageDispatcher& GetDispatcher() {
|
||||
return m_Dispatcher;
|
||||
|
||||
Reference in New Issue
Block a user