Apollo 11.0
自动驾驶开放平台
apollo::hdmap::adapter::LanesXmlParser类 参考

#include <lanes_xml_parser.h>

apollo::hdmap::adapter::LanesXmlParser 的协作图:

静态 Public 成员函数

static Status Parse (const tinyxml2::XMLElement &xml_node, const std::string &road_id, std::vector< RoadSectionInternal > *sections)
 

详细描述

在文件 lanes_xml_parser.h 第 29 行定义.

成员函数说明

◆ Parse()

Status apollo::hdmap::adapter::LanesXmlParser::Parse ( const tinyxml2::XMLElement &  xml_node,
const std::string &  road_id,
std::vector< RoadSectionInternal > *  sections 
)
static

在文件 lanes_xml_parser.cc 第 28 行定义.

30 {
31 CHECK_NOTNULL(sections);
32 const auto lanes_node = xml_node.FirstChildElement("lanes");
33 CHECK_NOTNULL(lanes_node);
34 const tinyxml2::XMLElement* sub_node =
35 lanes_node->FirstChildElement("laneSection");
36 CHECK_NOTNULL(sub_node);
37
38 size_t section_cnt = 0;
39 while (sub_node) {
40 RoadSectionInternal section_internal;
41 std::string section_id = std::to_string(++section_cnt);
42 section_internal.id = section_id;
43 section_internal.section.mutable_id()->set_id(section_id);
44 RETURN_IF_ERROR(ParseLaneSection(*sub_node, &section_internal.lanes));
45 RETURN_IF_ERROR(ParseSectionBoundary(
46 *sub_node,
47 section_internal.section.mutable_boundary()->mutable_outer_polygon()));
48 sections->push_back(section_internal);
49
50 sub_node = sub_node->NextSiblingElement("laneSection");
51 }
52
53 CHECK_NE(sections->size(), 0U);
54
55 return Status::OK();
56}
static Status OK()
generate a success status.
Definition status.h:60
#define RETURN_IF_ERROR(expr)
Definition status.h:25

该类的文档由以下文件生成: