A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.ncbi.nlm.nih.gov/IEB/ToolBox/CPP_DOC/doxyhtml/request__ctx_8hpp_source.html below:

NCBI C++ ToolKit: include/corelib/request_ctx.hpp Source File

1 #ifndef CORELIB___REQUEST_CTX__HPP 2 #define CORELIB___REQUEST_CTX__HPP 77  bool Empty

(

void

)

const

{

return

m_HitId.empty(); }

82  if

( IsShared() )

return

;

84

m_SharedSubHitId->GetData().Set(m_SubHitId);

88  bool IsShared

(

void

)

const

{

return

!m_SharedSubHitId.Empty(); }

91  const string

&

GetHitId

(

void

)

const

{

return

m_HitId; }

96

m_SharedSubHitId.Reset();

107  return

IsShared() ? (

TSubHitId

)m_SharedSubHitId->GetData().Get() : m_SubHitId;

113  return

IsShared() ? (

TSubHitId

)m_SharedSubHitId->GetData().Add(1) : ++m_SubHitId;

126  void

x_SetHitId(

const string

& hit_id);

186  virtual void SetName

(

const string

& name) = 0;

218  TCount

GetRequestID(

void

)

const

;

220  void

SetRequestID(

TCount

rid);

222  bool

IsSetRequestID(

void

)

const

;

224  void

UnsetRequestID(

void

);

226  TCount

SetRequestID(

void

);

229  static TCount

GetNextRequestID(

void

);

236  string

GetClientIP(

void

)

const

;

237  void

SetClientIP(

const string

&

client

);

238  bool

IsSetClientIP(

void

)

const

;

239  bool

IsSetExplicitClientIP(

void

)

const

;

240  void

UnsetClientIP(

void

);

243  string

GetSessionID(

void

)

const

;

244  void

SetSessionID(

const string

& session);

245  bool

IsSetSessionID(

void

)

const

;

246  bool

IsSetExplicitSessionID(

void

)

const

;

247  void

UnsetSessionID(

void

);

249  const string

& SetSessionID(

void

);

251  string

GetEncodedSessionID(

void

)

const

;

258

eHitID_Request = 0x01,

259

eHitID_Default = 0x02,

263 

eHidID_Existing = eHitID_Default | eHitID_Request

274  void

SetHitID(

const string

& hit);

282  bool

IsSetHitID(EHitIDSource src = eHitID_Any)

const

;

287 

{

return

IsSetHitID(eHitID_Request); }

289  void

UnsetHitID(

void

);

292  const string

& SetHitID(

void

);

299  bool

IsSetDtab(

void

)

const

;

300  const string

& GetDtab(

void

)

const

;

301  void

SetDtab(

const string

& dtab);

302  void

UnsetDtab(

void

);

305  int

GetRequestStatus(

void

)

const

;

306  void

SetRequestStatus(

int

status);

308  bool

IsSetRequestStatus(

void

)

const

;

309  void

UnsetRequestStatus(

void

);

316  Int8

GetBytesRd(

void

)

const

;

317  void

SetBytesRd(

Int8

bytes);

318  bool

IsSetBytesRd(

void

)

const

;

319  void

UnsetBytesRd(

void

);

322  Int8

GetBytesWr(

void

)

const

;

323  void

SetBytesWr(

Int8

bytes);

324  bool

IsSetBytesWr(

void

)

const

;

325  void

UnsetBytesWr(

void

);

334  void

SetProperty(

const string

& name,

const string

&

value

);

336  const string

& GetProperty(

const string

& name)

const

;

338  bool

IsSetProperty(

const string

& name)

const

;

340  void

UnsetProperty(

const string

& name);

354  static void

SetDefaultAutoIncRequestIDOnPost(

bool

enable);

356  static bool

GetDefaultAutoIncRequestIDOnPost(

void

);

374  static bool

IsValidSessionID(

const string

& session_id);

377  static

EOnBadSessionID GetBadSessionIDAction(

void

);

378  static void

SetBadSessionIDAction(EOnBadSessionID action);

381  static

ESessionIDFormat GetAllowedSessionIDFormat(

void

);

382  static void

SetAllowedSessionIDFormat(ESessionIDFormat fmt);

397  static string

SelectLastHitID(

const string

& hit_ids);

400  static string

SelectLastSessionID(

const string

& session_ids);

403  void

AddPassThroughProperty(

const string

& name,

const string

&

value

);

433  static void

SetRequestTracer(

const

shared_ptr<IRequestTracer>& tracer);

440  void SetTracerSpan

(

const

shared_ptr<ITracerSpan>& span) { m_TracerSpan = span; }

441

shared_ptr<ITracerSpan>

GetTracerSpan

