Kùzu C++ API
Loading...
Searching...
No Matches
parsed_literal_expression.h
Go to the documentation of this file.
1#pragma once
2
3#include "value.h"
4#include "parsed_expression.h"
5
6namespace kuzu {
7namespace parser {
8
10 static constexpr common::ExpressionType expressionType = common::ExpressionType::LITERAL;
11
12public:
13 ParsedLiteralExpression(common::Value value, std::string raw)
14 : ParsedExpression{expressionType, std::move(raw)}, value{std::move(value)} {}
15
17 common::Value value)
18 : ParsedExpression{expressionType, std::move(alias), std::move(rawName),
19 std::move(children)},
20 value{std::move(value)} {}
21
23 : ParsedExpression{expressionType}, value{std::move(value)} {}
24
25 common::Value getValue() const { return value; }
26
27 common::Value& getValueUnsafe() { return value; }
28
29 static std::unique_ptr<ParsedLiteralExpression> deserialize(
30 common::Deserializer& deserializer) {
31 return std::make_unique<ParsedLiteralExpression>(*common::Value::deserialize(deserializer));
32 }
33
34 std::unique_ptr<ParsedExpression> copy() const override {
35 return std::make_unique<ParsedLiteralExpression>(alias, rawName, copyVector(children),
36 value);
37 }
38
39private:
40 void serializeInternal(common::Serializer& serializer) const override {
41 value.serialize(serializer);
42 }
43
44private:
45 common::Value value;
46};
47
48} // namespace parser
49} // namespace kuzu
Definition deserializer.h:15
Definition serializer.h:15
Definition value.h:27
KUZU_API void serialize(Serializer &serializer) const
static KUZU_API std::unique_ptr< Value > deserialize(Deserializer &deserializer)
Definition parsed_expression.h:29
parsed_expr_vector children
Definition parsed_expression.h:91
std::string alias
Definition parsed_expression.h:89
std::string rawName
Definition parsed_expression.h:90
Definition parsed_literal_expression.h:9
ParsedLiteralExpression(common::Value value)
Definition parsed_literal_expression.h:22
ParsedLiteralExpression(std::string alias, std::string rawName, parsed_expr_vector children, common::Value value)
Definition parsed_literal_expression.h:16
common::Value getValue() const
Definition parsed_literal_expression.h:25
static std::unique_ptr< ParsedLiteralExpression > deserialize(common::Deserializer &deserializer)
Definition parsed_literal_expression.h:29
ParsedLiteralExpression(common::Value value, std::string raw)
Definition parsed_literal_expression.h:13
common::Value & getValueUnsafe()
Definition parsed_literal_expression.h:27
std::unique_ptr< ParsedExpression > copy() const override
Definition parsed_literal_expression.h:34
ExpressionType
Definition expression_type.h:9
std::vector< std::unique_ptr< ParsedExpression > > parsed_expr_vector
Definition parsed_expression.h:24
Definition alter_type.h:5