本文整理汇总了C++中Bindings::push_back方法的典型用法代码示例。如果您正苦于以下问题:C++ Bindings::push_back方法的具体用法?C++ Bindings::push_back怎么用?C++ Bindings::push_back使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bindings
的用法示例。
在下文中一共展示了Bindings::push_back方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getUnexpiredContactsInstrument
// TODO : Unclear how big this dataset would be, decide if this should be removed
bool RegDB::getUnexpiredContactsInstrument(const string& instrument, int timeNow, Bindings& bindings) const
{
mongo::BSONObj query = BSON(
"instrument" << instrument <<
"expirationTime" << BSON_GREATER_THAN(timeNow));
mongo::ScopedDbConnection conn(_info.getConnectionString());
auto_ptr<mongo::DBClientCursor> pCursor = conn->query(_info.getNS(), query);
if (pCursor.get() && pCursor->more())
{
while (pCursor->more()) {
bindings.push_back(RegBinding(pCursor->next()));
}
conn.done();
return true;
}
conn.done();
return false;
}
示例2: getUnexpiredContactsUserContaining
bool RegDB::getUnexpiredContactsUserContaining(const string& matchIdentity, int timeNow, Bindings& bindings) const
{
mongo::BSONObj query = BSON("expirationTime" << BSON_GREATER_THAN(timeNow));
mongo::ScopedDbConnection conn(_info.getConnectionString());
auto_ptr<mongo::DBClientCursor> pCursor = conn->query(_info.getNS(), query);
if (pCursor.get() && pCursor->more())
{
while (pCursor->more())
{
RegBinding binding(pCursor->next());
if (binding.getContact().find(matchIdentity) != string::npos)
bindings.push_back(binding);
}
conn.done();
return bindings.size() > 0;
}
conn.done();
return false;
}
示例3: getUnexpiredContactsUser
bool RegDB::getUnexpiredContactsUser(const string& identity, int timeNow, Bindings& bindings) const
{
static string gruuPrefix = GRUU_PREFIX;
bool isGruu = identity.substr(0, gruuPrefix.size()) == gruuPrefix;
mongo::BSONObj query;
if (isGruu)
{
string searchString(identity);
searchString += ";";
searchString += SIP_GRUU_URI_PARAM;
query = BSON(
"gruu" << searchString <<
"expirationTime" << BSON_GREATER_THAN(timeNow));
}
else
{
query = BSON(
"identity" << identity <<
"expirationTime" << BSON_GREATER_THAN(timeNow));
}
mongo::ScopedDbConnection conn(_info.getConnectionString());
auto_ptr<mongo::DBClientCursor> pCursor = conn->query(_info.getNS(), query);
if (pCursor.get() && pCursor->more())
{
while (pCursor->more())
{
bindings.push_back(RegBinding(pCursor->next()));
}
conn.done();
return true;
}
conn.done();
return false;
}