| 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 |
nothing calls this directly
no test coverage detected