MacStd
OS X API using Standard C++
Loading...
Searching...
No Matches
IOKit.hpp
1/*
2 SPDX-License-Identifier: MIT
3 Copyright © 2024 Amebis
4*/
5
6#pragma once
7
8#include "common.hpp"
9#import <IOKit/IOKitLib.h>
10
11namespace macstd {
15 template <typename T>
16 class io_object : public handle<T, 0>
17 {
18 MACSTD_HANDLE_IMPL(io_object, T, 0)
19
20 public:
26 virtual ~io_object()
27 {
28 if (this->m_h != 0)
30 }
31
32 protected:
38 void free_internal() noexcept override
39 {
40 IOObjectRelease(this->m_h);
41 }
42 };
43
44 using io_connect = io_object<io_connect_t>;
45 using io_enumerator = io_object<io_enumerator_t>;
46 using io_ident = io_object<io_ident_t>;
47 using io_iterator = io_object<io_iterator_t>;
48 using io_registry_entry = io_object<io_registry_entry_t>;
49 using io_service = io_object<io_service_t>;
50 using uext_object = io_object<uext_object_t>;
51}
52
Base abstract template class to support generic object handle keeping.
Definition common.hpp:70
T m_h
Definition common.hpp:312
IOKit handle wrapper class.
Definition IOKit.hpp:17
virtual ~io_object()
Releases an object handle.
Definition IOKit.hpp:26
void free_internal() noexcept override
Releases an object handle.
Definition IOKit.hpp:38