MCPcopy Create free account
hub / github.com/OpenSees/OpenSees / removeComponent

Method removeComponent

SRC/tagged/storage/MapOfTaggedObjects.cpp:111–132  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

109
110
111TaggedObject *
112MapOfTaggedObjects::removeComponent(int tag)
113{
114 TaggedObject *removed =0;
115 MAP_TAGGED_ITERATOR theEle;
116
117 // return 0 if component does not exist, otherwise remove it
118 theEle = theMap.find(tag);
119 if (theEle == theMap.end()) // the object has not been added
120 return 0;
121 else { // the object exists so we remove it
122 removed = (*theEle).second;
123 int ok = int(theMap.erase(tag));
124 if (ok != 1) { // ensure the map did remove the object
125 opserr << "MapOfTaggedObjects::removeComponent - map STL failed to remove object with tag " <<
126 tag << "\n";
127 return 0;
128 }
129 }
130
131 return removed;
132}
133
134
135int

Callers 15

mainFunction · 0.45
OPS_removeMeshFunction · 0.45
removeDesignVariableMethod · 0.45
OPS_removeDampingFunction · 0.45
removeNodalLoadMethod · 0.45
removeElementalLoadMethod · 0.45
removeSP_ConstraintMethod · 0.45
OPS_removeTimeSeriesFunction · 0.45
removeNodeMethod · 0.45

Calls 1

endMethod · 0.45

Tested by

no test coverage detected