MCPcopy Create free account
hub / github.com/IfcOpenShell/IfcOpenShell / get_related

Function get_related

src/serializers/schema_dependent/XmlSerializer.cpp:222–234  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

220// model. The second and third argument require a member function pointer.
221template <typename T, typename U, typename V, typename F, typename G>
222auto get_related(T* t, F f, G g) {
223 typename U::list::ptr li = (*t.*f)()->template as<U>();
224 typename aggregate_of<V>::ptr acc(new aggregate_of<V>);
225 for (typename U::list::it it = li->begin(); it != li->end(); ++it) {
226 U* u = *it;
227 try {
228 acc->push((*u.*g)()->template as<V>());
229 } catch (IfcParse::IfcException& e) {
230 Logger::Error(e);
231 }
232 }
233 return acc;
234}
235
236// Descends into the tree by recursing into IfcRelContainedInSpatialStructure,
237// IfcRelDecomposes, IfcRelDefinesByType, IfcRelDefinesByProperties relations.

Callers

nothing calls this directly

Calls 4

ErrorFunction · 0.50
beginMethod · 0.45
endMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected