Flow-IPC 1.0.1
Flow-IPC project: Full implementation reference.
Classes | Typedefs | Functions | Variables
ipc::session::shm::classic Namespace Reference

Support for SHM-backed ipc::session sessions and session-servers with the SHM-classic (ipc::shm::classic::Pool_arena) provider. More...

Classes

class  Client_session_impl
 Core internally-used implementation of shm::classic::Client_session: it is to the latter what its public super-class Client_session_impl is to Client_session. More...
 
class  Client_session_mv
 
class  Server_session
 Identical to session::Server_session in every way, except that it makes available two SHM arenas, from the SHM-classic provider (ipc::shm::classic::Pool_arena), symmetrically accessible by the opposing side. More...
 
class  Server_session_impl
 Core internally-used implementation of shm::classic::Server_session: it is to the latter what its public super-class Server_session_impl is to Server_session. More...
 
class  Server_session_mv
 
class  Session_impl
 Common data and logic for shm::classic::Server_session_impl and shm::classic::Client_session_impl. More...
 
class  Session_mv
 Implements the SHM-related API common to shm::classic::Server_session and shm::classic::Client_session. More...
 
class  Session_server
 This is to vanilla Session_server what shm::classic::Server_session is to vanilla Server_session: it is the session-server type that starts SHM-enabled sessions with SHM-classic provider (ipc::shm::classic::Pool_arena). More...
 

Typedefs

template<schema::MqType S_MQ_TYPE_OR_NONE, bool S_TRANSMIT_NATIVE_HANDLES, typename Mdt_payload = ::capnp::Void>
using Client_session = Session_mv< session::Client_session_mv< Client_session_impl< S_MQ_TYPE_OR_NONE, S_TRANSMIT_NATIVE_HANDLES, Mdt_payload > > >
 This is to session::Client_session what shm::classic::Server_session is to session::Server_session. More...
 

Functions

template<typename Session_impl_t >
std::ostream & operator<< (std::ostream &os, const Session_impl< Session_impl_t > &val)
 Prints string representation of the given Session_impl to the given ostream. More...
 
template<schema::MqType S_MQ_TYPE_OR_NONE, bool S_TRANSMIT_NATIVE_HANDLES, typename Mdt_payload >
std::ostream & operator<< (std::ostream &os, const Server_session_impl< S_MQ_TYPE_OR_NONE, S_TRANSMIT_NATIVE_HANDLES, Mdt_payload > &val)
 Prints string representation of the given Server_session_impl to the given ostream. More...
 
template<schema::MqType S_MQ_TYPE_OR_NONE, bool S_TRANSMIT_NATIVE_HANDLES, typename Mdt_payload >
std::ostream & operator<< (std::ostream &os, const Client_session_impl< S_MQ_TYPE_OR_NONE, S_TRANSMIT_NATIVE_HANDLES, Mdt_payload > &val)
 Prints string representation of the given Client_session_impl to the given ostream. More...
 
template<typename Session_t >
std::ostream & operator<< (std::ostream &os, const Session_mv< Session_t > &val)
 Prints string representation of the given Session_mv to the given ostream. More...
 
template<schema::MqType S_MQ_TYPE_OR_NONE, bool S_TRANSMIT_NATIVE_HANDLES, typename Mdt_payload >
std::ostream & operator<< (std::ostream &os, const Server_session< S_MQ_TYPE_OR_NONE, S_TRANSMIT_NATIVE_HANDLES, Mdt_payload > &val)
 Prints string representation of the given Server_session to the given ostream. More...
 
template<schema::MqType S_MQ_TYPE_OR_NONE, bool S_TRANSMIT_NATIVE_HANDLES, typename Mdt_payload >
std::ostream & operator<< (std::ostream &os, const Session_server< S_MQ_TYPE_OR_NONE, S_TRANSMIT_NATIVE_HANDLES, Mdt_payload > &val)
 Prints string representation of the given Session_server to the given ostream. More...
 

Variables

const Shared_name SHM_SUBTYPE_PREFIX = Shared_name::ct("classic")
 Internally used in pool names generated in this namespace to differentiate from those of other SHM-supporting session providers' pools (for example session::shm::classic versus session::shm::arena_lend::jemalloc). More...
 

Detailed Description

Support for SHM-backed ipc::session sessions and session-servers with the SHM-classic (ipc::shm::classic::Pool_arena) provider.

See the doc header for the general ipc::session::shm namespace.

Typedef Documentation

◆ Client_session

template<schema::MqType S_MQ_TYPE_OR_NONE, bool S_TRANSMIT_NATIVE_HANDLES, typename Mdt_payload = ::capnp::Void>
using ipc::session::shm::classic::Client_session = typedef Session_mv <session::Client_session_mv <Client_session_impl<S_MQ_TYPE_OR_NONE, S_TRANSMIT_NATIVE_HANDLES, Mdt_payload> >>

This is to session::Client_session what shm::classic::Server_session is to session::Server_session.

In terms of additional (to that of Client_session) public behavior, from the public API user's point of view, this class template alias is simply ~exactly identical/symmetrical to shm::classic::Server_session. See its doc header. That is during PEER state.

