#include <ModelicaFile.hpp>
Public Member Functions | |
| void | addComponentClause (const std::string &text) const |
Append a new component clause, represented by text, to the class body. | |
| ConnectClause | addConnectClause (const std::string &source, const std::string &target) const |
Append a connect(@p source, @p target); statement to the equation section. | |
| std::vector< ConnectClause > | getConnectClauses () const |
| Retrieve all connect_clauses contained in this class definition. | |
| std::string | getText () const |
| Return the raw Modelica text for this class definition. | |
| bool | isValid () const |
| Return true if this handle still refers to a live class definition. | |
| std::string | longClassSpecifier () const |
| Return the fully-qualified name (long class specifier) of the class. | |
| bool | removeConnectClause (const std::string &source, const std::string &target) const |
Remove the first connect clause matching source and target, returning true on success. | |
| ~ClassDefinition () | |
| Destroy the ClassDefinition. | |
Construction & Assignment | |
| ClassDefinition () | |
| Create an empty/invalid ClassDefinition handle. | |
| ClassDefinition (const ClassDefinition &other) | |
| Copy-construct a ClassDefinition, sharing the underlying implementation. | |
| ClassDefinition (ClassDefinition &&other) noexcept | |
| Move-construct a ClassDefinition, transferring ownership of the implementation. | |
| ClassDefinition & | operator= (const ClassDefinition &other) |
| Copy-assign a ClassDefinition, sharing the underlying implementation. | |
| ClassDefinition & | operator= (ClassDefinition &&other) noexcept |
| Move-assign a ClassDefinition, transferring ownership of the implementation. | |
Represents one Modelica class inside the file.
Objects you fetch from ModelicaFile automatically stay in sync with the file: after an edit or parse they keep working as long as the class still exists (same long specifier). If the class is deleted or renamed, calling a method simply throws and you can fetch it again via getClassDefinitions().
| openstudio::modelica::ClassDefinition::ClassDefinition | ( | ) |
Create an empty/invalid ClassDefinition handle.
| openstudio::modelica::ClassDefinition::ClassDefinition | ( | const ClassDefinition & | other | ) |
Copy-construct a ClassDefinition, sharing the underlying implementation.
|
noexcept |
Move-construct a ClassDefinition, transferring ownership of the implementation.
| openstudio::modelica::ClassDefinition::~ClassDefinition | ( | ) |
Destroy the ClassDefinition.
| void openstudio::modelica::ClassDefinition::addComponentClause | ( | const std::string & | text | ) | const |
Append a new component clause, represented by text, to the class body.
| ConnectClause openstudio::modelica::ClassDefinition::addConnectClause | ( | const std::string & | source, |
| const std::string & | target ) const |
Append a connect(@p source, @p target); statement to the equation section.
| std::vector< ConnectClause > openstudio::modelica::ClassDefinition::getConnectClauses | ( | ) | const |
Retrieve all connect_clauses contained in this class definition.
| std::string openstudio::modelica::ClassDefinition::getText | ( | ) | const |
Return the raw Modelica text for this class definition.
| bool openstudio::modelica::ClassDefinition::isValid | ( | ) | const |
Return true if this handle still refers to a live class definition.
| std::string openstudio::modelica::ClassDefinition::longClassSpecifier | ( | ) | const |
Return the fully-qualified name (long class specifier) of the class.
|
noexcept |
Move-assign a ClassDefinition, transferring ownership of the implementation.
| ClassDefinition & openstudio::modelica::ClassDefinition::operator= | ( | const ClassDefinition & | other | ) |
Copy-assign a ClassDefinition, sharing the underlying implementation.
| bool openstudio::modelica::ClassDefinition::removeConnectClause | ( | const std::string & | source, |
| const std::string & | target ) const |
Remove the first connect clause matching source and target, returning true on success.