forked from activeloopai/deeplake
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathorder_statement.hpp
More file actions
60 lines (47 loc) · 993 Bytes
/
Copy pathorder_statement.hpp
File metadata and controls
60 lines (47 loc) · 993 Bytes
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#pragma once
#include "exceptions.hpp"
#include "meta_functor.hpp"
#include "order_type.hpp"
#include "variants.hpp"
#include <base/assert.hpp>
#include <query_core/functor.hpp>
#include <cstdint>
#include <memory>
#include <variant>
namespace query_core {
class order_statement
{
public:
inline order_statement() : type_(query_core::order_type::ascending)
{
}
inline auto type() const
{
return type_;
}
inline void set_type(query_core::order_type t)
{
type_ = t;
}
inline void set_func(order_functor f)
{
func_ = std::move(f);
}
inline bool has_func() const
{
return func_.has_func();
}
template <typename F>
inline auto switch_func(F f) const
{
return func_.switch_func(std::move(f));
}
const expr& get_expr() const
{
return func_.get_expr();
}
private:
order_functor func_;
query_core::order_type type_;
};
} // namespace query_core