(

void

)

const

{

return

m_TracerSpan; }

446  const string

GetTraceState(

void

)

const

;

447  const string

GetTraceParent(

void

)

const

;

470  void

StartRequest(

void

);

474  void

StopRequest(

void

);

480

eProp_RequestID = 1 << 0,

481

eProp_ClientIP = 1 << 1,

482

eProp_SessionID = 1 << 2,

483

eProp_HitID = 1 << 3,

484

eProp_ReqStatus = 1 << 4,

485

eProp_BytesRd = 1 << 5,

486

eProp_BytesWr = 1 << 6,

491  bool

x_IsSetProp(

EProperty

prop)

const

;

498  void x_LogHitID

(

bool

ignore_app_state =

false

)

const

;

503  void

x_UpdateSubHitID(

bool

increment,

CTempString

prefix);

505  static bool

& sx_GetDefaultAutoIncRequestIDOnPost(

void

);

508  bool

x_IsSetPassThroughProp(

CTempString

name,

bool

update)

const

;

510  const string

& x_GetPassThroughProp(

CTempString

name,

bool

update)

const

;

511  void

x_ResetPassThroughProp(

CTempString

name,

bool

update)

const

;

513  void

x_UpdateStdPassThroughProp(

CTempString

name)

const

;

515  void

x_UpdateStdContextProp(

CTempString

name)

const

;

517  static const CMask

& sx_GetContextFieldsMask(

void

);

518  static string

sx_NormalizeContextPropertyName(

const string

& name);

521  void

x_LoadEnvContextProperties(

void

);

523  friend class

CDiagBuffer;

524  bool

x_LogHitIDOnError(

void

)

const

;

526  bool

x_CanModify(

void

)

const

;

529  void

x_Modify(

void

);

532

fLoggedOnRequest = 1,

628  template

<

class

TCallback>

631

m_Context->x_UpdateStdPassThroughProp(

""

);

633  if

( !callback(it->first, it->second) )

break

;

638  string

x_SerializeUrlEncoded(

void

)

const

;

653

fPrintRequestStart = 1 << 0

672  void SetStatus

(

int

status) { m_RequestContext->SetRequestStatus(status); }

676  void

SetDefaultErrorStatus(

int

status);

683  void

Release(

void

);

687  int

m_ErrorStatus = 500;

690  bool

m_OriginatesFromThrow =

false

;

707  virtual const char

* GetErrCodeString(

void

)

const override

;

790  if

( !def_sid.empty() )

return

def_sid;

1045  ERR_POST_ONCE

(

"Attempt to modify a read-only request context."

);

Thread local context data stored in TLS.

EFormat

The formats are checked in the same order as declared here.

Take guard of the current CRequestContext, handle app-state, start/stop logging and request status in...

Request context properties passed between tasks.

CTempString implements a light-weight string on top of a storage buffer whose lifetime management is ...

The NCBI C++ standard methods for dealing with std::string.

#define ITERATE(Type, Var, Cont)

ITERATE macro to sequence through container elements.

TNCBIAtomicValue TValue

Alias TValue for TNCBIAtomicValue.

TValue Add(int delta) THROWS_NONE

Atomically add value (=delta), and return new counter value.

EContextFlags

Request context flags.

bool IsSetRequestID(void) const

Check if request ID was assigned a value.

CStopWatch & GetRequestTimer(void)

CRequestContext & GetRequestContext() const

Get the guarded request context.

TSubHitId GetNextSubHitId(void)

Get next sub-hit id value.

virtual const string & GetTraceState(void) const =0

void UnsetRequestStatus(void)

ESessionIDFormat

Session ID format.

bool IsSetBytesRd(void) const

TCount SetRequestID(void)

Assign the next available request ID to this request.

void SetBytesWr(Int8 bytes)

CEncodedString m_SessionID

EErrCode

Error types that CRequestContext can generate.

int GetRequestStatus(void) const

Request exit status.

#define ERR_POST_ONCE(message)

Error posting only once during program execution.

Uint8 TCount

Generic type for counters (posts, requests etc.)

Int8 GetBytesWr(void) const

Bytes written.

CObjectFor< CAtomicCounter > TSharedCounter

virtual void SetCustomAttribute(const string &attr, const string &value)=0

string GetEncodedSessionID(void) const

Get url-encoded session id.

CDiagContext & GetDiagContext(void)

Get diag context instance.

void SetTracerSpanKind(ITracerSpan::ESpanKind kind)

At least Opentememetry tracer allows to set span kind only at span creation time.

TProperties & GetProperties(void)

Get all properties (non-const)

bool GetAutoIncRequestIDOnPost(void) const

Get auto-increment state.

TSubHitId GetCurrentSubHitId(void) const

