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

NCBI C++ ToolKit: src/app/pubseq_gateway/client/psg_client_cgi.cpp Source File

50  template

<

typename

TF>

51

invoke_result_t<TF, const string&>

Get

(

const string

&

key

, TF

f

, invoke_result_t<TF, const string&> def_value)

const

;

53  template

<

typename

T>

54  T GetNumeric

(

const string

&

key

)

const

{

return Get

(

key

, [](

const auto

& v) {

return

NStr::StringToNumeric<T>(v); },

T

()); }

59 template

<

typename

TF>

60

invoke_result_t<TF, const string&>

SPsgCgiEntries::Get

(

const string

&

key

, TF

f

, invoke_result_t<TF, const string&> def_value)

const 63  return

found ==

entries

.

end

() ? def_value :

f

(found->second.GetValue());

70  transform

(range.first, range.second, back_inserter(rv), [](

const auto

& p) {

return

p.second.GetValue(); });

77 template

<

class

TParams>

78 struct

SBase : TParams

80  template

<

class

... TInitArgs>

86

std::forward<TInitArgs>(init_args)...

95 struct

SOneRequest : SBase<SOneRequestParams>

104

GetDataOnlyOutputFormat(

entries

)

122 template

<

class

TParams>

123 struct

SParallelProcessing : SBase<TParams>

125  template

<

class

... TInitArgs>

133

std::forward<TInitArgs>(init_args)...

139 struct

SBatchResolve : SParallelProcessing<SBatchResolveParams>

171  void

ForEachTSE(

TExclude

exclude)

const

;

175  auto GetSNPScaleLimit

()

const

{

return

objects::CSeq_id::GetSNPScaleLimit_Value(

input

.GetString(

"snp-scale-limit"

)); }

177  void

SetRequestFlags(shared_ptr<CPSG_Request> request)

const

;

183  return

