Flow-IPC
3.0.0
Flow-IPC project: Full implementation reference.
shm
shm.hpp
Go to the documentation of this file.
1
/* Flow-IPC: Shared Memory
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
#pragma once
20
21
#include "
ipc/shm/shm_fwd.hpp
"
22
23
// (See shm_fwd.hpp for doc header for this namespace.)
24
namespace
ipc::shm
25
{
26
27
// Types.
28
29
/**
30
* Implementation of #Arena_to_borrower_allocator_arena_t. See specializations which actually contain the mapping for
31
* specific `Arena` types; for example: `Arena_to_borrower_allocator_arena<classic::Pool_arena>`,
32
* `Arena_to_borrower_allocator_arena<arena_lend::jemalloc::Ipc_arena>`.
33
*/
34
template
<
typename
Arena>
35
struct
Arena_to_borrower_allocator_arena
36
{
37
/// Implementation of #Arena_to_borrower_allocator_arena_t. There is no default mapping; see specializations.
38
using
Type
= void;
39
};
40
41
/**
42
* Alias that, given an `Arena` type (with `Arena::construct<T>()` which allocates/constructs a `T`), yields a
43
* `Borrower_allocator_arena` type which can be used as the `Arena` arg to stl::Stateless_allocator for the
44
* borrower-side counterpart `T`, usable in `Shm_session::borrow_object<T>()` to recover so-constructed
45
* objects.
46
*
47
* Informally, for informational convenience:
48
* - Arena-sharing SHM-providers (classic::Pool_arena as of this writing), by definition, are symmetric, where
49
* each side can both lend and borrow, allocate and write within the same `Arena`. Hence they will
50
* map `Arena` to itself.
51
* - Arena-lending SHM-providers (arena_lend::jemalloc as of this writing), by definition, are asymmetric;
52
* the borrowing side can only read, not allocate. Hence they will map `Arena` to a different borrower-arena
53
* type only whose `Pointer` *type* member shall be used.
54
*
55
* @tparam Arena
56
* SHM arena type that has method of the form `shared_ptr<T> construct<T>(...)`.
57
*/
58
template
<
typename
Arena>
59
using
Arena_to_borrower_allocator_arena_t
=
typename
Arena_to_borrower_allocator_arena<Arena>::Type
;
60
61
}
// namespace ipc::shm
ipc::shm
Modules for SHared Memory (SHM) support.
Definition:
bipc_ext_fwd.hpp:29
ipc::shm::Arena_to_borrower_allocator_arena_t
typename Arena_to_borrower_allocator_arena< Arena >::Type Arena_to_borrower_allocator_arena_t
Alias that, given an Arena type (with Arena::construct<T>() which allocates/constructs a T),...
Definition:
shm.hpp:59
shm_fwd.hpp
ipc::shm::Arena_to_borrower_allocator_arena
Implementation of Arena_to_borrower_allocator_arena_t.
Definition:
shm.hpp:36
ipc::shm::Arena_to_borrower_allocator_arena::Type
void Type
Implementation of Arena_to_borrower_allocator_arena_t. There is no default mapping; see specializatio...
Definition:
shm.hpp:38
Generated on Sun Nov 8 2026 04:29:55 for Flow-IPC by
1.9.4