stuff-from-scratch/src/core/memory/SharedMemory.h
2022-05-18 08:42:44 +01:00

22 lines
362 B
C++

#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};
};