Changeset 347 for XIOS/trunk/src/group_template_impl.hpp
- Timestamp:
- 05/21/12 17:57:22 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/group_template_impl.hpp
r346 r347 49 49 os.write (reinterpret_cast<const char*>(&chdnb) , sizeof(StdSize)); 50 50 51 typename std::vector< boost::shared_ptr<V> >::const_iterator51 typename std::vector<V*>::const_iterator 52 52 itg = this->groupList.begin(), endg = this->groupList.end(); 53 typename std::vector< boost::shared_ptr<U>>::const_iterator53 typename std::vector<U*>::const_iterator 54 54 itc = this->childList.begin(), endc = this->childList.end(); 55 55 56 56 for (; itg != endg; itg++) 57 57 { 58 boost::shared_ptr<V>group = *itg;58 V* group = *itg; 59 59 bool hid = group->hasId(); 60 60 … … 75 75 for (; itc != endc; itc++) 76 76 { 77 boost::shared_ptr<U>child = *itc;77 U* child = *itc; 78 78 bool hid = child->hasId(); 79 79 … … 99 99 SuperClass::fromBinary(is); 100 100 101 boost::shared_ptr<V>group_ptr = (this->hasId())102 ? CObjectFactory::GetObject<V>(this->getId())103 : CObjectFactory::GetObject(boost::polymorphic_downcast<V*>(this));101 V* group_ptr = (this->hasId()) 102 ? V::get(this->getId()) 103 : V::get((V*)this); 104 104 105 105 StdSize grpnb = 0; … … 126 126 StdString id(size, ' '); 127 127 is.read (const_cast<char *>(id.data()), size * sizeof(char)); 128 CGroupFactory::CreateGroup(group_ptr , id)->fromBinary(is);128 CGroupFactory::CreateGroup(group_ptr->getShared(), id)->fromBinary(is); 129 129 } 130 130 else 131 131 { 132 CGroupFactory::CreateGroup(group_ptr )->fromBinary(is);132 CGroupFactory::CreateGroup(group_ptr->getShared())->fromBinary(is); 133 133 } 134 134 } … … 150 150 StdString id(size, ' '); 151 151 is.read (const_cast<char *>(id.data()), size * sizeof(char)); 152 CGroupFactory::CreateChild(group_ptr , id)->fromBinary(is);152 CGroupFactory::CreateChild(group_ptr->getShared(), id)->fromBinary(is); 153 153 } 154 154 else 155 155 { 156 CGroupFactory::CreateChild(group_ptr )->fromBinary(is);156 CGroupFactory::CreateChild(group_ptr->getShared())->fromBinary(is); 157 157 } 158 158 } … … 176 176 oss << SuperClassAttribute::toString() << ">" << std::endl; 177 177 178 typename std::vector< boost::shared_ptr<V>>::const_iterator178 typename std::vector<V*>::const_iterator 179 179 itg = this->groupList.begin(), endg = this->groupList.end(); 180 typename std::vector< boost::shared_ptr<U>>::const_iterator180 typename std::vector<U*>::const_iterator 181 181 itc = this->childList.begin(), endc = this->childList.end(); 182 182 183 183 for (; itg != endg; itg++) 184 184 { 185 boost::shared_ptr<V>group = *itg;185 V* group = *itg; 186 186 oss << *group << std::endl; 187 187 } … … 189 189 for (; itc != endc; itc++) 190 190 { 191 boost::shared_ptr<U>child = *itc;191 U* child = *itc; 192 192 oss << *child << std::endl; 193 193 } … … 226 226 227 227 template <class U, class V, class W> 228 const std::vector< boost::shared_ptr<U>>&228 const std::vector<U*>& 229 229 CGroupTemplate<U, V, W>::getChildList(void) const 230 230 { … … 235 235 236 236 template <class U, class V, class W> 237 const xios_map<StdString, boost::shared_ptr<V>>&237 const xios_map<StdString, V*>& 238 238 CGroupTemplate<U, V, W>::getGroupMap(void) const 239 239 { … … 265 265 SuperClassAttribute::setAttributes(parent); 266 266 267 typename std::vector< boost::shared_ptr<U>>::const_iterator267 typename std::vector<U*>::const_iterator 268 268 itc = this->childList.begin(), endc = this->childList.end(); 269 typename std::vector< boost::shared_ptr<V>>::const_iterator269 typename std::vector<V*>::const_iterator 270 270 itg = this->groupList.begin(), endg = this->groupList.end(); 271 271 272 272 for (; itc != endc; itc++) 273 273 { 274 boost::shared_ptr<U>child = *itc;274 U* child = *itc; 275 275 child->solveDescInheritance(this); 276 276 } … … 278 278 for (; itg != endg; itg++) 279 279 { 280 boost::shared_ptr<V>group = *itg;280 V* group = *itg; 281 281 group->solveRefInheritance(); 282 282 group->solveDescInheritance(this); … … 287 287 288 288 template <class U, class V, class W> 289 void CGroupTemplate<U, V, W>::getAllChildren(std::vector< boost::shared_ptr<U> >& allc) const289 void CGroupTemplate<U, V, W>::getAllChildren(std::vector<U*>& allc) const 290 290 { 291 291 allc.insert (allc.end(), childList.begin(), childList.end()); 292 typename std::vector< boost::shared_ptr<V>>::const_iterator292 typename std::vector<V*>::const_iterator 293 293 itg = this->groupList.begin(), endg = this->groupList.end(); 294 294 295 295 for (; itg != endg; itg++) 296 296 { 297 boost::shared_ptr<V>group = *itg;297 V* group = *itg; 298 298 group->getAllChildren(allc); 299 299 } … … 303 303 304 304 template <class U, class V, class W> 305 std::vector< boost::shared_ptr<U>> CGroupTemplate<U, V, W>::getAllChildren(void) const306 { 307 std::vector< boost::shared_ptr<U>> allc;305 std::vector<U*> CGroupTemplate<U, V, W>::getAllChildren(void) const 306 { 307 std::vector<U*> allc; 308 308 this->getAllChildren(allc); 309 309 return (allc); … … 343 343 344 344 template <class U, class V, class W> 345 boost::shared_ptr<U>CGroupTemplate<U, V, W>::createChild(const string& id)345 U* CGroupTemplate<U, V, W>::createChild(const string& id) 346 346 { 347 return CGroupFactory::CreateChild<V>(this->get (), id) ;347 return CGroupFactory::CreateChild<V>(this->getShared(), id).get() ; 348 348 } 349 349 350 350 template <class U, class V, class W> 351 void CGroupTemplate<U, V, W>::addChild( shared_ptr<U>child)351 void CGroupTemplate<U, V, W>::addChild(U* child) 352 352 { 353 return CGroupFactory::AddChild<V>(this->get (),child) ;353 return CGroupFactory::AddChild<V>(this->getShared,child->getShared()) ; 354 354 } 355 355 356 356 template <class U, class V, class W> 357 boost::shared_ptr<V>CGroupTemplate<U, V, W>::createChildGroup(const string& id)357 V* CGroupTemplate<U, V, W>::createChildGroup(const string& id) 358 358 { 359 return CGroupFactory::CreateGroup<V>(this->get (), id) ;359 return CGroupFactory::CreateGroup<V>(this->getShared(), id).get() ; 360 360 } 361 361 362 362 template <class U, class V, class W> 363 void CGroupTemplate<U, V, W>::addChildGroup( shared_ptr<V>childGroup)363 void CGroupTemplate<U, V, W>::addChildGroup(V* childGroup) 364 364 { 365 return CGroupFactory::AddGroup<V>(this->get (), childGroup) ;365 return CGroupFactory::AddGroup<V>(this->getShared(), childGroup->getShared()) ; 366 366 } 367 367 … … 370 370 void CGroupTemplate<U, V, W>::sendCreateChild(const string& id) 371 371 { 372 shared_ptr<CContext>context=CContext::getCurrent() ;372 CContext* context=CContext::getCurrent() ; 373 373 374 374 if (! context->hasServer ) … … 393 393 void CGroupTemplate<U, V, W>::sendCreateChildGroup(const string& id) 394 394 { 395 shared_ptr<CContext>context=CContext::getCurrent() ;395 CContext* context=CContext::getCurrent() ; 396 396 if (! context->hasServer ) 397 397 {
Note: See TracChangeset
for help on using the changeset viewer.