本文整理汇总了C++中ConstElementPtr::getStatus方法的典型用法代码示例。如果您正苦于以下问题:C++ ConstElementPtr::getStatus方法的具体用法?C++ ConstElementPtr::getStatus怎么用?C++ ConstElementPtr::getStatus使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ConstElementPtr
的用法示例。
在下文中一共展示了ConstElementPtr::getStatus方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: isCorrectOrder
/**
* Returns true if e1, e2 is in the correct ordering for matching. This does a few things:
*
* - Avoid comparing e1 to e2 and e2 to e1
* - The Unknown1/Input1 is always e1. This is a requirement for some of the older code.
* - Gives a consistent ordering to allow backwards compatibility with system tests.
*/
bool isCorrectOrder(const ConstElementPtr& e1, const ConstElementPtr& e2)
{
if (e1->getStatus().getEnum() == e2->getStatus().getEnum())
{
return e1->getElementId() < e2->getElementId();
}
else
{
return e1->getStatus().getEnum() < e2->getStatus().getEnum();
}
}
示例2: isRelated
static bool isRelated(ConstElementPtr e1, ConstElementPtr e2)
{
if (e1->getStatus() != e2->getStatus() &&
e1->isUnknown() && e2->isUnknown() &&
OsmSchema::getInstance().isBuilding(e1->getTags(), e1->getElementType()) &&
OsmSchema::getInstance().isBuilding(e2->getTags(), e2->getElementType()))
{
return true;
}
else
{
return false;
}
}
示例3: visit
virtual void visit(const ConstElementPtr& e)
{
if (e->getStatus() == _matchStatus && isMatchCandidate(e))
{
checkForMatch(e);
}
}
示例4: _createTags
void OsmApiDbSqlChangesetFileWriter::_createTags(ConstElementPtr element)
{
LOG_TRACE("Creating tags for: " << element->getElementId());
QStringList tableNames = _tagTableNamesForElement(element->getElementId());
Tags tags = element->getTags();
if (_includeDebugTags)
{
tags.set(MetadataTags::HootStatus(), QString::number(element->getStatus().getEnum()));
}
LOG_VART(tags);
if (element->getElementType().getEnum() == ElementType::Relation && !tags.contains("type"))
{
ConstRelationPtr tmp = boost::dynamic_pointer_cast<const Relation>(element);
tags.appendValue("type", tmp->getType());
}
for (Tags::const_iterator it = tags.begin(); it != tags.end(); ++it)
{
QString k = it.key();
QString v = it.value();
if (k != MetadataTags::HootHash())
{
const QString currentTagValues =
QString("(%1_id, k, v) VALUES (%2, '%3', '%4');\n")
.arg(element->getElementId().getType().toString().toLower())
.arg(element->getElementId().getId())
.arg(k.replace('\'', "''"))
.arg(v.replace('\'', "''"));
const QString tagValues =
QString("(%1_id, k, v, version) VALUES (%2, '%3', '%4', %5);\n")
.arg(element->getElementId().getType().toString().toLower())
.arg(element->getElementId().getId())
.arg(k.replace('\'', "''"))
.arg(v.replace('\'', "''"))
.arg(element->getVersion());
_outputSql.write(
(QString("INSERT INTO %1 ").arg(tableNames.at(0)) + currentTagValues).toUtf8());
_outputSql.write((QString("INSERT INTO %1 ").arg(tableNames.at(1)) + tagValues).toUtf8());
}
}
}