Click here to Skip to main content
15,885,920 members
Articles / Programming Languages / C++

RCF - Interprocess Communication for C++

Rate me:
Please Sign up or sign in to vote.
4.94/5 (147 votes)
25 Oct 2011CPOL20 min read 4.6M   8.4K   331  
A server/client IPC framework, using the C++ preprocessor as an IDL compiler.
\section{RCF::I\_\-Server\-Transport\-Ex Class Reference}
\label{class_r_c_f_1_1_i___server_transport_ex}\index{RCF::I_ServerTransportEx@{RCF::I\_\-ServerTransportEx}}
{\tt \#include $<$Server\-Transport.hpp$>$}



\subsection{Detailed Description}
Additional base class for server transport services with extended stream-oriented functionality. 

Twoway, stream-oriented server transport services that are to be used with publish/subscribe need to implement {\bf I\_\-Server\-Transport\-Ex}{\rm (p.\,\pageref{class_r_c_f_1_1_i___server_transport_ex})}. The functions in {\bf I\_\-Server\-Transport\-Ex}{\rm (p.\,\pageref{class_r_c_f_1_1_i___server_transport_ex})} are all synchronized and can safely be called from any thread. 

\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
virtual {\bf $\sim$I\_\-Server\-Transport\-Ex} ()\label{class_r_c_f_1_1_i___server_transport_ex_3da3e81cc120e38dfc58431135edfc0e}

\begin{CompactList}\small\item\em Virtual destructor. \item\end{CompactList}\item 
virtual Client\-Transport\-Auto\-Ptr {\bf create\-Client\-Transport} (const {\bf I\_\-Endpoint} \&endpoint)=0
\begin{CompactList}\small\item\em Creates a client transport to the given endpoint. \item\end{CompactList}\item 
virtual boost::shared\_\-ptr$<$ {\bf I\_\-Session} $>$ {\bf create\-Server\-Session} (Client\-Transport\-Auto\-Ptr client\-Transport\-Auto\-Ptr)=0
\begin{CompactList}\small\item\em Creates a server session dual to the given client transport. \item\end{CompactList}\item 
virtual Client\-Transport\-Auto\-Ptr {\bf create\-Client\-Transport} (boost::shared\_\-ptr$<$ {\bf I\_\-Session} $>$ session\-Ptr)=0
\begin{CompactList}\small\item\em Creates a client transport dual to the given server session. \item\end{CompactList}\item 
virtual bool {\bf reflect} (boost::shared\_\-ptr$<$ {\bf I\_\-Session} $>$ session\-Ptr1, boost::shared\_\-ptr$<$ {\bf I\_\-Session} $>$ session\-Ptr2)=0
\begin{CompactList}\small\item\em Requests the server transport to start reflecting data between the two given sessions. \item\end{CompactList}\item 
virtual bool {\bf is\-Connected} (boost::shared\_\-ptr$<$ {\bf I\_\-Session} $>$ session\-Ptr)=0
\begin{CompactList}\small\item\em Attempts to determine whether a server session is still connected. \item\end{CompactList}\end{CompactItemize}


\subsection{Member Function Documentation}
\index{RCF::I_ServerTransportEx@{RCF::I\_\-Server\-Transport\-Ex}!createClientTransport@{createClientTransport}}
\index{createClientTransport@{createClientTransport}!RCF::I_ServerTransportEx@{RCF::I\_\-Server\-Transport\-Ex}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual Client\-Transport\-Auto\-Ptr RCF::I\_\-Server\-Transport\-Ex::create\-Client\-Transport (boost::shared\_\-ptr$<$ {\bf I\_\-Session} $>$ {\em session\-Ptr})\hspace{0.3cm}{\tt  [pure virtual]}}\label{class_r_c_f_1_1_i___server_transport_ex_74e550a8726ac8cfe5a221e339b3192b}


Creates a client transport dual to the given server session. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em session\-Ptr}]Server session from which to generate the client transport. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Auto pointer to client transport. \end{Desc}
\index{RCF::I_ServerTransportEx@{RCF::I\_\-Server\-Transport\-Ex}!createClientTransport@{createClientTransport}}
\index{createClientTransport@{createClientTransport}!RCF::I_ServerTransportEx@{RCF::I\_\-Server\-Transport\-Ex}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual Client\-Transport\-Auto\-Ptr RCF::I\_\-Server\-Transport\-Ex::create\-Client\-Transport (const {\bf I\_\-Endpoint} \& {\em endpoint})\hspace{0.3cm}{\tt  [pure virtual]}}\label{class_r_c_f_1_1_i___server_transport_ex_6252ec3f15119c7d2a50403c3e2002d9}


