summaryrefslogtreecommitdiffstats
path: root/include/framework/interface/Query.h
blob: ca742c300e3c6e50e107cebc5887c8db985e5054 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/*
 * include/framework/interface/Query.h
 *
 * Copyright (C) 2023 Douglas B. Rumbaugh <drumbaugh@psu.edu> 
 *
 * Distributed under the Modified BSD License.
 *
 */
#pragma once

#include <vector>
#include <concepts>

#include "util/types.h"

// FIXME: The interface is not completely specified yet, as it is pending
//        determining a good way to handle additional template arguments 
//        to get the Shard and Record types into play
template <typename Q>
concept QueryInterface = requires(Q q, void *p, std::vector<void*> &s) {

    /*
    {Q::get_query_state(p, p)} -> std::convertible_to<void*>;
    {Q::get_buffer_query_state(p, p)} -> std::convertible_to<void *>;
    */
    {Q::process_query_states(p, s, p)};
    /*
    {Q::query(s, p, p)} -> std::convertible_to<std::vector<Wrapped<R>>>;
    {Q::buffer_query(p, p)} -> std::convertible_to<std::vector<Wrapped<R>>>;
    {Q::merge(rv, p)} -> std::convertible_to<std::vector<R>>;
    */

    {Q::delete_query_state(std::declval<void*>())} -> std::same_as<void>;
    {Q::delete_buffer_query_state(std::declval<void*>())} -> std::same_as<void>;

    {Q::EARLY_ABORT} -> std::convertible_to<bool>;
    {Q::SKIP_DELETE_FILTER} -> std::convertible_to<bool>;
};