[&](

const string

& name) {

184  return input

.Has(name);

192  auto

ids =

input

.GetStringList(

"id"

);

194  for

(

const auto

&

id

: ids) {

198

rv.emplace_back(

id

);

207  const auto

&

id

=

input

.GetString(

"id"

);

218  auto

blob_ids =

input

.GetStringList(

"exclude-blob"

);

220  for

(

const auto

& blob_id : blob_ids) {

227  if

(

input

.Has(

"include-hup"

)) {

235

m_Response(response),

261  void Error

(

int

status);

274

m_Response.SetContentType(

"application/octet-stream"

);

278

m_Response.SetContentType(

"x-ncbi-data/x-asn-binary"

);

282

m_Response.SetContentType(

"x-ncbi-data/x-asn-text"

);

286

m_Response.SetContentType(

"text/xml"

);

290

m_Response.SetContentType(

"application/json"

);

294

m_Response.WriteHeader() << m_Out.rdbuf();

297

cerr << m_Err.rdbuf();

304

m_Response.SetContentType(

"application/problem+json"

);

309

m_Response.WriteHeader() << doc;

311

m_Response.WriteHeader() << m_Err.rdbuf();

317  void Init

()

override

;

319  int

Help(

const string

& request,

bool

json,

CCgiResponse

& response);

321  static int

GetStatus(

int

rv);

324  template

<

class

TChild,

class

TParent,

class

... TArgs>

325  static

TChild*

NewChild

(TParent* parent, TArgs&&... args)

328  auto

child =

new

TChild(std::forward<TArgs>(args)...);

329

parent->AppendChild(child);

347  const auto

& request =

ctx

.GetRequest();

359  if

(

type

==

"resolve"

) {

361

}

else if

(

type

==

"ipg_resolve"

) {

369

response.

DataOnly

(builder.data_only);

373  const auto

status = GetStatus(rv);

374

SetHTTPStatus(status);

383  if

(!help_doc.

Read

(

"pubseq_gateway.json"

)) {

385

response.

WriteHeader

() <<

"Missing 'pubseq_gateway.json'\n"

;

390  auto

request_obj = help_obj[

"request"

].

SetObject

();

393  if

(request_obj.has(request)) {

394  auto i

= request_obj.begin();

396  while

(

i

!= request_obj.end()) {

397  if

(

i

->name != request) {

398  i

= request_obj.erase(

i

);

412

NewChild<CHTML_title>(html.

GetPointer

())->AppendPlainText(

"help"

);

413  auto

body = NewChild<CHTML_body>(html.

GetPointer

());

415

NewChild<CHTML_h2>(body)->AppendPlainText(

"pubseq_gateway.cgi"

);

416

NewChild<CHTMLPlainText>(body,

"A user-friendly CGI gateway to PSG."

);

418  auto i

= help_obj.find(

"Common Parameters"

);

420  if

(

i

!= help_obj.end()) {

421

AddParamsTable(body,

i

->name, *

i

);

424  for

(

const auto

&

r

: request_obj) {

425

NewChild<CHTML_hr>(body);

427  auto

h2 = NewChild<CHTML_h2>(body);

428

NewChild<CHTML_i>(h2)->AppendPlainText(

"request"

);

429

h2->AppendPlainText(

string

(

"="

) +

r

.name);

431  auto

r_obj =

r

.value.GetObject();

432  auto

k = r_obj.find(

"method"

);

434  if

(k != r_obj.end()) {

435  for

(

const auto

& m : k->value.GetObject()) {

436  auto

m_obj = m.value.GetObject();

437

NewChild<CHTML_h3>(body, m.name +

string

(

":"

));

438

NewChild<CHTMLPlainText>(body, m_obj[

"description"

].GetValue().GetString());

440  auto

j = m_obj.find(

"Method-specific Parameters"

);

442  if

(j != m_obj.end()) {

443

AddParamsTable(body, m.name +

string

(

"-specific Parameters"

), *j);

447

NewChild<CHTMLPlainText>(body, r_obj[

"description"

].GetValue().GetString());

450  auto

j = r_obj.find(

"Request-specific Parameters"

);

452  if

(j != r_obj.end()) {

453

AddParamsTable(body, j->name, *j);

475

NewChild<CHTML_h4>(body, name);

476  auto table

= NewChild<CHTML_table>(body);

481  auto

header =

table

->HeaderCell(

r

, 0);

482

header->AppendPlainText(

type

.

name

);

483

header->SetColSpan(2);

486  for

(

const auto

& param :

type

.value.GetObject()) {

487

NewChild<CHTML_i>(

table

->DataCell(

r

, 0))->AppendPlainText(param.name);

488  table

->DataCell(

r

, 1)->AppendPlainText(param.value.GetValue().GetString());

494 int main

(

int

argc,

const char

* argv[])

Exception classes used by the NCBI CGI framework.

void transform(Container &c, UnaryFunction *op)

CJson_ConstObject GetObject(void) const

Get JSON object contents of the node.

const CJson_ConstNode value

bool Read(std::istream &in)

Read JSON data from a stream.

CJson_Object SetObject(void)

Get JSON object contents of the node.

CJson_Value SetValue(void)

Get JSON value contents of the node.

CJson_Value & SetString(const TStringType &value)

CJson_Value & SetInt8(Int8 value)

Bio-id (such as accession)

shared_ptr< void > TApiLock

Get an API lock.

static TApiLock GetApiLock()

CNullable< string > TNucleotide

static int OneRequest(const SOneRequestParams &params, shared_ptr< CPSG_Request > request)

static int ParallelProcessing(const TParams &params, istream &is=cin)

int Help(const string &request, bool json, CCgiResponse &response)

void Init() override

This method is called on the CGI application initialization – before starting to process a HTTP reque...

static int GetStatus(int rv)

static TChild * NewChild(TParent *parent, TArgs &&... args)

static void AddParamsTable(CHTML_body *body, const string &name, const CJson_ConstObject_pair &params)

int ProcessRequest(CCgiContext &ctx) override

This is the method you should override.

CPSG_Queue::TApiLock m_ApiLock

CTimeout – Timeout interval.

const_iterator_pair equal_range(const key_type &key) const

const_iterator find(const key_type &key) const

const_iterator end() const

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.

void Flush(void) const

Flush output stream.

void SetContentType(const string &type)

Set content type (text/html by default if not provided)

CNcbiOstream & WriteHeader(void) const

Write HTTP response header to the output stream.

@ fDoNotParseContent

do not automatically parse the request's content body (from "istr")

@ fDisableParsingAsIndex

Disable parsing input as 'indexed' query (RFC3875) even if no '=' is present.

EDiagSev

Severity level for the posted diagnostics.

static bool StrToSeverityLevel(const char *str_sev, EDiagSev &sev)

Get severity from string.

@ eDiag_Warning

Warning message.

@ e500_InternalServerError

void Error(CExceptionArgs_Base &args)

#define NCBI_THROW(exception_class, err_code, message)

Generic macro to throw an exception, given the exception class, error code and message string.

ESerialDataFormat

Data file format.

@ eSerial_AsnText

ASN.1 text.

@ eSerial_AsnBinary

ASN.1 binary.

TObjectType * GetPointer(void) THROWS_NONE

Get pointer,.

static int StringToInt(const CTempString str, TStringToNumFlags flags=0, int base=10)

Convert string to int.

static Int8 StringToInt8(const CTempString str, TStringToNumFlags flags=0, int base=10)

Convert string to Int8.

static string URLDecode(const CTempString str, EUrlDecode flag=eUrlDec_All)

URL-decode string.

@ eDefault

Default timeout (to be interpreted by the client code)

E_Choice

Choice variants.

unsigned int

A callback function used to compare two keys in a database.

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

<!DOCTYPE HTML >< html > n< header > n< title > PubSeq Gateway Help Page</title > n< style > n table

SParallelProcessing< TIpgBatchResolveParams > TIpgBatchResolve

const struct ncbi::grid::netcache::search::fields::KEY key

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

@ eSuccess

Successfully retrieved.

@ eForbidden

User is not authorized for the retrieval.

@ eError

An error was encountered while trying to send request or to read and to process the reply.

vector< CPSG_BioId > CPSG_BioIds

EPSG_BioIdResolution

Whether to try to resolve provided seq-ids before use.

@ Resolve

Try to resolve provided seq-ids.

@ NoResolve

Use provided seq-ids as is.

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

static SLJIT_INLINE sljit_ins l(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)

SBase(const SPsgCgiEntries &entries, TInitArgs &&... init_args)

SBatchResolve(const SPsgCgiEntries &entries)

SOneRequest(const SPsgCgiEntries &entries)

static ESerialDataFormat GetDataOnlyOutputFormat(const SPsgCgiEntries &entries)

SParallelProcessing(const SPsgCgiEntries &entries, TInitArgs &&... init_args)

const ESerialDataFormat output_format

static void SetDefault(const T &value)

Arbitrary request URL arguments.

T GetNumeric(const string &key) const

bool Has(const string &key) const

SPsgCgiEntries(const TCgiEntries &e)

auto GetStringList(const string &key) const

invoke_result_t< TF, const string & > Get(const string &key, TF f, invoke_result_t< TF, const string & > def_value) const

const TCgiEntries & entries

const string & GetString(const string &key) const

SReader(const SPsgCgiEntries &i)

SPSG_UserArgs GetUserArgs() const

auto GetAccSubstitution() const

auto GetNucleotide() const

CTimeout GetResendTimeout() const

EPSG_BioIdResolution GetBioIdResolution() const

auto GetSNPScaleLimit() const

CPSG_BioId GetBioId() const

auto GetAbsPathRef() const

const SPsgCgiEntries & input

auto GetBioIdType() const

vector< string > GetNamedAnnots() const

static CPSG_BioId::TType GetBioIdType(const string &type)

function< void(string)> TExclude

static shared_ptr< TRequest > Build(const TInput &input, TArgs &&... args)

static EPSG_AccSubstitution GetAccSubstitution(const string &acc_substitution)

static SResolveParams GetResolveParams(const TInput &input)

function< bool(const string &)> TSpecified

void DataOnly(const SOneRequestParams::SDataOnly &data_only)

CCgiResponse & m_Response

void operator()(int status)

optional< ESerialDataFormat > m_Format

SResponse(CCgiResponse &response)

static wxAcceleratorEntry entries[3]


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