14export template <
typename Type>
21 using sptr = std::shared_ptr<node_t>;
71 return std::make_shared<node_t>(op_);
93 if ((*it1 != *it2) or (*(*it1).get() != *(*it2).get()))
101 std::stringstream sts{};
107 sts << std::format(
"[0x{:X}](", (
unsigned long)
dimension.get());
111 sts << std::format(
"[{}]",
parameter.name);
122 sts << it->get()->to_string();
124 for (; it !=
children.end(); ++it) {
141 sts << it->get()->to_string();
151 std::shared_ptr<dimension_impl<Type>>
dimension{
nullptr};
159 node->const_value = value;
164 dependencies_.insert(dependency);
170 if (other.dependencies_ != dependencies_)
173 if (tree_ == other.tree_) {
175 }
else if (tree_ ==
nullptr || other.tree_ ==
nullptr) {
178 return (*tree_.get() == *other.tree_.get());
183 if (tree_ ==
nullptr) {
186 return tree_->to_string();
191 return tree_.get() ==
nullptr;
197 dependencies_.clear();
209 return dependencies_;
213 return dependencies_;
229 std::unordered_set<std::shared_ptr<dimension_impl<Type>>> dependencies_{};
230 std::unordered_set<parameter> parameters_{};
std::list< sptr > children
std::shared_ptr< dimension_impl< Type > > dimension
std::shared_ptr< node_t > sptr
bool operator==(const node_t &other) const
enum cydui::dimensions::expression::node_t::operation op
static sptr make(operation op_)
std::string to_string() const
parameter< Type > parameter
void add_dependency(std::shared_ptr< dimension_impl< Type > > dependency)
const auto & tree() const
dimension< Type > dimension
static node_t::sptr make_node(node_t::operation op)
const auto & dependencies() const
bool operator==(const expression &other) const
friend struct dimensional_operators
std::string to_string() const
const auto & parameters() const
expression(const Type &value)