Flow-IPC
1.0.2
Flow-IPC project: Full implementation reference.
util
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
19
#include "
ipc/util/use_counted_object.hpp
"
20
21
namespace
ipc::util
22
{
23
24
Use_counted_object::Use_counted_object
() :
25
m_use_count(1)
26
{
27
}
28
29
unsigned
int
Use_counted_object::get_use_count
()
const
30
{
31
return
m_use_count
;
32
}
33
34
void
Use_counted_object::increment_use
()
35
{
36
++
m_use_count
;
37
}
38
39
void
Use_counted_object::decrement_use
()
40
{
41
assert(
m_use_count
> 1);
42
--
m_use_count
;
43
}
44
45
}
// namespace ipc::util
ipc::util::Use_counted_object::decrement_use
void decrement_use()
Decrements the usage. The current count must be greater than one.
Definition:
use_counted_object.cpp:39
ipc::util::Use_counted_object::increment_use
void increment_use()
Increments the usage.
Definition:
use_counted_object.cpp:34
ipc::util::Use_counted_object::get_use_count
unsigned int get_use_count() const
Returns the current usage.
Definition:
use_counted_object.cpp:29
ipc::util::Use_counted_object::Use_counted_object
Use_counted_object()
Constructor.
Definition:
use_counted_object.cpp:24
ipc::util::Use_counted_object::m_use_count
unsigned int m_use_count
The current usage count.
Definition:
use_counted_object.hpp:54
ipc::util
Flow-IPC module containing miscellaneous general-use facilities that ubiquitously used by ~all Flow-I...
Definition:
default_init_allocator.hpp:24
use_counted_object.hpp
Generated on Thu May 2 2024 23:56:38 for Flow-IPC by
1.9.4