本文整理汇总了C++中PathNode::value方法的典型用法代码示例。如果您正苦于以下问题:C++ PathNode::value方法的具体用法?C++ PathNode::value怎么用?C++ PathNode::value使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PathNode
的用法示例。
在下文中一共展示了PathNode::value方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addAliasImpl
static inline bool addAliasImpl(PathNode &node, std::string const &source,
AliasPriority priority) {
if (!aliasNeedsUpdate(node, source, priority)) {
return false;
}
elements::AliasElement elt;
elt.setSource(source);
elt.priority() = priority;
node.value() = elt;
return true;
}
示例2: aliasNeedsUpdate
/// @brief Determine if the node needs updating given that we want to add an
/// alias there pointing to source with the given automatic status.
static inline bool aliasNeedsUpdate(PathNode &node,
std::string const &source,
AliasPriority priority) {
elements::AliasElement *elt =
boost::get<elements::AliasElement>(&node.value());
if (nullptr == elt) {
/// Always replace non-aliases
return true;
}
if (priority > elt->priority()) {
/// We're a higher-priority (manual vs automatic for instance), so
/// override
return true;
}
if (priority == elt->priority() && source != elt->getSource()) {
/// Same automatic status, different source: replace/update
return true;
}
return false;
}