Flow-IPC 1.0.0
Flow-IPC project: Full implementation reference.
use_counted_object.cpp
Go to the documentation of this file.
1/* Flow-IPC: Core
2 * Copyright 2023 Akamai Technologies, Inc.
3 *
4 * Licensed under the Apache License, Version 2.0 (the
5 * "License"); you may not use this file except in
6 * compliance with the License. You may obtain a copy
7 * of the License at
8 *
9 * https://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in
12 * writing, software distributed under the License is
13 * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
14 * CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing
16 * permissions and limitations under the License. */
17
18/// @file
20
21namespace ipc::util
22{
23
25 m_use_count(1)
26{
27}
28
30{
31 return m_use_count;
32}
33
35{
37}
38
40{
41 assert(m_use_count > 1);
43}
44
45} // namespace ipc::util
void decrement_use()
Decrements the usage. The current count must be greater than one.
void increment_use()
Increments the usage.
unsigned int get_use_count() const
Returns the current usage.
unsigned int m_use_count
The current usage count.
Flow-IPC module containing miscellaneous general-use facilities that ubiquitously used by ~all Flow-I...