MCPcopy Create free account
hub / github.com/Cantera/cantera / copyMetadata

Method copyMetadata

src/base/AnyMap.cpp:1553–1573  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1551}
1552
1553void AnyMap::copyMetadata(const AnyMap& other)
1554{
1555 m_line = other.m_line;
1556 m_column = other.m_column;
1557 if (!other.m_metadata) {
1558 return;
1559 }
1560
1561 if (m_metadata) {
1562 // Fork the metadata tree at this point to avoid affecting parent nodes
1563 m_metadata = make_shared<AnyMap>(*m_metadata);
1564 } else {
1565 m_metadata = make_shared<AnyMap>();
1566 }
1567
1568 for (const auto& [key, value] : *other.m_metadata) {
1569 (*m_metadata)[key] = value;
1570 }
1571
1572 propagateMetadata(m_metadata);
1573}
1574
1575bool AnyMap::getBool(const string& key, bool default_) const
1576{

Callers 2

newSpeciesFunction · 0.80
setParametersMethod · 0.80

Calls

no outgoing calls

Tested by 1

newSpeciesFunction · 0.64