Skip to content

Latest commit

 

History

History
21 lines (18 loc) · 1.02 KB

README.md

File metadata and controls

21 lines (18 loc) · 1.02 KB

process_handle Build Status Build status

A cross platform wrapper around system native handles that allows copying and RAII based leak freedom.

installation

the library is headers only so copying it into your project directory and including it is enough.

quick reference

Default constructed process_handle is a handle to our own process. It is also possible to construct process_handle using a process id or an already existing handle.

#include "process_handle.hpp"

jm::process_handle h;
h.owner_id(); // will be our own process id
auto native_handle = h.native(); // returns the OS specific native handle
if(h) { // conversion operator to bool
	h.reset(); // invalidates the handle stored in h
	h.reset(native_handle); // or replaces it with a new one
}