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>
19 template <
typename DataType>
24 using BinaryOperator = ossia::expressions::binary_operator;
26 enum 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;
175 SCORE_LIB_STATE_EXPORT
182 SCORE_LIB_STATE_EXPORT std::optional<State::Expression>
183 parseExpression(
const QString& str);
184 SCORE_LIB_STATE_EXPORT std::optional<State::Expression>
185 parseExpression(
const std::string& str);
191 SCORE_LIB_STATE_EXPORT
bool isEmptyExpression(
const QString&);
193 SCORE_LIB_STATE_EXPORT
195 SCORE_LIB_STATE_EXPORT
202 JSON_METADATA(
State::AddressAccessor, "AddressAccessor")
203 JSON_METADATA(
State::Relation, "Relation")
204 JSON_METADATA(
State::Pulse, "Pulse")
205 JSON_METADATA(
State::UnaryOperator, "UnOp")
206 JSON_METADATA(
State::BinaryOperator, "BinOp")
208 SCORE_SERIALIZE_DATASTREAM_DECLARE(SCORE_LIB_STATE_EXPORT,
State::Expression)
209 Q_DECLARE_METATYPE(
State::Expression)
210 W_REGISTER_ARGTYPE(
State::Expression)
Definition: VisitorInterface.hpp:53
Definition: VisitorInterface.hpp:61
The TreeNode<State::ExprData> class.
Definition: Expression.hpp:86
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