2#include <State/Relation.hpp>
4#include <score/model/tree/InvisibleRootNode.hpp>
5#include <score/model/tree/TreeNode.hpp>
6#include <score/model/tree/TreeNodeSerialization.hpp>
7#include <score/model/tree/VariantBasedNode.hpp>
8#include <score/tools/std/Optional.hpp>
10#include <ossia/editor/expression/operators.hpp>
19template <
typename DataType>
24using BinaryOperator = ossia::expressions::binary_operator;
26enum class UnaryOperator
42 : VariantBasedNode{std::move(data)}
47 : VariantBasedNode{std::move(data)}
52 : VariantBasedNode{std::move(data)}
57 : VariantBasedNode{std::move(data)}
62 : VariantBasedNode{std::move(data)}
68 return lhs.m_data == rhs.m_data;
71 QString toString()
const;
90 SCORE_LIB_STATE_EXPORT
94 SCORE_LIB_STATE_EXPORT
99 QString toString()
const;
100 QString toPrettyString()
const;
102 using iterator =
typename std::list<TreeNode>::iterator;
103 using const_iterator =
typename std::list<TreeNode>::const_iterator;
106 const_iterator begin()
const;
107 const_iterator cbegin()
const;
111 const_iterator end()
const;
112 const_iterator cend()
const;
131 void push_back(
const TreeNode& child);
135 template <
typename... Args>
136 auto& emplace_back(Args&&... args)
138 m_children.emplace_back(std::forward<Args>(args)...);
140 auto& cld = m_children.back();
145 template <
typename... Args>
146 auto& emplace(Args&&... args)
148 auto& n = *m_children.emplace(std::forward<Args>(args)...);
154 bool hasChild(std::size_t index)
const;
156 const TreeNode& childAt(
int index)
const;
159 int indexOfChild(
const TreeNode* child)
const;
160 int childCount()
const;
161 bool hasChildren()
const;
163 std::list<TreeNode>& children();
164 const std::list<TreeNode>& children()
const;
167 void removeChild(const_iterator it);
172 std::list<TreeNode> m_children;
175SCORE_LIB_STATE_EXPORT
182SCORE_LIB_STATE_EXPORT std::optional<State::Expression>
183parseExpression(
const QString& str);
184SCORE_LIB_STATE_EXPORT std::optional<State::Expression>
185parseExpression(
const std::string& str);
191SCORE_LIB_STATE_EXPORT
bool isEmptyExpression(
const QString&);
193SCORE_LIB_STATE_EXPORT
195SCORE_LIB_STATE_EXPORT
202JSON_METADATA(
State::AddressAccessor, "AddressAccessor")
203JSON_METADATA(
State::Relation, "Relation")
204JSON_METADATA(
State::Pulse, "Pulse")
205JSON_METADATA(
State::UnaryOperator, "UnOp")
206JSON_METADATA(
State::BinaryOperator, "BinOp")
208SCORE_SERIALIZE_DATASTREAM_DECLARE(SCORE_LIB_STATE_EXPORT,
State::Expression)
209Q_DECLARE_METATYPE(
State::Expression)
210W_REGISTER_ARGTYPE(
State::Expression)
Definition VisitorInterface.hpp:53
Definition VisitorInterface.hpp:61
Definition TreeNode.hpp:52
The VariantBasedNode class.
Definition VariantBasedNode.hpp:23
Utilities for OSSIA data structures.
Definition DeviceInterface.hpp:33
SCORE_LIB_STATE_EXPORT bool isTrueExpression(const QString &)
True if the expression is "true" (the default case)
Definition Expression.cpp:288
The Address struct.
Definition Address.hpp:58
Definition Expression.hpp:33
Definition Relation.hpp:71
Definition Relation.hpp:19