NCBI C++ ToolKit
Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
CRPCClient_Base Class Referenceabstract

Search Toolkit Book for CRPCClient_Base

Base class for CRPCClient template - defines methods independent of request and response types. More...

#include <serial/rpcbase_impl.hpp>

+ Inheritance diagram for CRPCClient_Base:
+ Collaboration diagram for CRPCClient_Base:

Public Member Functions

 CRPCClient_Base (const string &service, ESerialDataFormat format)
 CRPCClient_Base (const string &service, ESerialDataFormat format, unsigned int try_limit)
virtual ~CRPCClient_Base (void)
void Connect (void)
void Disconnect (void)
void Reset (void)
void SetArgs (const string &args)
 Set additional connection arguments. More...
void SetArgs (const CUrlArgs &args)
const stringGetArgs (void) const
 Get additional connection arguments. More...
const stringGetService (void) const
void SetService (const string &service)
ESerialDataFormat GetFormat (void) const
void SetFormat (ESerialDataFormat fmt)
unsigned int GetTryLimit (void) const
 Get number of request attempts. More...
void SetTryLimit (unsigned int n)
unsigned int GetRetryLimit (void) const
void SetRetryLimit (unsigned int n)
const CTimeSpan GetRetryDelay (void) const
 Get retry delay. More...
void SetRetryDelay (const CTimeSpan &ts)
void SetCanceledCallback (const ICanceled *canceled)
 Set request canceler. More...
bool IsCanceled (void) const

Protected Member Functions

void SetAffinity (const string &affinity)
virtual void x_Connect (void)=0
 These run with m_Mutex already acquired. More...
virtual void x_Disconnect (void)
 Disconnect as cleanly as possible. More...
void x_SetStream (CNcbiIostream *stream)
void x_Ask (const CSerialObject &request, CSerialObject &reply)
virtual void x_WriteRequest (CObjectOStream &out, const CSerialObject &request)=0
virtual void x_ReadReply (CObjectIStream &in, CSerialObject &reply)=0
virtual string x_GetAffinity (const CSerialObject &request) const =0
virtual bool x_ShouldRetry (unsigned int tries)
CTimeSpan x_GetRetryDelay (double max_delay) const

Static Protected Member Functions

static const char * GetContentTypeHeader (ESerialDataFormat format)

Protected Attributes

string m_Service
 Used by default Connect(). More...
string m_Args
unique_ptr< CNcbiIostreamm_Stream
unique_ptr< CObjectIStreamm_In
unique_ptr< CObjectOStreamm_Out
string m_Affinity
unsigned int m_TryLimit
CHttpRetryContext m_RetryCtx
CConstIRef< ICanceledm_Canceler

Private Member Functions

 CRPCClient_Base (const CRPCClient_Base &)
 Prohibit default copy constructor and assignment operator. More...
bool operator= (const CRPCClient_Base &)

Private Attributes

ESerialDataFormat m_Format
CMutex m_Mutex
 To allow sharing across threads. More...
CTimeSpan m_RetryDelay
unsigned int m_TryCount
int m_RecursionCount

Detailed Description

Base class for CRPCClient template - defines methods independent of request and response types.

Definition at line 54 of file rpcbase_impl.hpp.

The documentation for this class was generated from the following files:
Modified on Thu Dec 07 10:09:04 2023 by rev. 669887