NCBI C++ ToolKit
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
SNetServiceImpl Struct Reference

Search Toolkit Book for SNetServiceImpl

#include "netservice_api_impl.hpp"
(Private to src/connect/services.)

+ Inheritance diagram for SNetServiceImpl:
+ Collaboration diagram for SNetServiceImpl:

Classes

struct  SRetry
 

Public Types

enum  EServiceType { eServiceNotDefined , eLoadBalancedService , eSingleServerService }
 
enum  EServerErrorHandling { eRethrowServerErrors , eRethrowAllServerErrors , eIgnoreServerErrors }
 
- Public Types inherited from CObject
enum  EAllocFillMode { eAllocFillNone = 1 , eAllocFillZero , eAllocFillPattern }
 Control filling of newly allocated memory. More...
 
typedef CObjectCounterLocker TLockerType
 Default locker type for CRef. More...
 
typedef atomic< Uint8TCounter
 Counter type is CAtomiCounter. More...
 
typedef Uint8 TCount
 Alias for value type of counter. More...
 

Public Member Functions

string MakeAuthString ()
 
CNetServer::SExecResult FindServerAndExec (const string &cmd, bool multiline_output)
 
void DiscoverServersIfNeeded ()
 
void GetDiscoveredServers (CRef< SDiscoveredServers > &discovered_servers)
 
bool IsInService (CNetServer::TInstance server)
 
void IterateUntilExecOK (const string &cmd, bool multiline_output, CNetServer::SExecResult &exec_result, IServiceTraversal *service_traversal, EServerErrorHandling error_handling)
 
SNetServiceIteratorImplIterate (CNetServer::TInstance priority_server)
 
SDiscoveredServersAllocServerGroup (unsigned discovery_iteration)
 
CNetServer GetServer (SSocketAddress server_address)
 
const stringGetClientName () const
 
unsigned GetConnectionMaxRetries () const
 
unsigned long GetConnectionRetryDelay () const
 
bool IsLoadBalanced () const
 
shared_ptr< void > CreateRetryGuard (SRetry::EType type)
 
virtual ~SNetServiceImpl ()
 
- Public Member Functions inherited from CObject
 CObject (void)
 Constructor. More...
 
 CObject (const CObject &src)
 Copy constructor. More...
 
virtual ~CObject (void)
 Destructor. More...
 
CObjectoperator= (const CObject &src) THROWS_NONE
 Assignment operator. More...
 
bool CanBeDeleted (void) const THROWS_NONE
 Check if object can be deleted. More...
 
bool IsAllocatedInPool (void) const THROWS_NONE
 Check if object is allocated in memory pool (not system heap) More...
 
bool Referenced (void) const THROWS_NONE
 Check if object is referenced. More...
 
bool ReferencedOnlyOnce (void) const THROWS_NONE
 Check if object is referenced only once. More...
 
void AddReference (void) const
 Add reference to object. More...
 
void RemoveReference (void) const
 Remove reference to object. More...
 
void ReleaseReference (void) const
 Remove reference without deleting object. More...
 
virtual void DoNotDeleteThisObject (void)
 Mark this object as not allocated in heap – do not delete this object. More...
 
virtual void DoDeleteThisObject (void)
 Mark this object as allocated in heap – object can be deleted. More...
 
void * operator new (size_t size)
 Define new operator for memory allocation. More...
 
void * operator new[] (size_t size)
 Define new[] operator for 'array' memory allocation. More...
 
void operator delete (void *ptr)
 Define delete operator for memory deallocation. More...
 
void operator delete[] (void *ptr)
 Define delete[] operator for memory deallocation. More...
 
void * operator new (size_t size, void *place)
 Define new operator. More...
 
void operator delete (void *ptr, void *place)
 Define delete operator. More...
 
void * operator new (size_t size, CObjectMemoryPool *place)
 Define new operator using memory pool. More...
 
void operator delete (void *ptr, CObjectMemoryPool *place)
 Define delete operator. More...
 
