haiku/headers/private/shared/AutoDeleterDrivers.h
X512 553f3f2309 AutoDeleter: add delarations for common types and destructors
Change-Id: I74b75a54038d5af370696302f33b5c0abab4820c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3481
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-12-13 19:14:13 +00:00

44 lines
828 B
C++

/*
* Copyright 2020, Haiku, Inc.
* Distributed under the terms of the MIT License.
*/
#ifndef _AUTO_DELETER_DRIVERS_H
#define _AUTO_DELETER_DRIVERS_H
#include <AutoDeleter.h>
#include <driver_settings.h>
#if defined(_KERNEL_MODE) && !defined(_BOOT_MODE)
#include <vfs.h>
#include <fs/fd.h>
#endif
namespace BPrivate {
typedef CObjectDeleter<void, status_t, unload_driver_settings> DriverSettingsUnloader;
#if defined(_KERNEL_MODE) && !defined(_BOOT_MODE)
typedef CObjectDeleter<struct vnode, void, vfs_put_vnode> VnodePutter;
typedef CObjectDeleter<file_descriptor, void, put_fd> DescriptorPutter;
#endif
}
using ::BPrivate::DriverSettingsUnloader;
#if defined(_KERNEL_MODE) && !defined(_BOOT_MODE)
using ::BPrivate::VnodePutter;
using ::BPrivate::DescriptorPutter;
#endif
#endif // _AUTO_DELETER_DRIVERS_H