HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
src
ttauri
formula
formula_logical_or_node.hpp
1
// Copyright Take Vos 2020.
2
// Distributed under the Boost Software License, Version 1.0.
3
// (See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt)
4
5
#pragma once
6
7
#include "formula_binary_operator_node.hpp"
8
9
namespace
tt {
10
11
struct
formula_logical_or_node
final :
formula_binary_operator_node
{
12
formula_logical_or_node
(
parse_location
location,
std::unique_ptr<formula_node>
lhs,
std::unique_ptr<formula_node>
rhs) :
13
formula_binary_operator_node
(
std::move
(location),
std::move
(lhs),
std::move
(rhs)) {}
14
15
datum
evaluate
(
formula_evaluation_context
& context)
const override
{
16
auto
lhs_ = lhs->evaluate(context);
17
if
(lhs_) {
18
return
lhs_;
19
}
else
{
20
return
rhs->evaluate(context);
21
}
22
}
23
24
std::string
string() const noexcept
override
{
25
return
fmt::format(
"({} || {})"
, *lhs, *rhs);
26
}
27
};
28
29
}
tt::datum_impl< true >
tt::formula_binary_operator_node
Definition
formula_binary_operator_node.hpp:11
tt::formula_evaluation_context
Definition
formula_evaluation_context.hpp:16
tt::formula_logical_or_node
Definition
formula_logical_or_node.hpp:11
tt::formula_logical_or_node::evaluate
datum evaluate(formula_evaluation_context &context) const override
Evaluate an rvalue.
Definition
formula_logical_or_node.hpp:15
tt::parse_location
Definition
parse_location.hpp:16
std::string
std::move
T move(T... args)
std::unique_ptr
Generated on Mon Apr 22 2024 12:53:45 for HikoGUI by
1.10.0