MCPcopy Create free account
hub / github.com/NatLabRockies/OpenStudio / insertObjectByIddObjectType

Method insertObjectByIddObjectType

src/utilities/idf/IdfFile.cpp:153–168  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

151}
152
153void IdfFile::insertObjectByIddObjectType(const IdfObject& object) {
154 for (auto it = m_objects.begin(), itEnd = m_objects.end(); it != itEnd; ++it) {
155 if (it == itEnd || object.iddObject().type() < it->iddObject().type()) {
156 // insert object immediately before it
157 it = m_objects.insert(it, object);
158 if (object.iddObject().isVersionObject()
159 || ((object.iddObject().type() == IddObjectType::Catchall) && (object.numFields() > 0u)
160 && (boost::regex_match(object.getString(0).get(), iddRegex::versionObjectName())))) {
161 unsigned index = unsigned(it - m_objects.begin());
162 m_versionObjectIndices.insert(index);
163 OS_ASSERT(m_objects[index] == object);
164 }
165 return;
166 }
167 }
168}
169
170bool IdfFile::removeObject(const IdfObject& object) {
171 auto it =

Callers 1

TEST_FFunction · 0.80

Calls 9

beginMethod · 0.80
iddObjectMethod · 0.80
isVersionObjectMethod · 0.80
endMethod · 0.45
typeMethod · 0.45
insertMethod · 0.45
numFieldsMethod · 0.45
getMethod · 0.45
getStringMethod · 0.45

Tested by 1

TEST_FFunction · 0.64