Creates a client transport to the given endpoint. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em endpoint}]Endpoint describing a remote server. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Auto pointer to client transport accessing the remote server described by the endpoint. \end{Desc}
\index{RCF::I_ServerTransportEx@{RCF::I\_\-Server\-Transport\-Ex}!createServerSession@{createServerSession}}
\index{createServerSession@{createServerSession}!RCF::I_ServerTransportEx@{RCF::I\_\-Server\-Transport\-Ex}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual boost::shared\_\-ptr$<${\bf I\_\-Session}$>$ RCF::I\_\-Server\-Transport\-Ex::create\-Server\-Session (Client\-Transport\-Auto\-Ptr {\em client\-Transport\-Auto\-Ptr})\hspace{0.3cm}{\tt  [pure virtual]}}\label{class_r_c_f_1_1_i___server_transport_ex_32e451b713b7180fe49f13b894512b2d}


Creates a server session dual to the given client transport. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em client\-Transport\-Auto\-Ptr}]Auto pointer to client transport, from which the server session should be generated. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Server session. \end{Desc}
\index{RCF::I_ServerTransportEx@{RCF::I\_\-Server\-Transport\-Ex}!isConnected@{isConnected}}
\index{isConnected@{isConnected}!RCF::I_ServerTransportEx@{RCF::I\_\-Server\-Transport\-Ex}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual bool RCF::I\_\-Server\-Transport\-Ex::is\-Connected (boost::shared\_\-ptr$<$ {\bf I\_\-Session} $>$ {\em session\-Ptr})\hspace{0.3cm}{\tt  [pure virtual]}}\label{class_r_c_f_1_1_i___server_transport_ex_23282d5af62e7d043af50a104a9e31ee}


Attempts to determine whether a server session is still connected. 

Returns true, unless it can be determined that the physical transport instance is no longer valid. For a TCP server session, this amounts to checking if the underlying socket is ready to receive and has no errors queued, in other words that the TCP connection is still open. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em session\-Ptr}]Session to check. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Boolean value indicating the server transports best-effort knowledge of the state of the session. \end{Desc}
\index{RCF::I_ServerTransportEx@{RCF::I\_\-Server\-Transport\-Ex}!reflect@{reflect}}
\index{reflect@{reflect}!RCF::I_ServerTransportEx@{RCF::I\_\-Server\-Transport\-Ex}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual bool RCF::I\_\-Server\-Transport\-Ex::reflect (boost::shared\_\-ptr$<$ {\bf I\_\-Session} $>$ {\em session\-Ptr1}, boost::shared\_\-ptr$<$ {\bf I\_\-Session} $>$ {\em session\-Ptr2})\hspace{0.3cm}{\tt  [pure virtual]}}\label{class_r_c_f_1_1_i___server_transport_ex_f6211a9a9be2b68cba519733ce555705}


Requests the server transport to start reflecting data between the two given sessions. 

All data subsequently read on the first session will be sent out on the second session, and vice versa. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em session\-Ptr1}]First server session \item[{\em session\-Ptr2}]Second server session. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]true if server transport acquiesces, false otherwise. \end{Desc}


The documentation for this class was generated from the following file:\begin{CompactItemize}
\item 
Server\-Transport.hpp\end{CompactItemize}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Australia Australia
Software developer, from Sweden and now living in Canberra, Australia, working on distributed C++ applications. When he is not programming, Jarl enjoys skiing and playing table tennis. He derives immense satisfaction from referring to himself in third person.

Comments and Discussions