acme
Foundational cross-platform layer of the ca2 framework
Loading...
Searching...
No Matches
handle.h
1// Created by camilo on 2023-03-14 05:56 <3ThomasBorregaardSorensen!!
2#pragma once
3
4
5#include "acme/filesystem/file/exception.h"
6
7
8namespace windows
9{
10
11
12 class CLASS_DECL_ACME handle
13 {
14 public:
15
16
17 ::uptr m_u;
18
19
20 handle(::uptr u = ULLONG_MAX);
21 ~handle();
22
23
24 handle & operator = (::uptr u);
25
26 void close_handle();
27
28
29 operator ::uptr() const { return m_u; }
30 operator ::uptr & () { return m_u; }
31
32
33 bool nok() const { return m_u == ULLONG_MAX || m_u == NULL; }
34 bool is_ok() const { return !nok(); }
35
36
37 };
38
39
40} // namespace windows
41
42
43