virtual void DebugDump (CDebugDumpContext ddc, unsigned int depth) const
 Define method for dumping debug information. More...
 
- Public Member Functions inherited from CDebugDumpable
 CDebugDumpable (void)
 
virtual ~CDebugDumpable (void)
 
void DebugDumpText (ostream &out, const string &bundle, unsigned int depth) const
 
void DebugDumpFormat (CDebugDumpFormatter &ddf, const string &bundle, unsigned int depth) const
 
void DumpToConsole (void) const
 

Static Public Member Functions

static SNetServiceImplCreate (const string &api_name, const string &service_name, const string &client_name, INetServerConnectionListener *listener, CSynRegistry &registry, SRegSynonyms &sections, const string &ns_client_name=kEmptyStr)
 
static SNetServiceImplClone (SNetServerInPool *server, SNetServiceImpl *prototype)
 
static SNetServiceImplClone (const string &service_name, SNetServiceImpl *prototype)
 
- Static Public Member Functions inherited from SNetServiceXSiteAPI
static void InitXSite (CSynRegistry &registry, const SRegSynonyms &sections)
 
static void ConnectXSite (CSocket &, SNetServerImpl::SConnectDeadline &, const SSocketAddress &, const string &)
 
- Static Public Member Functions inherited from CObject
static NCBI_XNCBI_EXPORT void ThrowNullPointerException (void)
 Define method to throw null pointer exception. More...
 
static NCBI_XNCBI_EXPORT void ThrowNullPointerException (const type_info &type)
 
static EAllocFillMode GetAllocFillMode (void)
 
static void SetAllocFillMode (EAllocFillMode mode)
 
static void SetAllocFillMode (const string &value)
 Set mode from configuration parameter value. More...
 
- Static Public Member Functions inherited from CDebugDumpable
static void EnableDebugDump (bool on)
 

Public Attributes

CRef< INetServerConnectionListenerm_Listener
 
CNetServerPool m_ServerPool
 
string m_ServiceName
 
EServiceType m_ServiceType = eServiceNotDefined
 
CFastMutex m_DiscoveryMutex
 
SDiscoveredServersm_DiscoveredServers = nullptr
 
SDiscoveredServersm_ServerGroupPool = nullptr
 
unsigned m_LatestDiscoveryIteration = 0
 
CSimpleRebalanceStrategy m_RebalanceStrategy
 
atomic< size_t > m_RoundRobin
 

Private Member Functions

 SNetServiceImpl (const string &api_name, const string &service_name, const string &client_name, INetServerConnectionListener *listener, CSynRegistry &registry, const SRegSynonyms &sections)
 
 SNetServiceImpl (SNetServerInPool *server, SNetServiceImpl *prototype)
 
 SNetServiceImpl (const string &service_name, SNetServiceImpl *prototype)
 
void Construct (SNetServerInPool *server)
 
void Construct ()
 
void Init (CSynRegistry &registry, SRegSynonyms &sections, const string &ns_client_name)
 

Private Attributes

string m_APIName
 
string m_ClientName
 
bool m_UseSmartRetries
 
unsigned m_ConnectionMaxRetries
 
unsigned long m_ConnectionRetryDelay
 
shared_ptr< void > m_NetInfo
 

Additional Inherited Members

- Static Public Attributes inherited from CObject
static const TCount eCounterBitsCanBeDeleted = 1 << 0
 Define possible object states. More...
 
static const TCount eCounterBitsInPlainHeap = 1 << 1
 Heap signature was found. More...
 
static const TCount eCounterBitsPlaceMask
 Mask for 'in heap' state flags. More...
 
static const int eCounterStep = 1 << 2
 Skip over the "in heap" bits. More...
 
static const TCount eCounterValid = TCount(1) << (sizeof(TCount) * 8 - 2)
 Minimal value for valid objects (reference counter is zero) Must be a single bit value. More...
 
