aboutsummaryrefslogtreecommitdiffstats
path: root/vespalib/src/vespa/vespalib/util/sequence.h
blob: 4f9eb5ad8213062b3819b8123ed9af1a74c4e101 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#pragma once

#include <memory>

namespace vespalib {

/**
 * abstract interface for an iterable sequence.
 **/
template <typename T>
struct Sequence
{
    using UP = std::unique_ptr<Sequence>;

    virtual bool valid() const = 0;
    virtual T get() const = 0;
    virtual void next() = 0;
    virtual ~Sequence() {}
};

} // namespace vespalib