enhance io options

This commit is contained in:
2025-03-01 11:12:18 +01:00
parent 9fa023f716
commit 254de7a9ee
5 changed files with 36 additions and 23 deletions

View File

@@ -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;