static const TCount eCounterStateMask
 Valid object, and object in heap. More...
 
- Protected Member Functions inherited from CObject
virtual void DeleteThis (void)
 Virtual method "deleting" this object. More...
 

Detailed Description

Definition at line 276 of file netservice_api_impl.hpp.

Member Enumeration Documentation

◆ EServerErrorHandling

Enumerator
eRethrowServerErrors 
eRethrowAllServerErrors 
eIgnoreServerErrors 

Definition at line 327 of file netservice_api_impl.hpp.

◆ EServiceType

Enumerator
eServiceNotDefined 
eLoadBalancedService 
eSingleServerService 

Definition at line 278 of file netservice_api_impl.hpp.

Constructor & Destructor Documentation

◆ SNetServiceImpl() [1/3]

SNetServiceImpl::SNetServiceImpl ( const string api_name,
const string service_name,
const string client_name,
INetServerConnectionListener listener,
CSynRegistry registry,
const SRegSynonyms sections 
)
private

Definition at line 340 of file netservice_api.cpp.

Referenced by Clone(), and Create().

◆ SNetServiceImpl() [2/3]

SNetServiceImpl::SNetServiceImpl ( SNetServerInPool server,
SNetServiceImpl prototype 
)
private

Definition at line 352 of file netservice_api.cpp.

References Construct().

◆ SNetServiceImpl() [3/3]

SNetServiceImpl::SNetServiceImpl ( const string service_name,
SNetServiceImpl prototype 
)
private

Definition at line 368 of file netservice_api.cpp.

References Construct().

◆ ~SNetServiceImpl()

SNetServiceImpl::~SNetServiceImpl ( )
virtual

Member Function Documentation

◆ AllocServerGroup()

SDiscoveredServers * SNetServiceImpl::AllocServerGroup ( unsigned  discovery_iteration)

◆ Clone() [1/2]

SNetServiceImpl * SNetServiceImpl::Clone ( const string service_name,
SNetServiceImpl prototype 
)
static

Definition at line 420 of file netservice_api.cpp.

References SNetServiceImpl().

◆ Clone() [2/2]

SNetServiceImpl * SNetServiceImpl::Clone ( SNetServerInPool server,
SNetServiceImpl prototype 
)
static

Definition at line 415 of file netservice_api.cpp.

References SNetServiceImpl().

Referenced by CNetService::Clone(), and SNetServiceMap::GetServiceByNameImpl().

◆ Construct() [1/2]

void SNetServiceImpl::Construct ( void  )
private

◆ Construct() [2/2]

void SNetServiceImpl::Construct ( SNetServerInPool server)
private

◆ Create()

SNetServiceImpl * SNetServiceImpl::Create ( const string api_name,
const string service_name,
const string client_name,
INetServerConnectionListener listener,
CSynRegistry registry,
SRegSynonyms sections,
const string ns_client_name = kEmptyStr 
)
static

◆ CreateRetryGuard()

shared_ptr< void > SNetServiceImpl::CreateRetryGuard ( SRetry::EType  type)

◆ DiscoverServersIfNeeded()

void SNetServiceImpl::DiscoverServersIfNeeded ( )

◆ FindServerAndExec()

CNetServer::SExecResult SNetServiceImpl::FindServerAndExec ( const string cmd,
bool  multiline_output 
)

◆ GetClientName()

const string& SNetServiceImpl::GetClientName ( void  ) const
inline

◆ GetConnectionMaxRetries()

unsigned SNetServiceImpl::GetConnectionMaxRetries ( ) const
inline

Definition at line 346 of file netservice_api_impl.hpp.

References m_ConnectionMaxRetries.

Referenced by SNetServerImpl::ConnectAndExec().

◆ GetConnectionRetryDelay()

unsigned long SNetServiceImpl::GetConnectionRetryDelay ( ) const
inline

Definition at line 347 of file netservice_api_impl.hpp.

References m_ConnectionRetryDelay.

Referenced by SNetServerImpl::ConnectAndExec().

