Sha256: 7280d1caabca0efbcfe2d57164bf16901da67e3c1967cbbdebeff979ed7ff3a3

Contents?: true

Size: 1.69 KB

Versions: 8

Compression:

Stored size: 1.69 KB

Contents

/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */

#ifndef _INTARRAYPAIRITERATOR_INTERNAL_HPP_
#define _INTARRAYPAIRITERATOR_INTERNAL_HPP_

#include "HllUtil.hpp"

namespace datasketches {

template<typename A>
coupon_iterator<A>::coupon_iterator(const uint32_t* array, size_t array_size, size_t index, bool all):
array_(array), array_size_(array_size), index_(index), all_(all) {
  while (index_ < array_size_) {
    if (all_ || array_[index_] != hll_constants::EMPTY) break;
    ++index_;
  }
}

template<typename A>
coupon_iterator<A>& coupon_iterator<A>::operator++() {
  while (++index_ < array_size_) {
    if (all_ || array_[index_] != hll_constants::EMPTY) break;
  }
  return *this;
}

template<typename A>
bool coupon_iterator<A>::operator!=(const coupon_iterator& other) const {
  return index_ != other.index_;
}

template<typename A>
uint32_t coupon_iterator<A>::operator*() const {
  return array_[index_];
}

}

#endif // _INTARRAYPAIRITERATOR_INTERNAL_HPP_

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
datasketches-0.3.1 vendor/datasketches-cpp/hll/include/coupon_iterator-internal.hpp
datasketches-0.3.0 vendor/datasketches-cpp/hll/include/coupon_iterator-internal.hpp
datasketches-0.2.7 vendor/datasketches-cpp/hll/include/coupon_iterator-internal.hpp
datasketches-0.2.6 vendor/datasketches-cpp/hll/include/coupon_iterator-internal.hpp
datasketches-0.2.5 vendor/datasketches-cpp/hll/include/coupon_iterator-internal.hpp
datasketches-0.2.4 vendor/datasketches-cpp/hll/include/coupon_iterator-internal.hpp
datasketches-0.2.3 vendor/datasketches-cpp/hll/include/coupon_iterator-internal.hpp
datasketches-0.2.2 vendor/datasketches-cpp/hll/include/coupon_iterator-internal.hpp