示例#1
0
bool date_type::operator==(const base_type& rhs) const
{
    if (this == &rhs) {
        return true;
    } else if (rhs.get_type_id() != date_type_id) {
        return false;
    } else {
        // There is only one possibility for the date type (TODO: timezones!)
        return true;
    }
}
示例#2
0
bool ndt::option_type::operator==(const base_type &rhs) const
{
  if (this == &rhs) {
    return true;
  } else if (rhs.get_type_id() != option_type_id) {
    return false;
  } else {
    const option_type *ot = static_cast<const option_type *>(&rhs);
    return m_value_tp == ot->m_value_tp;
  }
}
示例#3
0
bool groupby_type::operator==(const base_type& rhs) const
{
    if (this == &rhs) {
        return true;
    } else if (rhs.get_type_id() != groupby_type_id) {
        return false;
    } else {
        const groupby_type *dt = static_cast<const groupby_type*>(&rhs);
        return m_value_type == dt->m_value_type && m_operand_type == dt->m_operand_type;
    }
}
示例#4
0
bool ndt::fixed_string_type::operator==(const base_type &rhs) const
{
  if (this == &rhs) {
    return true;
  } else if (rhs.get_type_id() != fixed_string_type_id) {
    return false;
  } else {
    const fixed_string_type *dt = static_cast<const fixed_string_type *>(&rhs);
    return m_encoding == dt->m_encoding && m_stringsize == dt->m_stringsize;
  }
}
示例#5
0
bool byteswap_type::operator==(const base_type& rhs) const
{
    if (this == &rhs) {
        return true;
    } else if (rhs.get_type_id() != byteswap_type_id) {
        return false;
    } else {
        const byteswap_type *dt = static_cast<const byteswap_type*>(&rhs);
        return m_value_type == dt->m_value_type;
    }
}
示例#6
0
bool ndt::callable_type::operator==(const base_type &rhs) const
{
  if (this == &rhs) {
    return true;
  } else if (rhs.get_type_id() != callable_type_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;
  }
}
示例#7
0
bool ndt::typevar_type::operator==(const base_type &rhs) const
{
  if (this == &rhs) {
    return true;
  } else if (rhs.get_type_id() != typevar_type_id) {
    return false;
  } else {
    const typevar_type *tvt = static_cast<const typevar_type *>(&rhs);
    return m_name == tvt->m_name;
  }
}
示例#8
0
bool ndt::bytes_type::operator==(const base_type &rhs) const
{
  if (this == &rhs) {
    return true;
  } else if (rhs.get_type_id() != bytes_type_id) {
    return false;
  } else {
    const bytes_type *dt = static_cast<const bytes_type *>(&rhs);
    return m_alignment == dt->m_alignment;
  }
}
示例#9
0
bool ndt::pointer_type::operator==(const base_type &rhs) const
{
    if (this == &rhs) {
        return true;
    } else if (rhs.get_type_id() != pointer_type_id) {
        return false;
    } else {
        const pointer_type *dt = static_cast<const pointer_type *>(&rhs);
        return m_target_tp == dt->m_target_tp;
    }
}
示例#10
0
bool fixedbytes_type::operator==(const base_type& rhs) const
{
    if (this == &rhs) {
        return true;
    } else if (rhs.get_type_id() != fixedbytes_type_id) {
        return false;
    } else {
        const fixedbytes_type *dt = static_cast<const fixedbytes_type*>(&rhs);
        return get_data_size() == dt->get_data_size() && get_data_alignment() == dt->get_data_alignment();
    }
}
示例#11
0
bool ndt::var_dim_type::operator==(const base_type &rhs) const
{
  if (this == &rhs) {
    return true;
  } else if (rhs.get_type_id() != var_dim_type_id) {
    return false;
  } else {
    const var_dim_type *dt = static_cast<const var_dim_type *>(&rhs);
    return m_element_tp == dt->m_element_tp;
  }
}
示例#12
0
bool ndt::struct_type::operator==(const base_type &rhs) const
{
  if (this == &rhs) {
    return true;
  } else if (rhs.get_type_id() != struct_type_id) {
    return false;
  } else {
    const struct_type *dt = static_cast<const struct_type *>(&rhs);
    return get_data_alignment() == dt->get_data_alignment() && m_field_types.equals_exact(dt->m_field_types) &&
           m_field_names.equals_exact(dt->m_field_names) && m_variadic == dt->m_variadic;
  }
}
示例#13
0
bool cfixed_dim_type::operator==(const base_type &rhs) const
{
  if (this == &rhs) {
    return true;
  } else if (rhs.get_type_id() != cfixed_dim_type_id) {
    return false;
  } else {
    const cfixed_dim_type *dt = static_cast<const cfixed_dim_type *>(&rhs);
    return m_element_tp == dt->m_element_tp && m_dim_size == dt->m_dim_size &&
           m_stride == dt->m_stride;
  }
}
示例#14
0
bool ndt::pow_dimsym_type::operator==(const base_type &rhs) const
{
  if (this == &rhs) {
    return true;
  } else if (rhs.get_type_id() != pow_dimsym_type_id) {
    return false;
  } else {
    const pow_dimsym_type *tvt = static_cast<const pow_dimsym_type *>(&rhs);
    return m_exponent == tvt->m_exponent && m_base_tp == tvt->m_base_tp &&
           m_element_tp == tvt->m_element_tp;
  }
}
示例#15
0
bool datetime_type::operator==(const base_type& rhs) const
{
    if (this == &rhs) {
        return true;
    } else if (rhs.get_type_id() != datetime_type_id) {
        return false;
    } else {
        const datetime_type& r = static_cast<const datetime_type &>(rhs);
        // TODO: When "other" timezone data is supported, need to compare them too
        return m_unit == r.m_unit && m_timezone == r.m_timezone;
    }
}
示例#16
0
bool dynd::busdate_type::operator==(const base_type& rhs) const
{
    if (this == &rhs) {
        return true;
    } else if (rhs.get_type_id() != busdate_type_id) {
        return false;
    } else {
        const busdate_type *dt = static_cast<const busdate_type*>(&rhs);
        return m_roll == dt->m_roll && memcmp(m_workweek, dt->m_workweek, sizeof(m_workweek)) == 0 &&
                m_holidays.equals_exact(dt->m_holidays);
    }
}
示例#17
0
bool unary_expr_type::operator==(const base_type& rhs) const
{
    if (this == &rhs) {
        return true;
    } else if (rhs.get_type_id() != unary_expr_type_id) {
        return false;
    } else {
        const unary_expr_type *dt = static_cast<const unary_expr_type*>(&rhs);
        return m_value_type == dt->m_value_type &&
                        m_operand_type == dt->m_operand_type &&
                        m_kgen == dt->m_kgen;
    }
}
示例#18
0
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;
  }
}
示例#19
0
bool cuda_host_type::operator==(const base_type &rhs) const
{
  if (this == &rhs) {
    return true;
  }
  else if (rhs.get_type_id() != cuda_host_type_id) {
    return false;
  }
  else {
    const cuda_host_type *tp = static_cast<const cuda_host_type *>(&rhs);
    return m_element_tp == tp->m_element_tp && m_cuda_host_flags == tp->get_cuda_host_flags();
  }
}
示例#20
0
bool ellipsis_dim_type::operator==(const base_type& rhs) const
{
    if (this == &rhs) {
        return true;
    } else if (rhs.get_type_id() != ellipsis_dim_type_id) {
        return false;
    } else {
        const ellipsis_dim_type *tvt =
            static_cast<const ellipsis_dim_type *>(&rhs);
        return m_name == tvt->m_name &&
               m_element_tp == tvt->m_element_tp;
    }
}
示例#21
0
bool cstruct_type::operator==(const base_type& rhs) const
{
    if (this == &rhs) {
        return true;
    } else if (rhs.get_type_id() != cstruct_type_id) {
        return false;
    } else {
        const cstruct_type *dt = static_cast<const cstruct_type*>(&rhs);
        return get_data_alignment() == dt->get_data_alignment() &&
                m_field_types == dt->m_field_types &&
                m_field_names == dt->m_field_names;
    }
}
示例#22
0
bool ndt::char_type::operator==(const base_type &rhs) const
{
  if (this == &rhs) {
    return true;
  }
  else if (rhs.get_type_id() != char_type_id) {
    return false;
  }
  else {
    const char_type *dt = static_cast<const char_type *>(&rhs);
    return m_encoding == dt->m_encoding;
  }
}
示例#23
0
bool categorical_type::operator==(const base_type& rhs) const
{
    if (this == &rhs)
        return true;
    if (rhs.get_type_id() != categorical_type_id)
        return false;
    if (!m_categories.equals_exact(static_cast<const categorical_type&>(rhs).m_categories))
        return false;
    if (static_cast<const categorical_type&>(rhs).m_category_index_to_value != m_category_index_to_value)
        return false;
    if (static_cast<const categorical_type&>(rhs).m_value_to_category_index != m_value_to_category_index)
        return false;

    return true;

}
示例#24
0
bool ndt::scalar_kind_type::operator==(const base_type &other) const
{
  return this == &other || other.get_type_id() == scalar_kind_type_id;
}
示例#25
0
bool void_pointer_type::operator==(const base_type& rhs) const
{
    return rhs.get_type_id() == void_pointer_type_id;
}