Flow-IPC
1.0.0
Flow-IPC project: Full implementation reference.
session
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
namespace
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
*/
31
template
<
typename
Arena>
32
struct
Arena_to_shm_session
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
*/
53
template
<
typename
Arena>
54
using
Arena_to_shm_session_t
=
typename
Arena_to_shm_session<Arena>::Type
;
55
56
}
// namespace ipc::session::shm
ipc::session::shm
ipc::session sub-namespace that groups together facilities for SHM-backed sessions,...
Definition:
classic_fwd.hpp:24
ipc::session::shm::Arena_to_shm_session_t
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
ipc::session::shm::Arena_to_shm_session
Implementation of Arena_to_shm_session_t.
Definition:
shm.hpp:33
ipc::session::shm::Arena_to_shm_session::Type
void Type
Implementation of Arena_to_shm_session_t. There is no default mapping; see specializations.
Definition:
shm.hpp:35
Generated on Wed Mar 20 2024 06:27:27 for Flow-IPC by
1.9.4