swh:1:snp:f521c49ab17ef7db6ec70b2430e1ed203f50383f
Raw File
Tip revision: e789827cfe43b0bf9f4881987d1642ca006be5bd authored by Lars Bilke on 12 March 2021, 20:21:11 UTC
Merge branch 'eve-foss2020b' into 'master'
Tip revision: e789827
Component.cpp
/**
 * \file
 * \author Norbert Grunwald
 * \date   Sep 7, 2017
 *
 * \copyright
 * Copyright (c) 2012-2021, OpenGeoSys Community (http://www.opengeosys.org)
 *            Distributed under a Modified BSD License.
 *              See accompanying file LICENSE.txt or
 *              http://www.opengeosys.org/project/license
 */

#include "Component.h"
#include "Components/Components.h"
#include "Properties/Properties.h"

namespace MaterialPropertyLib
{
Component::Component()
{
}

Component::Component(std::string const& component_name,
                     std::unique_ptr<PropertyArray>&& properties)
    : name(component_name)
{
    if (properties)
    {
        overwriteExistingProperties(properties_, *properties, this);
    }
}

Property const& Component::property(PropertyType const& p) const
{
    return *properties_[p];
}

bool Component::hasProperty(PropertyType const& p) const
{
    return properties_[p] != nullptr;
}

std::string Component::description() const
{
    return "component '" + name + "'";
}
}  // namespace MaterialPropertyLib
back to top