Johannes Wendel | 11b6dae | 2019-11-13 13:13:38 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Formula.cpp |
| 3 | * |
| 4 | * Author: wendel |
| 5 | */ |
| 6 | |
| 7 | #include "Formula.h" |
Johannes Wendel | 10dc552 | 2019-12-04 11:20:14 +0100 | [diff] [blame^] | 8 | #include "submodel/map/reference/Reference.h" |
Johannes Wendel | 11b6dae | 2019-11-13 13:13:38 +0100 | [diff] [blame] | 9 | |
| 10 | namespace basyx { |
| 11 | namespace submodel { |
Thomas Psota | b49d8df | 2019-11-27 15:55:41 +0100 | [diff] [blame] | 12 | |
Johannes Wendel | 11b6dae | 2019-11-13 13:13:38 +0100 | [diff] [blame] | 13 | |
| 14 | Formula::Formula() |
| 15 | {} |
| 16 | |
Thomas Psota | b49d8df | 2019-11-27 15:55:41 +0100 | [diff] [blame] | 17 | Formula::Formula(const basyx::specificCollection_t<IReference>& dependsOn) : |
Johannes Wendel | 10dc552 | 2019-12-04 11:20:14 +0100 | [diff] [blame^] | 18 | vab::ElementMap{} |
| 19 | { |
| 20 | this->setDependsOn(dependsOn); |
| 21 | } |
Johannes Wendel | 11b6dae | 2019-11-13 13:13:38 +0100 | [diff] [blame] | 22 | |
Thomas Psota | b49d8df | 2019-11-27 15:55:41 +0100 | [diff] [blame] | 23 | basyx::specificCollection_t<IReference> Formula::getDependsOn() const |
Johannes Wendel | 11b6dae | 2019-11-13 13:13:38 +0100 | [diff] [blame] | 24 | { |
Johannes Wendel | 10dc552 | 2019-12-04 11:20:14 +0100 | [diff] [blame^] | 25 | auto & obj_list = this->map.getProperty(IFormula::Path::Dependson).Get<basyx::object::object_list_t&>(); |
| 26 | return vab::ElementMap::make_specific_collection<IReference, Reference>(obj_list); |
Johannes Wendel | 11b6dae | 2019-11-13 13:13:38 +0100 | [diff] [blame] | 27 | } |
| 28 | |
Thomas Psota | b49d8df | 2019-11-27 15:55:41 +0100 | [diff] [blame] | 29 | void Formula::setDependsOn(const basyx::specificCollection_t<IReference>& dependsOn) |
Johannes Wendel | 11b6dae | 2019-11-13 13:13:38 +0100 | [diff] [blame] | 30 | { |
Johannes Wendel | 10dc552 | 2019-12-04 11:20:14 +0100 | [diff] [blame^] | 31 | auto obj_list = vab::ElementMap::make_object_list<IReference, Reference>(dependsOn); |
| 32 | this->map.insertKey(IFormula::Path::Dependson, obj_list); |
Johannes Wendel | 11b6dae | 2019-11-13 13:13:38 +0100 | [diff] [blame] | 33 | } |
| 34 | |
| 35 | } |
| 36 | } |