Flow-IPC 3.0.0
Flow-IPC project: Full implementation reference.
native_socket_stream_batch.hpp
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#pragma once
20
24#include <flow/log/log.hpp>
25#include <utility>
26
27namespace ipc::transport
28{
29
30// Types.
31
32/**
33 * This is the `friend` facade of Native_socket_stream_msg_batch_in
34 * that exposes `private` APIs hidden from public user by providing public access to them; this is used internally
35 * by at least sync_io::Native_socket_stream impl. The background is briefly explained in the impl section of
36 * Native_socket_stream_msg_batch_in doc header.
37 *
38 * @tparam Base_t
39 * The type of object whose specific `private` API to expose:
40 * A concrete instance of class template Native_socket_stream_msg_batch_in.
41 */
42template<typename Base_t>
44{
45 // Types.
46
47 /// Alias for the wrapped object's type.
48 using Base = Base_t;
49
50 // Data.
51
52 /// Direct-initializable wrapped object. Access `public` API through this reference; `private` API via `*this`.
54
55 // Methods.
56
57 /**
58 * Forwards to same-named (private) privileged-API of #Base.
59 * @tparam Args
60 * See above.
61 * @param args
62 * See above.
63 * @return See above.
64 */
65 template<typename... Args>
66 bool nb_read(Args&&... args);
67}; // struct Native_socket_stream_msg_batch_in_privileged
68
69// Template implementations.
70
71template<typename Base_t>
72template<typename... Args>
74{
75 return m_base.nb_read(std::forward<Args>(args)...);
76}
77
78} // namespace ipc::transport
Flow-IPC module providing transmission of structured messages and/or low-level blobs (and more) betwe...
This is the friend facade of Native_socket_stream_msg_batch_in that exposes private APIs hidden from ...
Base & m_base
Direct-initializable wrapped object. Access public API through this reference; private API via *this.
bool nb_read(Args &&... args)
Forwards to same-named (private) privileged-API of Base.