本文整理汇总了C++中Visitor::add方法的典型用法代码示例。如果您正苦于以下问题:C++ Visitor::add方法的具体用法?C++ Visitor::add怎么用?C++ Visitor::add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Visitor
的用法示例。
在下文中一共展示了Visitor::add方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: processSimpleRelation
/// Parses relation as simple relation with non-relation children. If child is single, then
/// calls visitor with this child instead of relation.
void processSimpleRelation(Visitor &visitor, std::uint32_t featureId, const ptree &feature) const {
auto relation = parseRelation(featureId, feature.get_child("geometry.coordinates"));
if (relation.elements.size()==1) {
parseProperties(*relation.elements[0], featureId, feature.get_child("properties"));
visitor.add(*relation.elements[0]);
} else {
parseProperties(relation, featureId, feature.get_child("properties"));
visitor.add(relation);
}
}
示例2: for_each_gridpoint
inline void for_each_gridpoint (
const protobuf::HyperPrior::GammaPoisson & grid,
Visitor & visitor)
{
for (auto alpha : grid.alpha()) {
visitor.add().alpha = alpha;
}
visitor.done();
for (auto inv_beta : grid.inv_beta()) {
visitor.add().inv_beta = inv_beta;
}
visitor.done();
}
示例3: parseMultiPolygon
/// Parses relation with relations from multipolygon and notifies visitor.
void parseMultiPolygon(Visitor &visitor, std::uint32_t featureId, const ptree &feature) const {
utymap::entities::Relation relation;
parseProperties(relation, featureId, feature.get_child("properties"));
for (const ptree::value_type &geometry : feature.get_child("geometry.coordinates")) {
auto child = parseRelation(featureId, geometry.second);
if (child.elements.size()==1) {
FoldRelation fold;
child.elements[0]->accept(fold);
relation.elements.push_back(fold.element);
} else {
relation.elements.push_back(std::make_shared<utymap::entities::Relation>(child));
}
}
visitor.add(relation);
}
示例4: parsePoint
/// Parses node from point and notifies visitor.
void parsePoint(Visitor &visitor, std::uint32_t featureId, const ptree &feature) const {
utymap::entities::Node node;
parseProperties(node, featureId, feature.get_child("properties"));
node.coordinate = parseCoordinate(feature.get_child("geometry.coordinates"));
visitor.add(node);
}
示例5: parseLineString
/// Parses way from line string and notifies visitor.
void parseLineString(Visitor &visitor, std::uint32_t featureId, const ptree &feature) const {
utymap::entities::Way way;
parseProperties(way, featureId, feature.get_child("properties"));
way.coordinates = parseCoordinates(feature.get_child("geometry.coordinates"));
visitor.add(way);
}