◆ GetDiscoveredServers()

void SNetServiceImpl::GetDiscoveredServers ( CRef< SDiscoveredServers > &  discovered_servers)

◆ GetServer()

CNetServer SNetServiceImpl::GetServer ( SSocketAddress  server_address)

◆ Init()

void SNetServiceImpl::Init ( CSynRegistry registry,
SRegSynonyms sections,
const string ns_client_name 
)
private

◆ IsInService()

bool SNetServiceImpl::IsInService ( CNetServer::TInstance  server)

◆ IsLoadBalanced()

bool SNetServiceImpl::IsLoadBalanced ( ) const
inline

Definition at line 348 of file netservice_api_impl.hpp.

References eLoadBalancedService, and m_ServiceType.

◆ Iterate()

SNetServiceIteratorImpl * SNetServiceImpl::Iterate ( CNetServer::TInstance  priority_server)

◆ IterateUntilExecOK()

void SNetServiceImpl::IterateUntilExecOK ( const string cmd,
bool  multiline_output,
CNetServer::SExecResult exec_result,
IServiceTraversal service_traversal,
SNetServiceImpl::EServerErrorHandling  error_handling 
)

◆ MakeAuthString()

string SNetServiceImpl::MakeAuthString ( )

Member Data Documentation

◆ m_APIName

string SNetServiceImpl::m_APIName
private

Definition at line 370 of file netservice_api_impl.hpp.

Referenced by DiscoverServersIfNeeded(), FindServerAndExec(), and Init().

◆ m_ClientName

string SNetServiceImpl::m_ClientName
private

Definition at line 371 of file netservice_api_impl.hpp.

Referenced by GetClientName(), Init(), and MakeAuthString().

◆ m_ConnectionMaxRetries

unsigned SNetServiceImpl::m_ConnectionMaxRetries
private

Definition at line 375 of file netservice_api_impl.hpp.

Referenced by GetConnectionMaxRetries(), Init(), and IterateUntilExecOK().

◆ m_ConnectionRetryDelay

unsigned long SNetServiceImpl::m_ConnectionRetryDelay
private

◆ m_DiscoveredServers

SDiscoveredServers* SNetServiceImpl::m_DiscoveredServers = nullptr

◆ m_DiscoveryMutex

CFastMutex SNetServiceImpl::m_DiscoveryMutex

◆ m_LatestDiscoveryIteration

unsigned SNetServiceImpl::m_LatestDiscoveryIteration = 0

Definition at line 365 of file netservice_api_impl.hpp.

Referenced by DiscoverServersIfNeeded().

◆ m_Listener

CRef<INetServerConnectionListener> SNetServiceImpl::m_Listener

◆ m_NetInfo

shared_ptr<void> SNetServiceImpl::m_NetInfo
private

Definition at line 378 of file netservice_api_impl.hpp.

Referenced by DiscoverServersIfNeeded().

◆ m_RebalanceStrategy

CSimpleRebalanceStrategy SNetServiceImpl::m_RebalanceStrategy

◆ m_RoundRobin

atomic<size_t> SNetServiceImpl::m_RoundRobin

Definition at line 367 of file netservice_api_impl.hpp.

◆ m_ServerGroupPool

SDiscoveredServers* SNetServiceImpl::m_ServerGroupPool = nullptr

◆ m_ServerPool

CNetServerPool SNetServiceImpl::m_ServerPool

◆ m_ServiceName

string SNetServiceImpl::m_ServiceName

◆ m_ServiceType

EServiceType SNetServiceImpl::m_ServiceType = eServiceNotDefined

◆ m_UseSmartRetries

bool SNetServiceImpl::m_UseSmartRetries
private

Definition at line 374 of file netservice_api_impl.hpp.

Referenced by Init(), and IterateUntilExecOK().


The documentation for this struct was generated from the following files:
Modified on Wed Sep 04 14:59:12 2024 by modify_doxy.py rev. 669887