blob: c7788477422f2eb9d2cdd1c82853f07041fa3f38 [file] [log] [blame]
Johannes Wendel11b6dae2019-11-13 13:13:38 +01001/*
2 * Formula.cpp
3 *
4 * Author: wendel
5 */
6
7#include "Formula.h"
Johannes Wendel10dc5522019-12-04 11:20:14 +01008#include "submodel/map/reference/Reference.h"
Johannes Wendel11b6dae2019-11-13 13:13:38 +01009
10namespace basyx {
11namespace submodel {
Thomas Psotab49d8df2019-11-27 15:55:41 +010012
Johannes Wendel11b6dae2019-11-13 13:13:38 +010013
14Formula::Formula()
15{}
16
Thomas Psotab49d8df2019-11-27 15:55:41 +010017Formula::Formula(const basyx::specificCollection_t<IReference>& dependsOn) :
Johannes Wendel10dc5522019-12-04 11:20:14 +010018 vab::ElementMap{}
19{
20 this->setDependsOn(dependsOn);
21}
Johannes Wendel11b6dae2019-11-13 13:13:38 +010022
Thomas Psotab49d8df2019-11-27 15:55:41 +010023basyx::specificCollection_t<IReference> Formula::getDependsOn() const
Johannes Wendel11b6dae2019-11-13 13:13:38 +010024{
Johannes Wendel10dc5522019-12-04 11:20:14 +010025 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 Wendel11b6dae2019-11-13 13:13:38 +010027}
28
Thomas Psotab49d8df2019-11-27 15:55:41 +010029void Formula::setDependsOn(const basyx::specificCollection_t<IReference>& dependsOn)
Johannes Wendel11b6dae2019-11-13 13:13:38 +010030{
Johannes Wendel10dc5522019-12-04 11:20:14 +010031 auto obj_list = vab::ElementMap::make_object_list<IReference, Reference>(dependsOn);
32 this->map.insertKey(IFormula::Path::Dependson, obj_list);
Johannes Wendel11b6dae2019-11-13 13:13:38 +010033}
34
35}
36}