• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ Tbl类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中Tbl的典型用法代码示例。如果您正苦于以下问题:C++ Tbl类的具体用法?C++ Tbl怎么用?C++ Tbl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了Tbl类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:ZenzouFuruta,项目名称:Autoware,代码行数:28,代码来源:vector_map_query.cpp


示例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;
}
开发者ID:mvoronoy,项目名称:OP.MagicTrie,代码行数:12,代码来源:tr.cpp


示例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;
}
开发者ID:ZenzouFuruta,项目名称:Autoware,代码行数:13,代码来源:vector_map_query.cpp


示例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;
}
开发者ID:ZenzouFuruta,项目名称:Autoware,代码行数:14,代码来源:vector_map_query.cpp


示例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;
}
开发者ID:ZenzouFuruta,项目名称:Autoware,代码行数:14,代码来源:vector_map_query.cpp


示例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;
}
开发者ID:ZenzouFuruta,项目名称:Autoware,代码行数:15,代码来源:vector_map_query.cpp


示例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;
}
开发者ID:ZenzouFuruta,项目名称:Autoware,代码行数:15,代码来源:vector_map_query.cpp


示例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;
}
开发者ID:ZenzouFuruta,项目名称:Autoware,代码行数:15,代码来源:vector_map_query.cpp


示例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;
}
开发者ID:ZenzouFuruta,项目名称:Autoware,代码行数:15,代码来源:vector_map_query.cpp


示例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;
}
开发者ID:ZenzouFuruta,项目名称:Autoware,代码行数:15,代码来源:vector_map_query.cpp


示例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;
}
开发者ID:ZenzouFuruta,项目名称:Autoware,代码行数:16,代码来源:vector_map_query.cpp


示例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;
}
开发者ID:794523332,项目名称:Autoware,代码行数:16,代码来源:points_map_query.cpp


示例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;
}
开发者ID:ZenzouFuruta,项目名称:Autoware,代码行数:17,代码来源:vector_map_query.cpp


示例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;
}
开发者ID:ZenzouFuruta,项目名称:Autoware,代码行数:17,代码来源:vector_map_query.cpp


示例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;
}
开发者ID:ZenzouFuruta,项目名称:Autoware,代码行数:17,代码来源:vector_map_query.cpp


示例16: _randomize_array

std::set<std::string> _randomize_array(Tbl& tbl, F && f)
{
    std::set<std::string> result;
    while (tbl.size() < tbl.capacity())
    {
        std::string s;
        auto l = (std::rand() % (Tbl::chunk_limit_c-1))+1;
        while (l--)
            s+=(static_cast<char>(std::rand() % ('_' - '0')) + '0');
        
        if (tbl.insert(s.begin(), s.end()) != tbl.end())
        {
            result.insert(s);
            f();
        }
    }
    return result;
}
开发者ID:mvoronoy,项目名称:OP.MagicTrie,代码行数:18,代码来源:tr.cpp


示例17: read_csv

Tbl read_csv(const char* filename)
{
  std::ifstream ifs(filename);
  std::string line;

  Tbl tbl;

  while (std::getline(ifs, line)) {
    std::istringstream ss(line);

    std::vector<std::string> columns;
    std::string column;
    while (std::getline(ss, column, ',')) {
      columns.push_back(column);
    }
    tbl.push_back(columns);
  }
  return tbl;
}
开发者ID:794523332,项目名称:Autoware,代码行数:19,代码来源:points_map_query.cpp


示例18: read_pointclass

std::vector<PointClass> read_pointclass(const char *filename)
{
  int max_id;
  Tbl tbl = read_csv(filename, &max_id);
  size_t i, n = tbl.size();
  std::vector<PointClass> ret(max_id + 1, {-1});
  for (i=0; i<n; i++) {
    int id = std::stoi(tbl[i][0]);
    ret[id].pid = id;
    ret[id].b = std::stod(tbl[i][1]);
    ret[id].l = std::stod(tbl[i][2]);
    ret[id].h = std::stod(tbl[i][3]);
    ret[id].bx = std::stod(tbl[i][4]);
    ret[id].ly = std::stod(tbl[i][5]);
    ret[id].ref = std::stoi(tbl[i][6]);
    ret[id].mcode1 = std::stoi(tbl[i][7]);
    ret[id].mcode2 = std::stoi(tbl[i][8]);
    ret[id].mcode3 = std::stoi(tbl[i][9]);
  }
  return ret;
}
开发者ID:ZenzouFuruta,项目名称:Autoware,代码行数:21,代码来源:vector_map_query.cpp


示例19: read_dtlane

std::vector<DTLane> read_dtlane(const char *filename)
{
  int max_id;
  Tbl tbl = read_csv(filename, &max_id);
  size_t i, n = tbl.size();
  std::vector<DTLane> ret(max_id + 1, {-1});
  for (i=0; i<n; i++) {
    int id = std::stoi(tbl[i][0]);
    ret[id].did = id;
    ret[id].dist = std::stod(tbl[i][1]);
    ret[id].pid = std::stoi(tbl[i][2]);
    ret[id].dir = std::stod(tbl[i][3]);
    ret[id].apara = std::stod(tbl[i][4]);
    ret[id].r = std::stod(tbl[i][5]);
    ret[id].slope = std::stod(tbl[i][6]);
    ret[id].cant = std::stod(tbl[i][7]);
    ret[id].lw = std::stod(tbl[i][8]);
    ret[id].rw = std::stod(tbl[i][9]);
  }
  return ret;
}
开发者ID:ZenzouFuruta,项目名称:Autoware,代码行数:21,代码来源:vector_map_query.cpp


示例20: read_csv

Tbl read_csv(const char* filename, int* max_id)
{
  std::ifstream ifs(filename);
  std::string line;
  std::getline(ifs, line); // Remove first line

  Tbl tbl;

  *max_id = -1;
  while (std::getline(ifs, line)) {
    std::istringstream ss(line);

    std::vector<std::string> columns;
    std::string column;
    while (std::getline(ss, column, ',')) {
      columns.push_back(column);
    }
    tbl.push_back(columns);

    int id = std::stoi(columns[0]);
    if (id > *max_id) *max_id = id;
  }
  return tbl;
}
开发者ID:ZenzouFuruta,项目名称:Autoware,代码行数:24,代码来源:vector_map_query.cpp



注:本文中的Tbl类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ Tcp类代码示例发布时间:2022-05-31
下一篇:
C++ TaxiPathSetBySource类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap