OGS 6.2.2-330-gf48c72f61.dirty.20200225212913
Component.cpp
Go to the documentation of this file.
1 
13 #include "Component.h"
14 #include "Components/Components.h"
15 #include "Properties/Properties.h"
16 
18 {
20 {
21 }
22 
23 Component::Component(std::string const& component_name,
24  std::unique_ptr<PropertyArray>&& properties)
25  : name(component_name)
26 {
27  if (properties)
28  {
29  overwriteExistingProperties(_properties, *properties, this);
30  }
31 }
32 
34 {
35  return *_properties[p];
36 }
37 
39 {
40  return _properties[p] != nullptr;
41 }
42 } // namespace MaterialPropertyLib
void overwriteExistingProperties(PropertyArray &properties, PropertyArray &new_properties, std::variant< Medium *, Phase *, Component *> scale_pointer)
Definition: Property.h:121
bool hasProperty(PropertyType const &p) const
Definition: Component.cpp:38
Property const & property(PropertyType const &) const
A get-function for retrieving a certain property.
Definition: Component.cpp:33
PropertyArray _properties
The property array of the component.
Definition: Component.h:74
std::string const name
Definition: Component.h:70