Flow-IPC 1.0.1
Flow-IPC project: Full implementation reference.
|
Implements the Session concept when it is in PEER state. More...
#include <session.hpp>
Public Types | |
using | Channel_obj = typename Impl::Channel_obj |
Implements Session API per contract. More... | |
using | Channels = typename Impl::Channels |
Container (vector<> ) of Channel_obj. More... | |
using | Mdt_payload_obj = typename Impl::Mdt_payload_obj |
Implements Session API per contract. More... | |
using | Mdt_builder = typename Impl::Mdt_builder |
Implements Session API per contract. More... | |
using | Mdt_builder_ptr = typename Impl::Mdt_builder_ptr |
Implements Session API per contract. More... | |
using | Mdt_reader_ptr = typename Impl::Mdt_reader_ptr |
Implements Session API per contract. More... | |
template<typename Message_body > | |
using | Structured_channel = typename transport::struc::Channel_via_heap< Channel_obj, Message_body > |
Implements Session API per contract. More... | |
using | Structured_msg_builder_config = typename Impl::Structured_msg_builder_config |
Implements Session API per contract. More... | |
using | Structured_msg_reader_config = typename Impl::Structured_msg_builder_config |
Implements Session API per contract. More... | |
Public Member Functions | |
Session_mv () | |
Implements Session API per contract. More... | |
Session_mv (Session_mv &&src) | |
Implements Session API per contract. More... | |
Session_mv (const Session_mv &)=delete | |
Copy ction is disallowed. | |
~Session_mv () | |
Implements Session API per contract. More... | |
Session_mv & | operator= (Session_mv &&src) |
Implements Session API per contract. More... | |
Session_mv & | operator= (const Session_mv &)=delete |
Copy assignment is disallowed. | |
Mdt_builder_ptr | mdt_builder () |
Implements Session API per contract. More... | |
bool | open_channel (Channel_obj *target_channel, const Mdt_builder_ptr &mdt, Error_code *err_code=0) |
Implements Session API per contract. More... | |
bool | open_channel (Channel_obj *target_channel, Error_code *err_code=0) |
Implements Session API per contract. More... | |
const Session_token & | session_token () const |
Implements Session API per contract. More... | |
transport::struc::Heap_fixed_builder::Config | heap_fixed_builder_config () |
Utility that obtains a heap-based (non-zero-copy) Struct_builder::Config, constructed with the most efficient yet safe values, for transport::struc::Msg_out (out-messages) compatible with Structured_channel upgraded-from Channel_obj channels opened via *this Session_mv. More... | |
transport::struc::Heap_reader::Config | heap_reader_config () |
Deserializing counterpart to non-static heap_fixed_builder_config(). More... | |
flow::log::Logger * | get_logger () const |
Returns logger (possibly null). More... | |
const flow::log::Component & | get_log_component () const |
Returns log component. More... | |
Static Public Member Functions | |
static transport::struc::Heap_fixed_builder::Config | heap_fixed_builder_config (flow::log::Logger *logger_ptr) |
Utility that obtains a heap-based (non-zero-copy) Struct_builder::Config, constructed with the most efficient yet safe values, for transport::struc::Msg_out (out-messages) compatible with Structured_channel upgraded-from Channel_obj channels opened via this Session_mv type. More... | |
static transport::struc::Heap_reader::Config | heap_reader_config (flow::log::Logger *logger_ptr) |
Deserializing counterpart to static heap_fixed_builder_config(). More... | |
Static Public Attributes | |
static constexpr schema::ShmType | S_SHM_TYPE = Impl::S_SHM_TYPE |
Implements Session API per contract. More... | |
static constexpr bool | S_SHM_ENABLED = Impl::S_SHM_ENABLED |
Implements Session API per contract. More... | |
static constexpr bool | S_MQS_ENABLED = Impl::S_MQS_ENABLED |
Compile-time-known constant indicating whether Channel_obj shall use a blobs pipe over message queues (MQs). More... | |
static constexpr bool | S_SOCKET_STREAM_ENABLED = Impl::S_SOCKET_STREAM_ENABLED |
Compile-time-known constant indicating whether Channel_obj shall use socket stream for any type of pipe. More... | |
Protected Types | |
using | Impl = Session_impl_t |
Short-hand for pImpl-lite impl type. This shall be the deepest impl sub-class desired. More... | |
using | Session_base_obj = typename Impl::Session_base_obj |
Short-hand for Impl's Session_base super-class. More... | |
using | Impl_ptr = std::experimental::propagate_const< boost::movelib::unique_ptr< Impl > > |
Short-hand for const -respecting wrapper around Impl for the pImpl idiom. See impl(). More... | |
Protected Member Functions | |
const Session_base_obj & | base () const |
Provides const access to Session_base super-object. More... | |
Impl_ptr & | impl () |
pImpl target; particularly for sub-classes that must add to the above public API. More... | |
const Impl_ptr & | impl () const |
pImpl target; particularly for sub-classes that must add to the above public API. More... | |
Private Attributes | |
Impl_ptr | m_impl |
The true implementation of this class. See also our class doc header. More... | |
Friends | |
template<typename Session_impl_t2 > | |
std::ostream & | operator<< (std::ostream &os, const Session_mv< Session_impl_t2 > &val) |
Friend of Session_mv. | |
Related Functions | |
(Note that these are not member functions.) | |
template<typename Session_impl_t > | |
std::ostream & | operator<< (std::ostream &os, const Session_mv< Session_impl_t > &val) |
Prints string representation of the given Session_mv to the given ostream . More... | |
Implements the Session concept when it is in PEER state.
It is, as of this writing, not to be instantiated by itself. Rather see Client_session_mv and Server_session_mv regarding what to actually instantiate and further context. As for the API in Session_mv itself, it is quite critical – but it only implements Session concept, and therefore the doc headers for Session_mv members generally just send you to Session doc headers. However the Session_mv doc headers are useful in enumerating specific Error_code values that may be emitted.
See pImpl-lite notes in Blob_stream_mq_sender doc header. The exact same applies here.
Furthermore, sub-classes – Client_session_mv, Server_session_mv – continue the pImpl-lite pattern for their added public APIs on top of the ones from this super-class. For this reason impl() is protected
. E.g., Client_session_mv doc header explains this hierarchy. In particular it explains what Session_impl_t
is to be set to properly.
This | is an implementation detail. See Client_session_mv and Server_session_mv doc headers for how to easily set this to the proper type in a given situation. |
Definition at line 504 of file session.hpp.
using ipc::session::Session_mv< Session_impl_t >::Channel_obj = typename Impl::Channel_obj |
Implements Session API per contract.
Definition at line 519 of file session.hpp.
using ipc::session::Session_mv< Session_impl_t >::Channels = typename Impl::Channels |
Container (vector<>
) of Channel_obj.
Definition at line 522 of file session.hpp.
|
protected |
Short-hand for pImpl-lite impl type. This shall be the deepest impl sub-class desired.
Definition at line 510 of file session.hpp.
|
protected |
Short-hand for const
-respecting wrapper around Impl for the pImpl idiom. See impl().
Definition at line 801 of file session.hpp.
using ipc::session::Session_mv< Session_impl_t >::Mdt_builder = typename Impl::Mdt_builder |
Implements Session API per contract.
Definition at line 534 of file session.hpp.
using ipc::session::Session_mv< Session_impl_t >::Mdt_builder_ptr = typename Impl::Mdt_builder_ptr |
Implements Session API per contract.
Definition at line 540 of file session.hpp.
using ipc::session::Session_mv< Session_impl_t >::Mdt_payload_obj = typename Impl::Mdt_payload_obj |
Implements Session API per contract.
Definition at line 528 of file session.hpp.
using ipc::session::Session_mv< Session_impl_t >::Mdt_reader_ptr = typename Impl::Mdt_reader_ptr |
Implements Session API per contract.
Definition at line 546 of file session.hpp.
|
protected |
Short-hand for Impl's Session_base super-class.
Definition at line 798 of file session.hpp.
using ipc::session::Session_mv< Session_impl_t >::Structured_channel = typename transport::struc::Channel_via_heap<Channel_obj, Message_body> |
Implements Session API per contract.
Definition at line 563 of file session.hpp.
using ipc::session::Session_mv< Session_impl_t >::Structured_msg_builder_config = typename Impl::Structured_msg_builder_config |
Implements Session API per contract.
Definition at line 573 of file session.hpp.
using ipc::session::Session_mv< Session_impl_t >::Structured_msg_reader_config = typename Impl::Structured_msg_builder_config |
Implements Session API per contract.
Definition at line 582 of file session.hpp.
|
default |
Implements Session API per contract.
Reminder: While not enforced, this ctor form is informally intended only for when one will move-from a PEER-state Session_mv. In particular Session_server::async_accept() requires these move semantics; so a default-cted Session_mv would be typically passed to it by the user.
|
default |
|
default |
Implements Session API per contract.
|
protected |
Provides const
access to Session_base super-object.
Definition at line 944 of file session.hpp.
const flow::log::Component & ipc::session::Session_mv< Session_impl_t >::get_log_component |
flow::log::Logger * ipc::session::Session_mv< Session_impl_t >::get_logger |
transport::struc::Heap_fixed_builder::Config ipc::session::Session_mv< Session_impl_t >::heap_fixed_builder_config |
Utility that obtains a heap-based (non-zero-copy) Struct_builder::Config, constructed with the most efficient yet safe values, for transport::struc::Msg_out (out-messages) compatible with Structured_channel upgraded-from Channel_obj channels opened via *this
Session_mv.
It is, simply, heap_fixed_builder_config(L)
, where L
is the Flow Logger*
belonging to *this
Session.
Informally, typically, this is useful if and only if you'd like to construct a transport::struc::Msg_out, and:
this->heap_fixed_builder_config()
.The note in the other overload's doc header applies equally.
Definition at line 912 of file session.hpp.
|
static |
Utility that obtains a heap-based (non-zero-copy) Struct_builder::Config, constructed with the most efficient yet safe values, for transport::struc::Msg_out (out-messages) compatible with Structured_channel upgraded-from Channel_obj channels opened via this Session_mv type.
Informally, typically, this is useful if and only if you'd like to construct a transport::struc::Msg_out, and:
this->heap_fixed_builder_config()
, or if you have one, but the target out-message intended for multiple sessions, so you don't want to stylistically tie the out-message's creation to any particular one Session_mv.Otherwise one would typically use struc::Channel::create_msg()/struct_builder_config()
or a this->heap_fixed_builder_config()
respectively.
Do note this method is available, via base class, in SHM-based Session impls (e.g., shm::classic::Server_session and shm::classic::Client_session) – nothing forbids the use of heap-based messaging even in such a session. However it would typically be better for performance (and in many cases is the reason for using a SHM-based Session impl in the first place) to use the non-heap-based counterparts to this method. E.g., see shm::classic::Session_mv::session_shm_builder_config() and shm::classic::Session_mv::app_shm_builder_config(); possibly shm::classic::Session_server::app_shm_builder_config().
logger_ptr | Logger to pass to the returned Config . |
Definition at line 905 of file session.hpp.
transport::struc::Heap_reader::Config ipc::session::Session_mv< Session_impl_t >::heap_reader_config |
Deserializing counterpart to non-static
heap_fixed_builder_config().
It is mostly provided for consistency, as it simply returns Heap_reader::Config(L)
, where L
is the Flow Logger*
belonging to *this
Session.
Definition at line 926 of file session.hpp.
|
static |
Deserializing counterpart to static
heap_fixed_builder_config().
It is mostly provided for consistency, as it simply returns Heap_reader::Config(logger_ptr)
.
logger_ptr | Logger to pass to the returned Config . |
Definition at line 919 of file session.hpp.
|
protected |
pImpl target; particularly for sub-classes that must add to the above public
API.
*this
is as-if default-cted. Definition at line 849 of file session.hpp.
|
protected |
pImpl target; particularly for sub-classes that must add to the above public
API.
*this
is as-if default-cted. Definition at line 855 of file session.hpp.
Session_mv< Session_impl_t >::Mdt_builder_ptr ipc::session::Session_mv< Session_impl_t >::mdt_builder |
Implements Session API per contract.
Definition at line 885 of file session.hpp.
bool ipc::session::Session_mv< Session_impl_t >::open_channel | ( | Channel_obj * | target_channel, |
const Mdt_builder_ptr & | mdt, | ||
Error_code * | err_code = 0 |
||
) |
Implements Session API per contract.
Reminder: Per concept requirements, open_channel() emitting an error (via standard Flow semantics) means that error is not session-hosing. Any session-hosing event is orthogonally emitted to on-error handler. Informally: in most cases even the (formally non-session-hosing) errors below indicate something seriously wrong is afoot. It would not be unreasonable to treat them as session-hosing (invoke dtor).
target_channel | See above. |
mdt | See above. |
err_code | See above. Error_code generated: error::Code::S_SESSION_OPEN_CHANNEL_REMOTE_PEER_REJECTED_PASSIVE_OPEN (per concept), error::Code::S_SESSION_OPEN_CHANNEL_ACTIVE_TIMEOUT (peer neither accepted nor rejected in non-blocking time frame), error::Code::S_SESSION_OPEN_CHANNEL_SERVER_CANNOT_PROCEED_RESOURCE_UNAVAILABLE (opposing or local Server_session peer was unable to acquire resources – as of this writing MQ-related ones – required for opening channel). |
Definition at line 891 of file session.hpp.
bool ipc::session::Session_mv< Session_impl_t >::open_channel | ( | Channel_obj * | target_channel, |
Error_code * | err_code = 0 |
||
) |
Implements Session API per contract.
See other overload for brief discussion relevant here also.
target_channel | See above. |
err_code | See above. See also other overload. |
Definition at line 898 of file session.hpp.
|
default |
const Session_token & ipc::session::Session_mv< Session_impl_t >::session_token |
Implements Session API per contract.
Definition at line 879 of file session.hpp.
References ipc::transport::struc::NULL_SESSION_TOKEN.
|
related |
Prints string representation of the given Session_mv
to the given ostream
.
os | Stream to which to write. |
val | Object to serialize. |
os
. Definition at line 951 of file session.hpp.
|
private |
The true implementation of this class. See also our class doc header.
Definition at line 834 of file session.hpp.
|
staticconstexpr |
Compile-time-known constant indicating whether Channel_obj shall use a blobs pipe over message queues (MQs).
Definition at line 599 of file session.hpp.
|
staticconstexpr |
Implements Session API per contract.
Definition at line 596 of file session.hpp.
|
staticconstexpr |
Implements Session API per contract.
Definition at line 590 of file session.hpp.
|
staticconstexpr |
Compile-time-known constant indicating whether Channel_obj shall use socket stream for any type of pipe.
If S_MQS_ENABLED, then a socket stream is still needed if and only if user wants to transmit native handles. If S_MQS_ENABLED is false
, then a socket stream is the only transport available as of this writing and hence also enabled.
Definition at line 607 of file session.hpp.