Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cursor concept discussion #251

Open
elshize opened this issue Sep 15, 2019 · 0 comments
Open

Cursor concept discussion #251

elshize opened this issue Sep 15, 2019 · 0 comments

Comments

@elshize
Copy link
Member

elshize commented Sep 15, 2019

template <typename T>
concept bool CursorLike = requires(T cursor, DocId docid, Position pos)
{
    { cursor.reset() } -> void;
    { cursor.next() } -> void;
    { cursor.next_geq(docid) } -> void;
    { cursor.move(pos) } -> void;
    { cursor.docid() } -> DocId;
    { cursor.position() } -> Position;
    { cursor.size() } -> std::size_t;
};

template <typename T>
concept bool FreqCursorLike = CursorLike<T> && requires(T cursor)
{
    { cursor.freq() } -> Frequency;
};

template <typename T>
concept bool ScoredCursorLike = CursorLike<T> && requires(T cursor)
{
    { cursor.score() } -> Score;
};

template <typename T>
concept bool BlockCursorLike = CursorLike<T> && requires(T cursor)
{
    { cursor.num_blocks() } -> Score;
    { cursor.block() } -> std::size_t;
};
@elshize elshize added this to the v1.0 milestone Sep 15, 2019
@elshize elshize mentioned this issue Sep 15, 2019
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant