PStack  2.0
Stack trace printer for MSVC and GCC binaries
default_close_handle.hpp
Go to the documentation of this file.
1 // ===-- include/psystem/framework/default_close_handle.hpp -*- C++ -*- --=== //
2 // Copyright (c) 2014 Matt Bisson. All rights reserved.
18 #pragma once
19 #ifndef PSYSTEM_FRAMEWORK_DEFAULT_CLOSE_HANDLE_HPP
20 #define PSYSTEM_FRAMEWORK_DEFAULT_CLOSE_HANDLE_HPP
21 
22 #include "platform.hpp"
23 
24 namespace psystem {
25 
48 template <typename T>
50 {
55  void operator()(T hndl) const noexcept
56  {
58  }
59 
64  static void close_handle(T hndl) noexcept
65  {
67  ::CloseHandle(hndl);
68  }
69 };
70 
71 } // namespace psystem
72 
73 #endif // PSYSTEM_FRAMEWORK_DEFAULT_CLOSE_HANDLE_HPP
A simple functor to close handles (for use with RAII handle containers).
Definition: default_close_handle.hpp:49
Master header file for Platform-wide declarations.
#define noexcept
Replace keyword with something useful.
Definition: platform.hpp:71
static void close_handle(T hndl) noexcept
Executes a handle clean-up routine without requiring an instance.
Definition: default_close_handle.hpp:64
Contains the process examination "system" and basic frameworks.
Definition: pstack_event_handler.hpp:28
void operator()(T hndl) const noexcept
Executes a handle clean-up routine.
Definition: default_close_handle.hpp:55