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/ncbi__usage__report_8hpp_source.html below:

NCBI C++ ToolKit: include/connect/ncbi_usage_report.hpp Source File

1 #ifndef CONNECT___NCBI_USAGE_REPORT__HPP 2 #define CONNECT___NCBI_USAGE_REPORT__HPP 57 #if defined(NCBI_THREADS) 58 # define NCBI_USAGE_REPORT_SUPPORTED 1 61 #if defined(NCBI_USAGE_REPORT_SUPPORTED) 64 # include <condition_variable> 148  static void

SetEnabled(

bool

enable =

true

);

152  static bool

IsEnabled(

void

);

167  static void

SetDefaultParameters(

TWhat

what = fDefault);

168  static TWhat

GetDefaultParameters(

void

);

183  static void

SetURL(

const string

& url);

184  static string

GetURL(

void

);

203  static void

SetAppName(

const string

& name);

204  static string

GetAppName(

void

);

223  static void

SetAppVersion(

const string

&

version

);

225  static string

GetAppVersion(

void

);

251  static void

SetMaxQueueSize(

unsigned n

);

252  static unsigned

GetMaxQueueSize();

269  static void

SetTimeout(

const CTimeout

& timeout);

292  static void

SetRetries(

int

retries);

297  static int

GetRetries();

302  static bool

CheckConnection();

331  template

<

typename

TValue>

502  CUsageReport

(

TWhat

what = fDefault,

const string

& url =

string

(),

unsigned

max_queue_size = 0);

517  void SetEnabled

(

bool

enable =

true

) { m_IsEnabled = enable; }

523  bool

IsEnabled(

void

);

573  template

<

typename

TJob>

void Send

(TJob& job)

577

x_SendAsync(job_ptr);

582  unsigned

GetQueueSize(

void

);

587  void

ClearQueue(

void

);

643  bool

CheckConnection();

655  bool

x_Send(

const string

& extra_params);

657  void

x_SendAsync(

TJobPtr

job_ptr);

659  void

x_ThreadHandler(

void

);

661  void

x_ClearQueue(

void

);

666 #if defined(NCBI_USAGE_REPORT_SUPPORTED) 707 #define NCBI_REPORT_USAGE(event, ...) __NCBI_REPORT_USAGE(event, __VA_ARGS__) 709 #define __NCBI_REPORT_USAGE(event, args) \ 711  CUsageReport& reporter = CUsageReport::Instance(); \ 712  if (reporter.IsEnabled()) { \ 713  CUsageReportParameters params; \ 714  params.Add("jsevent"

, (event)) args; \

715

reporter.Send(params); \

721 #define NCBI_REPORT_USAGE_START CUsageReportAPI::SetEnabled() 726 #define NCBI_REPORT_USAGE_WAIT CUsageReport::Instance().Wait(CUsageReport::eAlways) 727 #define NCBI_REPORT_USAGE_WAIT_ALWAYS CUsageReport::Instance().Wait(CUsageReport::eAlways) 728 #define NCBI_REPORT_USAGE_WAIT_TIMEOUT(t) CUsageReport::Instance().Wait(CUsageReport::eAlways, t) 729 #define NCBI_REPORT_USAGE_WAIT_IF_SUCCESS CUsageReport::Instance().Wait(CUsageReport::eSkipIfNoConnection) 733 #define NCBI_REPORT_USAGE_FINISH CUsageReport::Instance().Finish()

CTimeout – Timeout interval.

CUsageReportAPI:: Global settings related to the usage reporting.

CUsageReportBase:: Base class to define common types for CUsageReport API.

#define END_NCBI_SCOPE

End previously defined NCBI scope.

#define BEGIN_NCBI_SCOPE

Define ncbi namespace.

std::thread m_Thread

Reporting thread.

string m_URL

Reporting URL.

std::mutex m_Usage_Mutex

MT-protection to access members.

std::map< string, string > m_Params

Stored parameters.

CUsageReportParameters(void)

virtual void OnStateChange(EState)

Callback for async reporting.

std::condition_variable m_ThreadSignal

Signal conditional variable for reporting thread synchronization.

EWait m_WaitMode

Waiting mode.

std::mutex m_ThreadSignal_Mutex

CUsageReport(const CUsageReport &)=delete

Prevent copying.

CUsageReportJob & operator=(const CUsageReportJob &other)

Copy assignment operator.

bool m_IsEnabled

Enable/disable status.

size_t m_CountTotal

Statistics: number of jobs processed.

EState GetState()

Return current job state.

int TWhat

Binary OR of "EWhat".

CUsageReportParameters & Add(const string &name, TValue value)

EWhat

Defines what information should be reported by default by all reporters, in addition to passed parame...

bool m_IsFinishing

TRUE if Finish() has called and reporting thread should terminate.

void SetEnabled(bool enable=true)

Enable or disable usage reporter (current instance only).

EState m_State

Job state.

unsigned m_MaxQueueSize

Maximum allowed queue size.

CUsageReport & operator=(const CUsageReport &)=delete

string m_DefaultParams

Default parameters to report, concatenated and URL-encoded.

CUsageReportParameters & operator=(const CUsageReportParameters &other)

Copy assignment operator.

CDeadline m_WaitDeadline

Deadline for Wait(), if active.

CUsageReportParameters(const CUsageReportParameters &other)

Copy constructor.

bool m_IsWaiting

TRUE if Wait() is active.

size_t m_CountSent

Statistics: number of jobs successfully sent.

CUsageReportJob(const CUsageReportJob &other)

Copy constructor.

CUsageReportJob(void)

Default constructor.

list< TJobPtr > m_Queue

Job queue.

void Send(TJob &job)

Report usage statistics (asynchronously) (advanced version).

virtual ~CUsageReportJob(void)

Destructor.

@ fNone

No defaults, all parameters should be specified via CUsageReportParameters directly.

@ fAppVersion

Application version ("version")

@ fHost

Host name ("host")

@ fAppName

Application name ("appname")

@ eQueued

Added to queue (sending temporary postpones)

@ eFailed

Result: send failed.

@ eCanceled

Result: canceled / removed from queue.

@ eCompleted

Result: successfully sent.

@ eCreated

Initial state, not reported to OnStateChange()

@ eRunning

Ready to send.

@ eAlways

Always wait (default);.

@ eDefault

Default timeout (to be interpreted by the client code)

#define NCBI_XCONNECT_EXPORT

const string version

version string

const GenericPointer< typename T::ValueType > T2 value

The NCBI C++/STL use hints.

Defines: CTimeFormat - storage class for time format.

string ToString(const wxRect &rc)


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