Loading [MathJax]/extensions/tex2jax.js
Cantera  3.2.0a1
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
ConnectorNode.cpp
Go to the documentation of this file.
1//! @file ConnectorNode.cpp
2
3// This file is part of Cantera. See License.txt in the top-level directory or
4// at https://cantera.org/license.txt for license and copyright information.
5
8
9namespace Cantera
10{
11
12void ConnectorNode::setDefaultName(map<string, int>& counts)
13{
14 if (m_defaultNameSet) {
15 return;
16 }
17 m_defaultNameSet = true;
18 string typ(type());
19 if (m_name == "(none)" || m_name == "") {
20 m_name = fmt::format("{}_{}", type(), counts[type()]);
21 }
22 counts[type()]++;
23}
24
25}
bool m_defaultNameSet
true if default name has been previously set.
void setDefaultName(map< string, int > &counts)
Set the default name of a connector. Returns false if it was previously set.
virtual string type() const
String indicating the connector implemented.
string m_name
ConnectorNode name.
Namespace for the Cantera kernel.
Definition AnyMap.cpp:595