aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/winapi/shmem.hpp
diff options
context:
space:
mode:
authorEgor Tensin <egor@tensin.name>2026-06-12 17:49:43 +0200
committerEgor Tensin <egor@tensin.name>2026-06-12 22:39:06 +0200
commit6a335fcca28693aa9039ad4e8a13ff71e9d2f9cd (patch)
treeda2c0a81932306c52d192425743e5c9efe4ae88a /include/winapi/shmem.hpp
parentminor fixes (diff)
downloadwinapi-common-6a335fcca28693aa9039ad4e8a13ff71e9d2f9cd.tar.gz
winapi-common-6a335fcca28693aa9039ad4e8a13ff71e9d2f9cd.zip
unify my .clang-format files
Diffstat (limited to 'include/winapi/shmem.hpp')
-rw-r--r--include/winapi/shmem.hpp25
1 files changed, 19 insertions, 6 deletions
diff --git a/include/winapi/shmem.hpp b/include/winapi/shmem.hpp
index aecae85..c240d49 100644
--- a/include/winapi/shmem.hpp
+++ b/include/winapi/shmem.hpp
@@ -31,9 +31,13 @@ public:
static SharedMemory open(std::string_view name);
/** Get pointer to the data. */
- void* get() const { return m_addr.get(); }
+ void* get() const {
+ return m_addr.get();
+ }
/** @overload */
- void* ptr() const { return get(); }
+ void* ptr() const {
+ return get();
+ }
private:
struct Unmap {
@@ -87,12 +91,21 @@ public:
}
/** Get pointer to the object. */
- T* ptr() const { return reinterpret_cast<T*>(m_shmem.ptr()); }
+ T* ptr() const {
+ return reinterpret_cast<T*>(m_shmem.ptr());
+ }
/** Get reference to the object. */
- T& get() const { return *ptr(); }
+ T& get() const {
+ return *ptr();
+ }
- T* operator->() const { return ptr(); }
- T& operator*() const { return get(); }
+ T* operator->() const {
+ return ptr();
+ }
+
+ T& operator*() const {
+ return get();
+ }
private:
explicit SharedObject(SharedMemory&& shmem) : m_shmem{std::move(shmem)} {}