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

Method resources

src/model/ModelObject.cpp:83–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

81 }
82
83 std::vector<ResourceObject> ModelObject_Impl::resources() const {
84 // resources are ResourceObjects pointed to ...
85 ResourceObjectVector resourceObjects = getObject<ModelObject>().getModelObjectTargets<ResourceObject>();
86
87 // create vector of unique resource objects except for a ResourceObject that is this object's parent
88 OptionalParentObject opo = parent();
89 std::set<Handle> uniqueResourceHandles;
90 ResourceObjectVector result;
91 for (const ResourceObject& resourceObject : resourceObjects) {
92
93 Handle handle = resourceObject.handle();
94 if (opo && (opo->handle() == handle)) {
95 continue;
96 }
97
98 auto it = uniqueResourceHandles.find(handle);
99 if (it != uniqueResourceHandles.end()) {
100 continue;
101 }
102
103 uniqueResourceHandles.insert(handle);
104 result.push_back(resourceObject);
105 }
106
107 return result;
108 }
109
110 /** Get all output variables associated with this object, must run simulation to generate associate data. */
111 OutputVariableVector ModelObject_Impl::outputVariables() const {

Callers 8

cloneMethod · 0.95
getRecursiveResourcesFunction · 0.45
TEST_FFunction · 0.45
TEST_FFunction · 0.45
TEST_FFunction · 0.45

Calls 5

handleMethod · 0.45
findMethod · 0.45
endMethod · 0.45
insertMethod · 0.45
push_backMethod · 0.45

Tested by 4

TEST_FFunction · 0.36
TEST_FFunction · 0.36
TEST_FFunction · 0.36