本文整理汇总了C++中Entities::fill方法的典型用法代码示例。如果您正苦于以下问题:C++ Entities::fill方法的具体用法?C++ Entities::fill怎么用?C++ Entities::fill使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Entities
的用法示例。
在下文中一共展示了Entities::fill方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: postQueryContext
/* ****************************************************************************
*
* postBatchQuery -
*
* POST /v2/op/query
*
* Payload In: BatchQueryRequest
* Payload Out: Entities
*
* URI parameters:
* - limit=NUMBER
* - offset=NUMBER
* - options=count,keyValues
*/
std::string postBatchQuery
(
ConnectionInfo* ciP,
int components,
std::vector<std::string>& compV,
ParseData* parseDataP
)
{
BatchQuery* bqP = &parseDataP->bq.res;
QueryContextRequest* qcrP = &parseDataP->qcr.res;
Entities entities;
std::string answer;
qcrP->fill(bqP);
bqP->release(); // qcrP just 'took over' the data from bqP, bqP no longer needed
answer = postQueryContext(ciP, components, compV, parseDataP);
if (ciP->httpStatusCode != SccOk)
{
parseDataP->qcr.res.release();
return answer;
}
// 03. Render Entities response
if (parseDataP->qcrs.res.contextElementResponseVector.size() == 0)
{
ciP->httpStatusCode = SccOk;
answer = "[]";
}
else
{
entities.fill(&parseDataP->qcrs.res);
TIMED_RENDER(answer = entities.render(ciP, EntitiesResponse));
}
// 04. Cleanup and return result
entities.release();
parseDataP->qcr.res.release();
return answer;
}
示例2: postQueryContext
/* ****************************************************************************
*
* getEntities -
*
* GET /v2/entities
*
* Payload In: None
* Payload Out: Entities
*
* URI parameters:
* - limit=NUMBER
* - offset=NUMBER
* - count=true/false
*
* 01. Fill in QueryContextRequest
* 02. Call standard op postQueryContext
* 03. Render Entities response
* 04. Cleanup and return result
*/
std::string getEntities
(
ConnectionInfo* ciP,
int components,
std::vector<std::string>& compV,
ParseData* parseDataP
)
{
std::string answer;
Entities entities;
// 01. Fill in QueryContextRequest
parseDataP->qcr.res.fill(".*", "", "true", EntityTypeEmptyOrNotEmpty, "");
// 02. Call standard op postQueryContext
answer = postQueryContext(ciP, components, compV, parseDataP);
// 03. Render Entities response
if (parseDataP->qcrs.res.contextElementResponseVector.size() == 0)
{
ciP->httpStatusCode = SccOk;
answer = "[]";
}
else
{
entities.fill(&parseDataP->qcrs.res);
answer = entities.render(ciP, EntitiesResponse);
}
// 04. Cleanup and return result
entities.release();
parseDataP->qcr.res.release();
return answer;
}
示例3: oe
//.........这里部分代码省略.........
}
//
// As 'geometry' is present, so is 'coords' - checking coords
//
int noOfCoords = stringSplit(coords, ';', coordsV);
if (noOfCoords == 0)
{
OrionError oe(SccBadRequest, "URI param /coords/ has no coordinates");
TIMED_RENDER(out = oe.render(ciP, ""));
return out;
}
if ((geo.areaType == "circle") && (noOfCoords != 1))
{
OrionError oe(SccBadRequest, "Too many coordinates for circle");
TIMED_RENDER(out = oe.render(ciP, ""));
return out;
}
if ((geo.areaType == "polygon") && (noOfCoords < 3))
{
OrionError oe(SccBadRequest, "Too few coordinates for polygon");
TIMED_RENDER(out = oe.render(ciP, ""));
return out;
}
}
//
// 01. Fill in QueryContextRequest - type "" is valid for all types
//
parseDataP->qcr.res.fill(pattern, ciP->uriParam["type"], "true", EntityTypeEmptyOrNotEmpty, "");
// If URI param 'q' is given, its value must be put in a scope
if (q != "")
{
Scope* scopeP = new Scope(SCOPE_TYPE_SIMPLE_QUERY, q);
parseDataP->qcr.res.restriction.scopeVector.push_back(scopeP);
}
// If URI params 'geometry' and 'coords' are given, another scope is to be created for this
if ((coords != "") && (geometry != ""))
{
Scope* scopeP = new Scope(SCOPE_TYPE_LOCATION, "");
std::string errorString;
if (scopeP->fill(&geo, coordsV, &errorString) != 0)
{
OrionError oe(SccBadRequest, errorString);
TIMED_RENDER(out = oe.render(ciP, ""));
return out;
}
parseDataP->qcr.res.restriction.scopeVector.push_back(scopeP);
}
// 02. Call standard op postQueryContext
answer = postQueryContext(ciP, components, compV, parseDataP);
if (ciP->httpStatusCode != SccOk)
{
// Something went wrong in the query, an invalid pattern for example
parseDataP->qcr.res.release();
return answer;
}
// 03. Render Entities response
if (parseDataP->qcrs.res.contextElementResponseVector.size() == 0)
{
ciP->httpStatusCode = SccOk;
answer = "[]";
}
else
{
entities.fill(&parseDataP->qcrs.res);
TIMED_RENDER(answer = entities.render(ciP, EntitiesResponse));
}
// 04. Cleanup and return result
entities.release();
parseDataP->qcr.res.release();
return answer;
}