Пример #1
0
bool operator==(
    const ResourceProviderInfo& left,
    const ResourceProviderInfo& right)
{
  if (left.id() != right.id()) {
    return false;
  }

  if (Attributes(left.attributes()) != Attributes(right.attributes())) {
    return false;
  }

  if (Resources(left.resources()) != Resources(right.resources())) {
    return false;
  }

  return true;
}
Пример #2
0
bool operator==(
    const ResourceProviderInfo& left,
    const ResourceProviderInfo& right)
{
  // Order of reservations is important.
  if (left.default_reservations_size() != right.default_reservations_size()) {
    return false;
  }

  for (int i = 0; i < left.default_reservations_size(); i++) {
    if (left.default_reservations(i) != right.default_reservations(i)) {
      return false;
    }
  }

  return left.has_id() == right.has_id() &&
    (!left.has_id() || left.id() == right.id()) &&
    Attributes(left.attributes()) == Attributes(right.attributes()) &&
    left.type() == right.type() &&
    left.name() == right.name() &&
    left.has_storage() == right.has_storage() &&
    (!left.has_storage() || left.storage() == right.storage());
}