JustasMasiulis / process_handle

A cross platform, leak free system handle wrapper

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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
}

About

A cross platform, leak free system handle wrapper

License:Apache License 2.0


Languages

Language:C++ 91.9%Language:CMake 8.1%