Flow-IPC 1.0.0
Flow-IPC project: Full implementation reference.
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
21namespace ipc::session::shm
22{
23
24// Types.
25
26/**
27 * Implementation of #Arena_to_shm_session_t. See specializations which actually contain the mapping for
28 * specific `Arena` types; for example: classic::Arena_to_shm_session,
29 * arena_lend::jemalloc::Arena_to_shm_session.
30 */
31template<typename Arena>
33{
34 /// Implementation of #Arena_to_shm_session_t. There is no default mapping; see specializations.
35 using Type = void;
36};
37
38/**
39 * Alias that, given an `Arena` type (with `Arena::construct<T>()` which allocates/constructs a `T`), yields a
40 * `Shm_session` type over which one can `Shm_session::lend_object<T>()` so-constructed objects.
41 *
42 * Informally, for informational convenience:
43 * - Arena-sharing SHM-providers (classic::Pool_arena as of this writing), by definition, are symmetric, where
44 * each side can both lend and borrow, allocate and write within the same `Arena`. Hence they will
45 * map `Arena` to itself. The `Arena` object also acts as the `Shm_session`.
46 * - Arena-lending SHM-providers (arena_lend::jemalloc as of this writing), by definition, are asymmetric;
47 * the borrowing side can only read, not allocate. Hence they will map `Arena` to a different dedicated
48 * `Shm_session` type.
49 *
50 * @tparam Arena
51 * SHM arena type that has method of the form `shared_ptr<T> construct<T>(...)`.
52 */
53template<typename Arena>
55
56} // namespace ipc::session::shm
ipc::session sub-namespace that groups together facilities for SHM-backed sessions,...
Definition: classic_fwd.hpp:24
typename Arena_to_shm_session< Arena >::Type Arena_to_shm_session_t
Alias that, given an Arena type (with Arena::construct<T>() which allocates/constructs a T),...
Definition: shm.hpp:54
Implementation of Arena_to_shm_session_t.
Definition: shm.hpp:33
void Type
Implementation of Arena_to_shm_session_t. There is no default mapping; see specializations.
Definition: shm.hpp:35