Stroika Library 3.0d16
 
Loading...
Searching...
No Matches
Handle.h
1/*
2 * Copyright(c) Sophist Solutions, Inc. 1990-2025. All rights reserved
3 */
4#ifndef _Stroika_Foundation_Memory_OS_Win32_Handle_h_
5#define _Stroika_Foundation_Memory_OS_Win32_Handle_h_ 1
6
7#include "Stroika/Foundation/StroikaPreComp.h"
8
9#if qStroika_Foundation_Common_Platform_Windows
10#include <Windows.h>
11#endif
12
13#include <memory>
14
15#include "Stroika/Foundation/Common/Common.h"
16#include "Stroika/Foundation/Memory/Common.h"
17
18namespace Stroika::Foundation::Memory::Platform::Windows {
19
20 /**
21 */
22 class StackBasedHandleLocker {
23 public:
24 StackBasedHandleLocker () = delete;
25 StackBasedHandleLocker (HANDLE h);
26 StackBasedHandleLocker (const StackBasedHandleLocker&) = delete;
27
28 public:
29 ~StackBasedHandleLocker ();
30
31 public:
32 const StackBasedHandleLocker& operator= (const StackBasedHandleLocker&) = delete;
33
34 public:
35 /**
36 */
37 nonvirtual byte* GetPointer () const;
38
39 public:
40 /**
41 */
42 nonvirtual size_t GetSize () const;
43
44 private:
45 HANDLE fHandle_;
46 byte* fPointer_;
47 };
48
49}
50
51/*
52 ********************************************************************************
53 ***************************** Implementation Details ***************************
54 ********************************************************************************
55 */
56#include "Handle.inl"
57
58#endif /*_Stroika_Foundation_Memory_OS_Win32_Handle_h_*/