stuff-from-scratch/src/core/memory/SharedMemory.h

23 lines
362 B
C
Raw Normal View History

2022-05-18 07:42:44 +00:00
#pragma once
#include <string>
class SharedMemory
{
public:
void allocate(const std::string& namePrefix, std::size_t size);
int getFileDescriptor() const;
bool isValid() const;
private:
void createFile(const std::string& namePrefix);
std::string getRandomName(const std::string& namePrefix) const;
int mFileDescriptor{0};
bool mIsValid{false};
};