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

Function getSubsetOfRecursiveResources

src/model/ResourceObject.hpp:89–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

87 /** Returns all objects in getRecursiveResources(object) that can be cast to type T. */
88 template <typename T>
89 std::vector<T> getSubsetOfRecursiveResources(const ModelObject& object) {
90 std::vector<ResourceObject> allResources = getRecursiveResources(object);
91 std::vector<T> result;
92 for (const ResourceObject& resource : allResources) {
93 boost::optional<T> candidate = resource.optionalCast<T>();
94 if (candidate) {
95 result.push_back(*candidate);
96 }
97 }
98 return result;
99 }
100
101 /** Returns all \link ResourceObject ResourceObjects \endlink and their children accessible
102 * by alternately calling ModelObject::resources() and getRecursiveChilden. Each element of the

Callers

nothing calls this directly

Calls 2

getRecursiveResourcesFunction · 0.85
push_backMethod · 0.45

Tested by

no test coverage detected