Get current sub-hit id value.

CRef< CRequestContext > m_SavedContext

void SetTracerSpan(const shared_ptr< ITracerSpan > &span)

map< string, string, PNocase > TPassThroughProperties

void x_SetProp(EProperty prop)

void Reset(CTempString name)

Reset property.

bool GetDisabledAppLog(void) const

string GetSessionID(void) const

Session ID.

CAtomicCounter::TValue TVersion

void SetSrcTraceParent(const string &parent)

void SetSrcTraceState(const string &state)

OpenTelemetry: set the incoming 'tracestate' and 'traceparent' values.

bool IsSetRequestStatus(void) const

bool x_IsSetProp(EProperty prop) const

const string & GetNextSubHitID(CTempString prefix=CTempString())

Get current hit id appended with auto-incremented sub-hit id.

bool IsSetBytesWr(void) const

void SetDtab(const string &dtab)

Int8 GetBytesRd(void) const

Bytes read.

static unique_ptr< TPassThroughProperties > sm_EnvContextProperties

static TCount GetNextRequestID(void)

Return the next available application-wide request ID.

CSharedHitId(const string &hit_id)

Set new hit id, checks its validity.

const string & Get(CTempString name) const

Get current property value or empty string if it's not set;.

map< string, string > TProperties

User-defined request properties.

shared_ptr< ITracerSpan > GetTracerSpan(void) const

virtual void PostEvent(const SDiagMessage &message)=0

CRef< TSharedCounter > m_SharedSubHitId

bool IsSetSessionID(void) const

void SetStatus(int status)

Set request context status.

TCount GetRequestID(void) const

Get request ID (or zero if not set).

CRequestContext_PassThrough(void)

Get CRequestContext_PassThrough for the current request context.

string GetClientIP(void) const

Client IP/hostname.

virtual ~IRequestTracer(void)

virtual const string & GetTraceParent(void) const =0

void x_LogHitID(void) const

void x_SetPassThroughProp(CTempString name, CTempString value, bool update) const

void SetHitId(const string &hit_id)

Set new hit id value. This resets sub-hit counter and makes it non-shared.

static shared_ptr< IRequestTracer > sm_Tracer

static string GetDefaultClientIP(void)

Get default client ip.

const string & GetSrcTraceParent(void) const

CDiagContext::EDisabledAppLogEvents GetDisabledAppLogEvents(void) const

void Enumerate(TCallback callback)

Enumerate all properties.

void SetAutoIncRequestIDOnPost(bool enable)

Auto-increment request ID with every posted message.

void SetRequestStatus(int status)

bool IsSetHitID(EHitIDSource src=eHitID_Any) const

Check if there's an explicit hit id or the default one.

virtual void EndSpan(void)=0

bool IsSet(CTempString name) const

Check if the property is set.

void UnsetRequestID(void)

Reset request ID.

const string & GetDtab(void) const

virtual void SetName(const string &name)=0

static CAtomicCounter sm_VersionCounter

bool x_IsSetPassThroughProp(CTempString name, bool update) const

bool x_LogHitIDOnError(void) const

const string GetTraceState(void) const

OpenTelemetry: get 'tracestate' and 'traceparent' values to be passed in HTTP headers.

CDiagContext::EDisabledAppLogEvents m_DisabledAppLogEvents

EHitIDSource

Hit ID Allowed source of the current hit id.

const CStopWatch & GetRequestTimer(void) const

Request execution timer.

EFormat

Supported serialization/deserialization formats.

CRef< CRequestContext > m_Context

static unique_ptr< CMaskFileName > sm_ContextFields

bool GetReadOnly(void) const

Get current read-only flag.

bool IsSetDtab(void) const

Dtab.

ITracerSpan::ESpanKind m_SpanKind

void UnsetSessionID(void)

bool IsSetExplicitClientIP(void) const

const string & x_GetPassThroughProp(CTempString name, bool update) const

void x_ResetPassThroughProp(CTempString name, bool update) const

bool IsRunning(void) const

EDisabledAppLogEvents

Flags for disabling groups of applog events with DIAG_DISABLE_APPLOG_MESSAGES.

void Set(CTempString name, CTempString value)

Set or update property value.

const string & SetSessionID(void)

Create and set new session ID.

CRequestContext & operator=(const CRequestContext &)

bool IsSetExplicitHitID(void) const

Check if there's an explicit hit id.

void SetBytesRd(Int8 bytes)

const string GetTraceParent(void) const

ITracerSpan::ESpanKind GetTracerSpanKind(void) const

EDiagAppState

Application execution states shown in the std prefix.

bool IsSetClientIP(void) const

shared_ptr< ITracerSpan > m_TracerSpan

