|
Flow-IPC 3.0.0
Flow-IPC project: Full implementation reference.
|
Support for SHM-backed ipc::session sessions and session-servers with the SHM-classic (ipc::shm::classic::Pool_arena) provider. More...
Namespaces | |
| namespace | rpc |
| Sub-namespace containing utilities useful when working with capnp-RPC-with-zero-copy module of Flow-IPC (transport::struc::shm::rpc) – assuming one has chosen SHM-classic as the SHM-provider for such work. | |
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 | 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 | 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... | |
| struct | Session_server_dtl |
This is the friend facade of shm::classic::Session_server that exposes specific private APIs hidden from public user by providing public access to them; this is used internally by at least classic::Server_session_impl. More... | |
Typedefs | |
| using | Arena_ptr = boost::shared_ptr< ipc::shm::classic::Pool_arena > |
Ref-counted handle to a SHM-classic arena (Arena memebr alias in the classes here), for the ones ipc::session maintains: per-session (session_shm()) and per-app (app_shm()). More... | |
| template<session::schema::MqType MQ_TYPE_OR_NONE, bool TRANSMIT_NATIVE_HANDLES, typename Mdt_payload = ::capnp::Void> | |
| using | Client_session = Session_mv< session::Client_session_mv< Client_session_impl< MQ_TYPE_OR_NONE, 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<session::schema::MqType MQ_TYPE_OR_NONE, bool TRANSMIT_NATIVE_HANDLES, typename Mdt_payload > | |
| std::ostream & | operator<< (std::ostream &os, const Server_session_impl< MQ_TYPE_OR_NONE, TRANSMIT_NATIVE_HANDLES, Mdt_payload > &val) |
Prints string representation of the given Server_session_impl to the given ostream. More... | |
| template<session::schema::MqType MQ_TYPE_OR_NONE, bool TRANSMIT_NATIVE_HANDLES, typename Mdt_payload > | |
| std::ostream & | operator<< (std::ostream &os, const Client_session_impl< MQ_TYPE_OR_NONE, 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<session::schema::MqType MQ_TYPE_OR_NONE, bool TRANSMIT_NATIVE_HANDLES, typename Mdt_payload > | |
| std::ostream & | operator<< (std::ostream &os, const Server_session< MQ_TYPE_OR_NONE, TRANSMIT_NATIVE_HANDLES, Mdt_payload > &val) |
Prints string representation of the given Server_session to the given ostream. More... | |
| template<session::schema::MqType MQ_TYPE_OR_NONE, bool TRANSMIT_NATIVE_HANDLES, typename Mdt_payload > | |
| std::ostream & | operator<< (std::ostream &os, const Session_server< MQ_TYPE_OR_NONE, 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... | |
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.
| using ipc::session::shm::classic::Arena_ptr = typedef boost::shared_ptr<ipc::shm::classic::Pool_arena> |
Ref-counted handle to a SHM-classic arena (Arena memebr alias in the classes here), for the ones ipc::session maintains: per-session (session_shm()) and per-app (app_shm()).
A per-app arena is shared by the Session_server and each of its Server_sessions w/r/t that Client_app; so it lives until they are all gone. So the ref-countedness is internally used for the app-scope arenas.
As of this writing the session-scope session_shm()-used type could be non-ref-counted, but it's basically written once per Session and then just .get()ed subsequently, so there's no real perf question; we reuse it for convenience.
Definition at line 54 of file classic_fwd.hpp.
| using ipc::session::shm::classic::Client_session = typedef Session_mv <session::Client_session_mv <Client_session_impl<MQ_TYPE_OR_NONE, 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.
Client_app and Server_app passed to the ctor must outlive *this.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 – or another shm::classic::Server_session from it, with the same Client_app – 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.
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.
| MQ_TYPE_OR_NONE | Identical to session::Client_session. |
| TRANSMIT_NATIVE_HANDLES | Identical to session::Client_session. |
| Mdt_payload | Identical to session::Client_session. |
Definition at line 95 of file classic_fwd.hpp.
| std::ostream & ipc::session::shm::classic::operator<< | ( | std::ostream & | os, |
| const Client_session_impl< MQ_TYPE_OR_NONE, TRANSMIT_NATIVE_HANDLES, Mdt_payload > & | val | ||
| ) |
Prints string representation of the given Client_session_impl to the given ostream.
| os | Stream to which to write. |
| val | Object to serialize. |
os. Definition at line 292 of file client_session_impl.hpp.
| std::ostream & ipc::session::shm::classic::operator<< | ( | std::ostream & | os, |
| const Server_session< MQ_TYPE_OR_NONE, TRANSMIT_NATIVE_HANDLES, Mdt_payload > & | val | ||
| ) |
Prints string representation of the given Server_session to the given ostream.
| os | Stream to which to write. |
| val | Object to serialize. |
os. Definition at line 295 of file server_session.hpp.
| std::ostream & ipc::session::shm::classic::operator<< | ( | std::ostream & | os, |
| const Server_session_impl< MQ_TYPE_OR_NONE, TRANSMIT_NATIVE_HANDLES, Mdt_payload > & | val | ||
| ) |
Prints string representation of the given Server_session_impl to the given ostream.
| os | Stream to which to write. |
| val | Object to serialize. |
os. Definition at line 386 of file server_session_impl.hpp.
| 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.
| os | Stream to which to write. |
| val | Object to serialize. |
os. Definition at line 453 of file session_impl.hpp.
| 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.
| os | Stream to which to write. |
| val | Object to serialize. |
os. Definition at line 457 of file session.hpp.
| std::ostream & ipc::session::shm::classic::operator<< | ( | std::ostream & | os, |
| const Session_server< MQ_TYPE_OR_NONE, TRANSMIT_NATIVE_HANDLES, Mdt_payload > & | val | ||
| ) |
Prints string representation of the given Session_server to the given ostream.
| os | Stream to which to write. |
| val | Object to serialize. |
os. Definition at line 811 of file session_server.hpp.
| const Shared_name ipc::session::shm::classic::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).
Definition at line 27 of file session_shared_name.cpp.
Referenced by ipc::session::shm::classic::Server_session_impl< MQ_TYPE_OR_NONE, TRANSMIT_NATIVE_HANDLES, Mdt_payload >::async_accept_log_in(), ipc::session::shm::classic::Client_session_impl< MQ_TYPE_OR_NONE, TRANSMIT_NATIVE_HANDLES, Mdt_payload >::async_connect(), ipc::session::shm::arena_lend::jemalloc::Client_session_impl< MQ_TYPE_OR_NONE, TRANSMIT_NATIVE_HANDLES, Mdt_payload >::cleanup(), and ipc::session::shm::classic::Session_server< MQ_TYPE_OR_NONE, TRANSMIT_NATIVE_HANDLES, Mdt_payload >::init_app_shm_as_needed().