22#ifndef ATTRIBUTE_MAPPER_ENGINE_H
23#define ATTRIBUTE_MAPPER_ENGINE_H
51 = std::map<std::tuple<attribute_store::attribute, char, int>,
236 attribute_store::attribute
239 bool create_if_missing)
const;
263 std::shared_ptr<ast::assignment> assignment,
264 attribute_store::attribute original_node);
277 attribute_store::attribute destination);
289 attribute_store::attribute assigment_destination,
290 attribute_store::attribute original_node);
301 attribute_store::attribute assigment_destination,
302 attribute_store::attribute original_node);
318 attribute_store::attribute destination,
319 attribute_store::attribute original_node,
322 std::shared_ptr<ast::assignment> assignment)
const;
336 float evaluated_value,
337 std::shared_ptr<ast::assignment> assignment,
338 bool chain_reaction);
350 float evaluated_value,
351 std::shared_ptr<ast::assignment> assignment);
354 std::multimap<ast::attribute_dependency_t, std::shared_ptr<ast::assignment>>
361 std::map<std::shared_ptr<ast::assignment>,
362 std::shared_ptr<ast::scope_settings_t>>
attribute store C++ wrapper.
Mapper Engine.
Definition: attribute_mapper_engine.hpp:142
bool apply_instance_assignment(attribute_store::attribute common_parent, float evaluated_value, std::shared_ptr< ast::assignment > assignment, bool chain_reaction)
Applies an instance assigment, which will verify if an attribute path with a certain value exists.
bool load_path(const std::string &uam_path)
Load engine with all uam file in a given directory.
attribute_store_type_t common_parent_type
Definition: attribute_mapper_engine.hpp:370
void set_common_parent_type(attribute_store_type_t t)
Set the Common Attribute type which should be used as start context for all attribute evaluations.
bool load_file(std::string uam_file_name)
Load engine with single uam file.
void on_attribute_updated(attribute_store_node_t node, attribute_store_node_value_state_t state, attribute_store_change_t change)
Called when an attribute is updated.
void reset()
Reset the mapper engine and clear all releations.
bool assignment_matches_destination(std::shared_ptr< ast::assignment > assignment, attribute_store::attribute destination)
Checks if an assignment (lhs) path matches the attribute for a destination.
equivalent_assignments_t get_equivalent_assignments(std::shared_ptr< ast::assignment > assignment)
Checks if the engine has other assigments assigning the same attribute type / value type.
static MapperEngine & get_instance()
Get the singletron.
std::map< std::shared_ptr< ast::assignment >, std::shared_ptr< ast::scope_settings_t > > assignment_settings
Definition: attribute_mapper_engine.hpp:363
bool apply_clearance_assignment(attribute_store::attribute common_parent, float evaluated_value, std::shared_ptr< ast::assignment > assignment)
Applies a clearance assigment, which may undefine values.
bool add_expression(const std::string expression)
Add uam expression to the ast.
bool run_assignment(std::shared_ptr< ast::assignment > assignment, attribute_store::attribute assigment_destination, attribute_store::attribute original_node)
Runs a single assigment and verifies if a value was applied.
bool apply_regular_assignment(attribute_store::attribute common_parent, attribute_store::attribute destination, attribute_store::attribute original_node, const ast::scope_settings_t &settings, result_type_t evaluated_value, std::shared_ptr< ast::assignment > assignment) const
Applies a regular assigment.
void run_assignments(equivalent_assignments_t assignments_to_check, attribute_store::attribute assigment_destination, attribute_store::attribute original_node)
Takes a list of assignments with a possible destination, and run.
attribute_store::attribute get_destination_for_attribute(const attribute_store::attribute &endpoint, const ast::attribute &attribute, bool create_if_missing) const
Get the destination for attribute.
attribute_store::attribute get_assigment_potential_destination(std::shared_ptr< ast::assignment > assignment, attribute_store::attribute original_node)
Checks what would be the destination attribute affected by an assigment, if applied.
bool update_dependencies(const ast::ast_tree &ast)
Re-calculate dependencies of a the ast,.
std::map< std::shared_ptr< ast::assignment >, assignment_properties_t > assignment_properties
Definition: attribute_mapper_engine.hpp:367
std::multimap< ast::attribute_dependency_t, std::shared_ptr< ast::assignment > > relations
Definition: attribute_mapper_engine.hpp:355
bool has_unknown_functions_in_tree(const ast::ast_tree &ast)
Checks the AST for built-in function names and return true if one or more functions are unknown.
float result_type_t
Definition: attribute_mapper_ast.hpp:36
std::map< std::tuple< attribute_store::attribute, char, int >, equivalent_assignments_t > assignments_to_run_t
Map of equivalent assignments associated with a destination attributes. Associates an attribute and i...
Definition: attribute_mapper_engine.hpp:52
std::tuple< int, char, attribute_store_type_t > assignment_properties_t
assignment_properties_t keeps track of various
Definition: attribute_mapper_engine.hpp:60
std::multimap< int, std::shared_ptr< ast::assignment >, scope_priority_compare > equivalent_assignments_t
Set of unique assignments, sorted by their scope priority.
Definition: attribute_mapper_engine.hpp:43
attribute_store_change_t
Attribute Store type to indicate the modification type that triggered a callback.
Definition: attribute_store.h:112
attribute_store_node_value_state_t
This is the value state of a value.
Definition: attribute_store.h:121
#define ATTRIBUTE_STORE_INVALID_NODE
Special attribute_store_node_t value indicating that it does not exist.
Definition: attribute_store.h:106
Definition: attribute_mapper_ast.hpp:39
std::vector< scope_setting > scope_settings_t
Type for Scope settings list.
Definition: attribute_mapper_ast.hpp:226
Definition: attribute_mapper_ast.hpp:53
Attribute.
Definition: attribute_mapper_ast.hpp:177
Definition: attribute_mapper_engine.hpp:32
bool operator()(const int &lhs, const int &rhs) const
Definition: attribute_mapper_engine.hpp:33