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

Search Toolkit Book for CNetCacheKey

Meaningful information encoded in the NetCache key. More...

#include <connect/services/netcache_key.hpp>

+ Inheritance diagram for CNetCacheKey:

Public Types

enum  ENCKeyFlag { fNCKey_SingleServer = 1 << 0 , fNCKey_NoServerCheck = 1 << 1 }
 Blob and blob key features. More...
 
typedef unsigned TNCKeyFlags
 Binary OR of ENCKeyFlag. More...
 

Public Member Functions

 CNetCacheKey (const string &key_str, CCompoundIDPool::TInstance id_pool=NULL)
 Create the key out of string. More...
 
 CNetCacheKey ()
 Create an empty object for later use with ParseBlobKey() or Assign(). More...
 
void Assign (const string &key_str, CCompoundIDPool::TInstance id_pool=NULL)
 Parse the specified blob ID and initializes this object. More...
 
bool HasExtensions () const
 
string StripKeyExtensions () const
 If the blob key has been parsed successfully, this method returns a trimmed "base" version of the key with "0MetA0" extensions removed. More...
 
TNCKeyFlags GetFlags () const
 
bool GetFlag (ENCKeyFlag flag) const
 
void SetFlag (ENCKeyFlag flag)
 
void ClearFlag (ENCKeyFlag flag)
 
const stringGetKey () const
 
unsigned GetId () const
 
const stringGetHost () const
 
unsigned short GetPort () const
 
unsigned GetHostPortCRC32 () const
 
unsigned GetVersion () const
 
time_t GetCreationTime () const
 
Uint4 GetRandomPart () const
 
const stringGetServiceName () const
 

Static Public Member Functions

static bool ParseBlobKey (const char *key_str, size_t key_len, CNetCacheKey *key_obj, CCompoundIDPool::TInstance id_pool=NULL)
 Parse blob key string into a CNetCacheKey structure. More...
 
static void AddExtensions (string &blob_id, const string &service_name, TNCKeyFlags flags, unsigned ver=1)
 Unconditionally append a service name to the specified string. More...
 
static Uint4 CalculateChecksum (const string &host, unsigned short port)
 Calculate and return the CRC32 checksum generated from the string "host:port". More...
 
static void GenerateBlobKey (string *key, unsigned int id, const string &host, unsigned short port, unsigned int ver, unsigned int rnd_num, time_t creation_time=0)
 Generate blob key string. More...
 
static string KeyToCompoundID (const string &key_str, CCompoundIDPool id_pool)
 
static unsigned int GetBlobId (const string &key_str)
 Parse blob key, extract id. More...
 
static bool IsValidKey (const char *key_str, size_t key_len, CCompoundIDPool::TInstance id_pool=NULL)
 
static bool IsValidKey (const string &key, CCompoundIDPool::TInstance id_pool=NULL)
 

Private Attributes

string m_Key
 
string m_PrimaryKey
 
unsigned int m_Id
 BLOB id. More...
 
string m_Host
 server name More...
 
unsigned short m_Port
 TCP/IP port number. More...
 
unsigned m_HostPortCRC32
 CRC32 checksum of the host:port combination. More...
 
unsigned m_Version
 Key version. More...
 
time_t m_CreationTime
 
Uint4 m_Random
 
string m_ServiceName
 
TNCKeyFlags m_Flags
 

Detailed Description

Meaningful information encoded in the NetCache key.

Definition at line 61 of file netcache_key.hpp.


The documentation for this struct was generated from the following files:
Modified on Fri Sep 20 14:58:07 2024 by modify_doxy.py rev. 669887