#pragma once #include "lib/utils/bts_no_copy.h" #include "lib/utils/bts_export.h" #include #include #include /*pair*/ namespace bts { namespace utils { typedef uint8_t byte; struct Segment { size_t size; byte* address; operator bool() const { return size != 0 && address != nullptr; } }; struct LowLevelSharedMemory { virtual ~LowLevelSharedMemory() {}; virtual Segment create(const std::string& name, size_t size) = 0; virtual const Segment open(const std::string& name, bool read_only) = 0; virtual bool release(const std::string& name) = 0; }; BTS_EXPORT std::unique_ptr create_low_level_shared_memory(bool shared); }}//namespace