The only difference is shm::classic::Server_session::app_shm() and shm::classic::Client_session::app_shm() (actually Session_mv::app_shm() = both) differ in terms of how one views the lifetime of the underlying SHM areas. This is reflected in the latter's doc header. Essentially, though, the Arena* returned by the former can be used beyond the returning *this being destroyed, as long as its parent shm::classic::Session_server is alive (which is typical). In contrast that is not true of that returned by shm::classic::Client_session::app_shm(); but since the destruction of a Client_session implies either the process is itself going down, or the opposing server process (and thus shm::classic::Session_server) is going down/has gone down, this should not be relevant, as those objects should never be accessed again anyway.

Implementation

First see the Implementation section of shm::classic::Server_session. It gives a detailed description of the overall design – both its own side and this (client) side too. So read it; then come back here.

That said, shm::classic::Client_session is a much simpler situation. It is not inter-operating with any server object; and (as explained in the referenced doc header) all it needs to do is open the pools guaranteed to exist by the time the vanilla Client_session enters PEER state (just past log-in response receipt).

So all we have to do is provide a modified async_connect() which:

In *this, mechanically: the true implementation of the needed setup and accessors (explained above) is in shm::classic::Client_session_impl, and the vanilla core of that is in its super-class session::Client_session_impl. That's the key; then Client_session_mv adds movability around that guy; and lastly this type sub-classes that and completes the puzzle by pImpl-forwarding to the added (SHM-focused) API.

The last and most boring piece of the puzzle are the pImpl-lite wrappers around the SHM-specific API that shm::classic::Client_session adds to super-class Client_session_mv: session_shm() and so on. Just see same spot in shm::classic::Server_session doc header; it explains both client and server sides.

Template Parameters
S_MQ_TYPE_OR_NONEIdentical to session::Client_session.
S_TRANSMIT_NATIVE_HANDLESIdentical to session::Client_session.
Mdt_payloadIdentical to session::Client_session.

Definition at line 97 of file classic_fwd.hpp.

Function Documentation

◆ operator<<() [1/6]

template<schema::MqType S_MQ_TYPE_OR_NONE, bool S_TRANSMIT_NATIVE_HANDLES, typename Mdt_payload >
std::ostream & ipc::session::shm::classic::operator<< ( std::ostream &  os,
const Client_session_impl< S_MQ_TYPE_OR_NONE, S_TRANSMIT_NATIVE_HANDLES, Mdt_payload > &  val 
)

Prints string representation of the given Client_session_impl to the given ostream.

Parameters
osStream to which to write.
valObject to serialize.
Returns
os.

Definition at line 286 of file client_session_impl.hpp.

◆ operator<<() [2/6]

template<schema::MqType S_MQ_TYPE_OR_NONE, bool S_TRANSMIT_NATIVE_HANDLES, typename Mdt_payload >
std::ostream & ipc::session::shm::classic::operator<< ( std::ostream &  os,
const Server_session< S_MQ_TYPE_OR_NONE, S_TRANSMIT_NATIVE_HANDLES, Mdt_payload > &  val 
)

Prints string representation of the given Server_session to the given ostream.

Parameters
osStream to which to write.
valObject to serialize.
Returns
os.

Definition at line 270 of file server_session.hpp.

◆ operator<<() [3/6]

template<schema::MqType S_MQ_TYPE_OR_NONE, bool S_TRANSMIT_NATIVE_HANDLES, typename Mdt_payload >
std::ostream & ipc::session::shm::classic::operator<< ( std::ostream &  os,
const Server_session_impl< S_MQ_TYPE_OR_NONE, S_TRANSMIT_NATIVE_HANDLES, Mdt_payload > &  val 
)

Prints string representation of the given Server_session_impl to the given ostream.

Parameters
osStream to which to write.
valObject to serialize.
Returns
os.

Definition at line 369 of file server_session_impl.hpp.

◆ operator<<() [4/6]

template<typename Session_impl_t >
std::ostream & ipc::session::shm::classic::operator<< ( std::ostream &  os,
const Session_impl< Session_impl_t > &  val 
)

Prints string representation of the given Session_impl to the given ostream.

Parameters
osStream to which to write.
valObject to serialize.
Returns
os.

Definition at line 412 of file session_impl.hpp.

◆ operator<<() [5/6]

template<typename Session_t >
std::ostream & ipc::session::shm::classic::operator<< ( std::ostream &  os,
const Session_mv< Session_t > &  val 
)

Prints string representation of the given Session_mv to the given ostream.

Parameters
osStream to which to write.
valObject to serialize.
Returns
os.

Definition at line 427 of file session.hpp.

◆ operator<<() [6/6]

template<schema::MqType S_MQ_TYPE_OR_NONE, bool S_TRANSMIT_NATIVE_HANDLES, typename Mdt_payload >
std::ostream & ipc::session::shm::classic::operator<< ( std::ostream &  os,
const Session_server< S_MQ_TYPE_OR_NONE, S_TRANSMIT_NATIVE_HANDLES, Mdt_payload > &  val 
)

Prints string representation of the given Session_server to the given ostream.

Parameters
osStream to which to write.
valObject to serialize.
Returns
os.

Definition at line 700 of file session_server.hpp.

Variable Documentation

◆ SHM_SUBTYPE_PREFIX

const Shared_name ipc::session::shm::classic::SHM_SUBTYPE_PREFIX = Shared_name::ct("classic")