OpenVPN 3 Core Library
Loading...
Searching...
No Matches
usecount.hpp
Go to the documentation of this file.
1// OpenVPN -- An application to securely tunnel IP networks
2// over a single port, with support for SSL/TLS-based
3// session authentication and key exchange,
4// packet encryption, packet authentication, and
5// packet compression.
6//
7// Copyright (C) 2012- OpenVPN Inc.
8//
9// SPDX-License-Identifier: MPL-2.0 OR AGPL-3.0-only WITH openvpn3-openssl-exception
10//
11
12// General purpose class for scope accounting.
13
14#pragma once
15
16namespace openvpn {
17
19{
20 public:
26 explicit UseCount(int &count)
27 : count_(count)
28 {
29 ++count_;
30 }
31
32 /* make this class not copyable. */
33 UseCount(const UseCount &) = delete;
35
37 {
38 --count_;
39 }
40
41 private:
42 int &count_;
43};
44
45} // namespace openvpn
UseCount(int &count)
Definition usecount.hpp:26
UseCount(const UseCount &)=delete
UseCount & operator=(UseCount &)=delete