Add any-type container to serialization streams
This commit is contained in:
parent
1d35ed2abb
commit
1770a83bdc
1 changed files with 7 additions and 0 deletions
|
|
@ -1,6 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <psemek/io/stream.hpp>
|
||||
#include <psemek/util/any_set.hpp>
|
||||
|
||||
namespace psemek::sir
|
||||
{
|
||||
|
|
@ -58,9 +59,12 @@ namespace psemek::sir
|
|||
|
||||
std::size_t offset() const { return offset_; }
|
||||
|
||||
util::any_set & context() { return context_; }
|
||||
|
||||
private:
|
||||
io::istream & s_;
|
||||
std::size_t offset_ = 0;
|
||||
util::any_set context_;
|
||||
};
|
||||
|
||||
struct ostream
|
||||
|
|
@ -81,9 +85,12 @@ namespace psemek::sir
|
|||
|
||||
std::size_t offset() const { return offset_; }
|
||||
|
||||
util::any_set & context() { return context_; }
|
||||
|
||||
private:
|
||||
io::ostream & s_;
|
||||
std::size_t offset_ = 0;
|
||||
util::any_set context_;
|
||||
};
|
||||
|
||||
struct null_istream
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue