- Timestamp:
- 11/25/21 18:25:19 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_ym/XIOS_COUPLING/src/object_factory_impl.hpp
r2183 r2265 147 147 148 148 template <typename U> 149 const StdString &CObjectFactory::GetUIdBase(void)150 { 151 staticStdString base ;149 const StdString CObjectFactory::GetUIdBase(void) 150 { 151 StdString base ; 152 152 // base = "__"+CObjectFactory::CurrContext + "::" + U::GetName() + "_undef_id_"; 153 153 base = CObjectFactory::CurrContext + "__" + U::GetName() + "_undef_id_"; … … 166 166 bool CObjectFactory::IsGenUId(const StdString& id) 167 167 { 168 const StdString &base = GetUIdBase<U>();168 const StdString base = GetUIdBase<U>(); 169 169 return (id.size() > base.size() && id.compare(0, base.size(), base) == 0); 170 170 } 171 171 172 template <typename U> 173 void CObjectFactory::deleteContext(const StdString & context) 174 { 175 for (auto& v : U::AllVectObj[context]) v.reset() ; 176 U::AllVectObj[context].clear() ; 177 U::AllVectObj.erase(context) ; 178 for (auto& m : U::AllMapObj[context]) m.second.reset() ; 179 U::AllMapObj[context].clear() ; 180 U::AllMapObj.erase(context) ; 181 182 U::GenId.erase(context) ; 183 } 184 185 template <typename U> 186 void CObjectFactory::deleteAllContexts(void) 187 { 188 list<StdString> contextList ; 189 for(auto& context : U::AllMapObj) contextList.push_back(context.first) ; 190 for(auto& context : contextList) deleteContext<U>(context) ; 191 } 192 193 194 template <typename U> 195 void CObjectFactory::dumpObjects(void) 196 { 197 for (auto& context : U::AllMapObj) 198 for(auto& m : context.second) 199 { 200 info(100)<<"Dump All Object"<<endl ; 201 info(100)<<"Object from context "<<context.first<<" with id "<<m.first<<endl ; 202 } 203 } 172 204 } // namespace xios 173 205
Note: See TracChangeset
for help on using the changeset viewer.