lintel 0.2.0
Loading...
Searching...
No Matches
ShmSegmentAccessor.h
Go to the documentation of this file.
1#ifndef LINTEL_SHMSEGMENTACCESSOR_H
2#define LINTEL_SHMSEGMENTACCESSOR_H
3
4#include <cstddef>
5
6namespace lintel {
21{
22public:
25 {
26 public:
27 virtual ~Allocator() = default;
28
33 virtual void *allocate(std::size_t bytes) = 0;
34
38 virtual void deallocate(void *pointer) = 0;
39 };
40
43
48 [[nodiscard]] void *allocate(std::size_t bytes) const { return m_allocator->allocate(bytes); }
49
53 void deallocate(void *pointer) const { m_allocator->deallocate(pointer); }
54
55private:
56 Allocator *m_allocator;
57};
58
59}// namespace lintel
60#endif// LINTEL_SHMSEGMENTACCESSOR_H
Definition ShmSegmentAccessor.h:25
virtual void * allocate(std::size_t bytes)=0
virtual void deallocate(void *pointer)=0
Definition ShmSegmentAccessor.h:21
ShmSegmentAccessor(Allocator &allocator) noexcept
Definition ShmSegmentAccessor.h:42
void deallocate(void *pointer) const
Definition ShmSegmentAccessor.h:53
void * allocate(std::size_t bytes) const
Definition ShmSegmentAccessor.h:48
Definition BaseFeature.h:6
constexpr std::string_view type_name()
Definition TypeName.h:9