本文整理汇总了C++中Tbl类的典型用法代码示例。如果您正苦于以下问题:C++ Tbl类的具体用法?C++ Tbl怎么用?C++ Tbl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Tbl类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: read_lane
std::vector<Lane> read_lane(const char *filename)
{
int max_id;
Tbl tbl = read_csv(filename, &max_id);
size_t i, n = tbl.size();
std::vector<Lane> ret(max_id + 1, {-1});
for (i=0; i<n; i++) {
int id = std::stoi(tbl[i][0]);
ret[id].lnid = id;
ret[id].did = std::stoi(tbl[i][1]);
ret[id].blid = std::stoi(tbl[i][2]);
ret[id].flid = std::stoi(tbl[i][3]);
ret[id].bnid = std::stoi(tbl[i][4]);
ret[id].fnid = std::stoi(tbl[i][5]);
ret[id].jct = std::stoi(tbl[i][6]);
ret[id].blid2 = std::stoi(tbl[i][7]);
ret[id].blid3 = std::stoi(tbl[i][8]);
ret[id].blid4 = std::stoi(tbl[i][9]);
ret[id].flid2 = std::stoi(tbl[i][10]);
ret[id].flid3 = std::stoi(tbl[i][11]);
ret[id].flid4 = std::stoi(tbl[i][12]);
ret[id].clossid = std::stoi(tbl[i][13]);
ret[id].span = std::stod(tbl[i][14]);
ret[id].lcnt = std::stoi(tbl[i][15]);
ret[id].lno = std::stoi(tbl[i][16]);
}
return ret;
}
示例2: _compare
bool _compare(const /*std::set<std::uint8_t>*/Sample& sample, Tbl& test)
{
if (sample.size() != test.size())
return false;
for (auto a : sample)
if (test.find(a) == test.end())
{
std::cout << "Not found: 0x" << std::setbase(16) << std::setw(2) << std::setfill('0') << /*(unsigned)*/a << std::endl;
return false;
}
return true;
}
示例3: read_node
std::vector<Node> read_node(const char *filename)
{
int max_id;
Tbl tbl = read_csv(filename, &max_id);
size_t i, n = tbl.size();
std::vector<Node> ret(max_id + 1, {-1});
for (i=0; i<n; i++) {
int id = std::stoi(tbl[i][0]);
ret[id].nid = id;
ret[id].pid = std::stoi(tbl[i][1]);
}
return ret;
}
示例4: read_roadedge
std::vector<RoadEdge> read_roadedge(const char* filename)
{
int max_id;
Tbl tbl = read_csv(filename, &max_id);
size_t i, n = tbl.size();
std::vector<RoadEdge> ret(max_id + 1, {-1});
for (i=0; i<n; i++) {
int id = std::stoi(tbl[i][0]);
ret[id].id = id;
ret[id].lid = std::stoi(tbl[i][1]);
ret[id].linkid = std::stoi(tbl[i][2]);
}
return ret;
}
示例5: read_areaclass
std::vector<AreaClass> read_areaclass(const char *filename)
{
int max_id;
Tbl tbl = read_csv(filename, &max_id);
size_t i, n = tbl.size();
std::vector<AreaClass> ret(max_id + 1, {-1});
for (i=0; i<n; i++) {
int id = std::stoi(tbl[i][0]);
ret[id].aid = id;
ret[id].slid = std::stoi(tbl[i][1]);
ret[id].elid = std::stoi(tbl[i][2]);
}
return ret;
}
示例6: read_poleclass
std::vector<PoleClass> read_poleclass(const char *filename)
{
int max_id;
Tbl tbl = read_csv(filename, &max_id);
size_t i, n = tbl.size();
std::vector<PoleClass> ret(max_id + 1, {-1});
for (i=0; i<n; i++) {
int id = std::stoi(tbl[i][0]);
ret[id].plid = id;
ret[id].vid = std::stoi(tbl[i][1]);
ret[id].length = std::stod(tbl[i][2]);
ret[id].dim = std::stod(tbl[i][3]);
}
return ret;
}
示例7: read_vectorclass
std::vector<VectorClass> read_vectorclass(const char *filename)
{
int max_id;
Tbl tbl = read_csv(filename, &max_id);
size_t i, n = tbl.size();
std::vector<VectorClass> ret(max_id + 1, {-1});
for (i=0; i<n; i++) {
int id = std::stoi(tbl[i][0]);
ret[id].vid = id;
ret[id].pid = std::stoi(tbl[i][1]);
ret[id].hang = std::stod(tbl[i][2]);
ret[id].vang = std::stod(tbl[i][3]);
}
return ret;
}
示例8: read_guardrail
std::vector<GuardRail> read_guardrail(const char* filename)
{
int max_id;
Tbl tbl = read_csv(filename, &max_id);
size_t i, n = tbl.size();
std::vector<GuardRail> ret(max_id + 1, {-1});
for (i=0; i<n; i++) {
int id = std::stoi(tbl[i][0]);
ret[id].id = id;
ret[id].aid = std::stoi(tbl[i][1]);
ret[id].type = std::stoi(tbl[i][2]);
ret[id].linkid = std::stoi(tbl[i][3]);
}
return ret;
}
示例9: read_streetlight
std::vector<StreetLight> read_streetlight(const char *filename)
{
int max_id;
Tbl tbl = read_csv(filename, &max_id);
size_t i, n = tbl.size();
std::vector<StreetLight> ret(max_id + 1, {-1});
for (i=0; i<n; i++) {
int id = std::stoi(tbl[i][0]);
ret[id].id = id;
ret[id].lid = std::stoi(tbl[i][1]);
ret[id].plid = std::stoi(tbl[i][2]);
ret[id].linkid = std::stoi(tbl[i][3]);
}
return ret;
}
示例10: read_roadmark
std::vector<RoadMark> read_roadmark(const char* filename)
{
int max_id;
Tbl tbl = read_csv(filename, &max_id);
size_t i, n = tbl.size();
std::vector<RoadMark> ret(max_id + 1, {-1});
for (i=0; i<n; i++) {
int id = std::stoi(tbl[i][0]);
ret[id].id = id;
ret[id].aid = std::stoi(tbl[i][1]);
ret[id].type = std::stoi(tbl[i][2]); // Don't use wide character
ret[id].linkid = std::stoi(tbl[i][3]);
}
return ret;
}
示例11: read_lineclass
std::vector<LineClass> read_lineclass(const char *filename)
{
int max_id;
Tbl tbl = read_csv(filename, &max_id);
size_t i, n = tbl.size();
std::vector<LineClass> ret(max_id + 1, {-1});
for (i=0; i<n; i++) {
int id = std::stoi(tbl[i][0]);
ret[id].lid = id;
ret[id].bpid = std::stoi(tbl[i][1]);
ret[id].fpid = std::stoi(tbl[i][2]);
ret[id].blid = std::stoi(tbl[i][3]);
ret[id].flid = std::stoi(tbl[i][4]);
}
return ret;
}
示例12: read_pcdfilerange
std::vector<PcdFileRange> read_pcdfilerange(const char* filename, double margin)
{
Tbl tbl = read_csv(filename);
size_t i, n = tbl.size();
std::vector<PcdFileRange> ret(n);
for (i=0; i<n; i++) {
ret[i].name = tbl[i][0];
ret[i].x_min = std::stod(tbl[i][1]) - margin;
ret[i].y_min = std::stod(tbl[i][2]) - margin;
ret[i].z_min = std::stod(tbl[i][3]) - margin;
ret[i].x_max = std::stod(tbl[i][4]) + margin;
ret[i].y_max = std::stod(tbl[i][5]) + margin;
ret[i].z_max = std::stod(tbl[i][6]) + margin;
}
return ret;
}
示例13: read_whiteline
std::vector<WhiteLine> read_whiteline(const char* filename)
{
int max_id;
Tbl tbl = read_csv(filename, &max_id);
size_t i, n = tbl.size();
std::vector<WhiteLine> ret(max_id + 1, {-1});
for (i=0; i<n; i++) {
int id = std::stoi(tbl[i][0]);
ret[id].id = id;
ret[id].lid = std::stoi(tbl[i][1]);
ret[id].width = std::stod(tbl[i][2]);
ret[id].color = tbl[i][3].c_str()[0];
ret[id].type = std::stoi(tbl[i][4]);
ret[id].linkid = std::stoi(tbl[i][5]);
}
return ret;
}
示例14: read_boxclass
std::vector<BoxClass> read_boxclass(const char *filename)
{
int max_id;
Tbl tbl = read_csv(filename, &max_id);
size_t i, n = tbl.size();
std::vector<BoxClass> ret(max_id + 1, {-1});
for (i=0; i<n; i++) {
int id = std::stoi(tbl[i][0]);
ret[id].bid = id;
ret[id].pid1 = std::stoi(tbl[i][1]);
ret[id].pid2 = std::stoi(tbl[i][2]);
ret[id].pid3 = std::stoi(tbl[i][3]);
ret[id].pid4 = std::stoi(tbl[i][4]);
ret[id].height = std::stod(tbl[i][5]);
}
return ret;
}
示例15: read_curb
std::vector<Curb> read_curb(const char* filename)
{
int max_id;
Tbl tbl = read_csv(filename, &max_id);
size_t i, n = tbl.size();
std::vector<Curb> ret(max_id + 1, {-1});
for (i=0; i<n; i++) {
int id = std::stoi(tbl[i][0]);
ret[id].id = id;
ret[id].lid = std::stoi(tbl[i][1]);
ret[id].height = std::stod(tbl[i][2]);
ret[id].width = std::stod(tbl[i][3]);
ret[id].dir = std::stoi(tbl[i][4]);
ret[id].linkid = std::stoi(tbl[i][5]);
}
return ret;
}