当前位置: 首页>>代码示例>>C++>>正文


C++ base_type类代码示例

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


在下文中一共展示了base_type类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: if

bool ndt::fixed_dim_type::operator==(const base_type &rhs) const
{
  if (this == &rhs) {
    return true;
  } else if (rhs.get_type_id() != fixed_dim_type_id) {
    return false;
  } else if (rhs.get_kind() == kind_kind) {
    return false;
  } else {
    const fixed_dim_type *dt = static_cast<const fixed_dim_type *>(&rhs);
    return m_element_tp == dt->m_element_tp && m_dim_size == dt->m_dim_size;
  }
}
开发者ID:cpcloud,项目名称:libdynd,代码行数:13,代码来源:fixed_dim_type.cpp

示例2: if

bool ndt::dim_fragment_type::operator==(const base_type &rhs) const
{
  if (this == &rhs) {
    return true;
  }
  else if (rhs.get_id() != dim_fragment_id) {
    return false;
  }
  else {
    const dim_fragment_type *dft = static_cast<const dim_fragment_type *>(&rhs);
    return get_ndim() == rhs.get_ndim() &&
           memcmp(m_tagged_dims.get(), dft->m_tagged_dims.get(), get_ndim() * sizeof(intptr_t)) == 0;
  }
}
开发者ID:arnavkj1995,项目名称:libdynd,代码行数:14,代码来源:dim_fragment_type.cpp

示例3: read

 /**
  * Read an arbitrary type.
  */
 template<typename T> void read(T& ret) {
   base_type::read(reinterpret_cast<char*>(&ret), sizeof(T));
   if(bad()) {
     std::cerr << "Error reading file!" << std::endl;
     assert(false);
   }
 }
开发者ID:Bhushan1002,项目名称:SFrame,代码行数:10,代码来源:binary_parser.hpp

示例4: write

 //! Write the arbitrary data type to file
 template<typename T> void write(T t) {
   base_type::write(reinterpret_cast<char*>(&t), sizeof(T));
   if(bad()) {
     std::cerr << "Error writing file!" << std::endl;
     assert(false);
   }
 }
开发者ID:Bhushan1002,项目名称:SFrame,代码行数:8,代码来源:binary_parser.hpp

示例5:

bool json_type::operator==(const base_type& rhs) const
{
    if (this == &rhs) {
        return true;
    } else {
        return rhs.get_type_id() == json_type_id;
    }
}
开发者ID:pombredanne,项目名称:libdynd,代码行数:8,代码来源:json_type.cpp

示例6:

bool ndt::int_kind_sym_type::operator==(const base_type &rhs) const
{
  if (this == &rhs) {
    return true;
  } else {
    return rhs.get_type_id() == int_sym_type_id;
  }
}
开发者ID:gmarkall,项目名称:libdynd,代码行数:8,代码来源:int_kind_sym_type.cpp

示例7:

bool ndt::array_type::operator==(const base_type &rhs) const
{
  if (this == &rhs) {
    return true;
  }

  return rhs.get_type_id() == array_type_id;
}
开发者ID:mdboom,项目名称:libdynd,代码行数:8,代码来源:array_type.cpp

示例8: read_vector

 /**
  * Read an arbitrary type.
  */
 template<typename T> void read_vector(std::vector<T>& ret) {
   if(ret.empty()) return;
   base_type::read(reinterpret_cast<char*>(&(ret[0])), 
                   sizeof(T) * ret.size());
   if(bad()) {
     std::cerr << "Error reading file!" << std::endl;
     assert(false);
   }
 }
开发者ID:Bhushan1002,项目名称:SFrame,代码行数:12,代码来源:binary_parser.hpp

示例9:

bool ndt::any_kind_type::operator==(const base_type &rhs) const
{
  if (this == &rhs) {
    return true;
  }
  else {
    return rhs.get_id() == any_kind_id;
  }
}
开发者ID:nyue,项目名称:libdynd,代码行数:9,代码来源:any_kind_type.cpp

示例10:

bool ndt::kind_sym_type::operator==(const base_type &rhs) const
{
  if (this == &rhs) {
    return true;
  } else {
    return rhs.get_type_id() == kind_sym_type_id &&
           m_kind == static_cast<const kind_sym_type &>(rhs).m_kind;
  }
}
开发者ID:gmarkall,项目名称:libdynd,代码行数:9,代码来源:kind_sym_type.cpp

示例11: if

bool ndt::cuda_device_type::operator==(const base_type &rhs) const {
  if (this == &rhs) {
    return true;
  } else if (rhs.get_id() != cuda_device_id) {
    return false;
  } else {
    const cuda_device_type *tp = static_cast<const cuda_device_type *>(&rhs);
    return m_element_tp == tp->m_element_tp;
  }
}
开发者ID:insertinterestingnamehere,项目名称:libdynd,代码行数:10,代码来源:cuda_device_type.cpp

示例12: if

bool ndt::type_type::operator==(const base_type &rhs) const
{
  if (this == &rhs) {
    return true;
  } else if (rhs.get_type_id() != type_type_id) {
    return false;
  } else {
    return m_pattern_tp == static_cast<const type_type *>(&rhs)->m_pattern_tp;
  }
}
开发者ID:hainm,项目名称:libdynd,代码行数:10,代码来源:type_type.cpp

示例13: if

bool ndt::callable_type::operator==(const base_type &rhs) const {
  if (this == &rhs) {
    return true;
  } else if (rhs.get_id() != callable_id) {
    return false;
  } else {
    const callable_type *fpt = static_cast<const callable_type *>(&rhs);
    return m_return_type == fpt->m_return_type && m_pos_tuple == fpt->m_pos_tuple && m_kwd_struct == fpt->m_kwd_struct;
  }
}
开发者ID:mindis,项目名称:libdynd,代码行数:10,代码来源:callable_type.cpp

示例14: if

bool ndt::option_type::operator==(const base_type &rhs) const {
  if (this == &rhs) {
    return true;
  } else if (rhs.get_id() != option_id) {
    return false;
  } else {
    const option_type *ot = static_cast<const option_type *>(&rhs);
    return m_value_tp == ot->m_value_tp;
  }
}
开发者ID:insertinterestingnamehere,项目名称:libdynd,代码行数:10,代码来源:option_type.cpp

示例15: if

bool ndt::string_type::operator==(const base_type &rhs) const
{
  if (this == &rhs) {
    return true;
  } else if (rhs.get_type_id() != string_type_id) {
    return false;
  } else {
    return true;
  }
}
开发者ID:gitter-badger,项目名称:libdynd,代码行数:10,代码来源:string_type.cpp


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