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

NCBI C++ ToolKit: src/sample/app/psg_client/psg_client_sample.cpp Source File

38 template

<

class

TReply>

41  for

(

auto

message =

r

->GetNextMessage(); message; message =

r

->GetNextMessage()) {

42

cout << message << endl;

50  auto

bioseq_info = static_pointer_cast<CPSG_BioseqInfo>(item);

51

cout << bioseq_info->GetCanonicalId().GetId() << endl;

53

cerr <<

"Unexpected item type: "

<< item_type << endl;

56

cerr <<

"Timeout on getting an item status"

<< endl;

65

cerr <<

"Timeout on getting a reply status"

<< endl;

78  if

(event_loop.

Run

(timeout)) {

82

cerr <<

"Timeout on getting a reply"

<< endl;

86

cerr <<

"Timeout on sending a request"

<< endl;

90 int Queue

(

const string

& service, shared_ptr<CPSG_Request> request,

CTimeout

timeout)

95  for

(

auto

item = reply->GetNextItem(timeout); item; item = reply->GetNextItem(timeout)) {

104

cerr <<

"Timeout on getting a reply"

<< endl;

108

cerr <<

"Timeout on sending a request"

<< endl;

115  virtual void Init

();

122

arg_desc->SetUsageContext(

GetArguments

().GetProgramBasename(),

"PSG client API sample"

);

123

arg_desc->AddDefaultKey(

"service"

,

"SERVICE"

,

"PSG service name or host:port pair"

,

CArgDescriptions::eString

,

""

);

125

arg_desc->AddFlag(

"event-loop"

,

"Use event loop instead of queue"

);

126

arg_desc->AddFlag(

"https"

,

"Enable HTTPS"

);

133  const auto

& args =

GetArgs

();

136

TPSG_Https::SetDefault(

true

);

139  auto

service = args[

"service"

].AsString();

140  auto

request = make_shared<CPSG_Request_Resolve>(args[

"ID"

].AsString());

141  auto

timeout =

CTimeout

(args[

"timeout"

].AsDouble());

143  return

args[

"event-loop"

].HasValue() ?

EventLoop

(service, request, timeout) :

Queue

(service, request, timeout);

146 int main

(

int

argc,

const char

* argv[])

A class derived from the queue class that additionally allows to run event loop.

bool Run(CDeadline deadline)

Process everything in the queue until it's empty or times out.

A queue to retrieve data (accession resolution info; bio-sequence; annotation blobs) from the storage...

bool SendRequest(shared_ptr< CPSG_Request > request, CDeadline deadline)

Push request into the queue.

shared_ptr< CPSG_Reply > SendRequestAndGetReply(shared_ptr< CPSG_Request > request, CDeadline deadline)

Push request into the queue and get corresponding reply.

void Stop()

Stop accepting new requests.

@ eEndOfReply

No more items expected in the (overall!) reply.

virtual void Init()

Initialize the application.

virtual int Run()

Run the application.

CTimeout – Timeout interval.

virtual const CArgs & GetArgs(void) const

Get parsed command line arguments.

int AppMain(int argc, const char *const *argv, const char *const *envp=0, EAppDiagStream diag=eDS_Default, const char *conf=NcbiEmptyCStr, const string &name=NcbiEmptyString)

Main function (entry point) for the NCBI application.

virtual void SetupArgDescriptions(CArgDescriptions *arg_desc)

Setup the command line argument descriptions.

const CNcbiArguments & GetArguments(void) const

Get the application's cached unprocessed command-line arguments.

@ eDouble

Convertible into a floating point number (double)

@ eString

An arbitrary string.

Defines the CNcbiApplication and CAppException classes for creating NCBI applications.

double r(size_t dimension_, const Int4 *score_, const double *prob_, double theta_)

EPSG_Status

Retrieval result.

@ eSuccess

Successfully retrieved.

@ eInProgress

Retrieval is not finalized yet, more info may come.

void ReportErrors(TReply r)

int Queue(const string &service, shared_ptr< CPSG_Request > request, CTimeout timeout)

int EventLoop(const string &service, shared_ptr< CPSG_Request > request, CTimeout timeout)

void OnReplyComplete(EPSG_Status status, const shared_ptr< CPSG_Reply > &reply)

int main(int argc, const char *argv[])

void OnItemComplete(EPSG_Status status, const shared_ptr< CPSG_ReplyItem > &item)


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