bool IsShared(void) const

Check if shared counter is used.

SDiagMessage::TCount TCount

EOnBadSessionID

Session ID error actions.

virtual void SetSpanStatus(ESpanStatus status)=0

EDiagAppState GetAppState(void) const

Return application state for the current thread if it's set.

void UnsetHitID(void)

Reset explicit hit id.

const string & GetSrcTraceState(void) const

The getters provide access to the incoming values (unlike GetTraceState and GetTraceParent which retu...

string GetHitID(void) const

Get explicit hit id or the default one (from HTTP_NCBI_PHID etc).

virtual void OnRequestStart(CRequestContext &context)=0

virtual void SetHttpHeader(EHttpHeaderType header_type, const string &name, const string &value)=0

const TProperties & GetProperties(void) const

Get all properties (read only)

virtual void OnRequestStop(CRequestContext &context)=0

NCBI_EXCEPTION_DEFAULT(CRequestContextException, CException)

bool IsSetExplicitSessionID(void) const

Does not check default SID.

TPassThroughProperties m_PassThroughProperties

TVersion GetVersion(void) const

Return version increased on every context change (hit/subhit id, client ip, session id).

virtual ~ITracerSpan(void)

void SetShared(void) const

Mark this hit id as a shared one and start using shared counter.

void SetReadOnly(bool read_only)

Switch request context to read-only mode.

CRequestContext::TPassThroughProperties TProperties

shared_ptr< IRequestTracer > m_Tracer

const string & GetHitId(void) const

Get hit id value.

string GetDefaultSessionID(void) const

Get default session id.

virtual void SetAttribute(ESpanAttribute attr, const string &value)=0

CRequestContext(const CRequestContext &)

bool IsRequestLevel(void) const

Check if this hit ID was set at request level.

void x_UnsetProp(EProperty prop)

const string & GetCurrentSubHitID(CTempString prefix=CTempString())

Get the last generated sub-hit id.

void x_UpdateSubHitID(bool increment, CTempString prefix)

void SetDisabledAppLog(bool disable)

CRef< CRequestContext > m_RequestContext

string GetEncodedSessionID(void) const

Get URL-encoded session ID.

bool x_CanModify(void) const

void SetDisabledAppLogEvents(CDiagContext::EDisabledAppLogEvents events)

@ eSID_Ncbi

Strict NCBI format: (UID:16)_(RqID:4+)SID.

@ eSID_Standard

Alpanum, underscore, -.:@, (default)

@ eBadSession

Invalid session id.

@ eHitID_Request

Check if per-request hit id is set.

@ eHitID_Default

Check if default hit id is set.

@ eHitID_Any

Any hit id - always return true.

@ eDiagAppState_RequestEnd

RE.

@ eDiagAppState_RequestBegin

RB.

@ eDiagAppState_Request

R.

@ eOnBadSID_Allow

Don't validate session id.

@ eOnBadSID_IgnoreAndReport

Ignore and show warning.

@ eOnBadSID_AllowAndReport

Accept but show warning (default).

@ eOnBadSID_Ignore

Ignore bad session id.

#define EXCEPTION_VIRTUAL_BASE

Do not use virtual base classes in exception declaration at all, because in this case derived class s...

void Reset(void)

Reset reference object.

int64_t Int8

8-byte (64-bit) signed integer

uint64_t Uint8

8-byte (64-bit) unsigned integer

#define END_NCBI_SCOPE

End previously defined NCBI scope.

#define BEGIN_NCBI_SCOPE

Define ncbi namespace.

const string & GetEncodedString(void) const

Get encoded string.

const string & GetOriginalString(void) const

Get the original unencoded string.

void SetString(const CTempString s, NStr::EUrlEncode flag=NStr::eUrlEnc_SkipMarkChars)

Set new original string.

#define NCBI_XNCBI_EXPORT

The blob sat and sat key Both must be positive integers</td > n< td > Non empty string The interpretation of the blob id depends on a processor Cassandra n processor expects the following format

const TYPE & Get(const CNamedParameterList *param)

const GenericPointer< typename T::ValueType > T2 value

Defines NCBI C++ diagnostic APIs, classes, and macros.

Portable reference counted smart and weak pointers using CWeakRef, CRef, CObject and CObjectEx.

Defines: CTimeFormat - storage class for time format.

Defines CRequestStatus class for NCBI C++ diagnostic API.

static CNamedPipeClient * client

void Serialize(CNcbiOstream &, const CRawScoreVector< Key, Score > &)

Generics These throw an exception; we must implement serialization for each type.

void Deserialize(CNcbiIstream &istr, CRawScoreVector< Key, Score > &)

static CS_CONTEXT * context


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4