#ifndef __SHAREDMEMORY_POSIX_H_ #define __SHAREDMEMORY_POSIX_H_ #ifdef __cplusplus #include #include #include "icsneo/api/eventmanager.h" namespace icsneo { class SharedMemory { public: SharedMemory() : report(makeEventHandler()) {}; ~SharedMemory(); bool open(const std::string& name, uint32_t size, bool create = false); bool close(); uint8_t* data(); private: virtual device_eventhandler_t makeEventHandler() { return [](APIEvent::Type type, APIEvent::Severity severity) { EventManager::GetInstance().add(type, severity); }; } device_eventhandler_t report; std::optional mName; std::optional> mData; std::optional mCreated; }; } #endif // __cplusplus #endif