Changeset 879 for code/branches/core2/src/orxonox/core/Namespace.cc
- Timestamp:
- Mar 10, 2008, 5:07:48 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core2/src/orxonox/core/Namespace.cc
r878 r879 38 38 RegisterObject(Namespace); 39 39 40 this->representingNamespace_ = 0;40 this->representingNamespace_ = this; 41 41 } 42 42 … … 55 55 BaseObject::XMLPort(xmlelement, loading); 56 56 57 XMLPortObject(Namespace, BaseObject, "", loadObjects, saveObjects, xmlelement, loading, true );57 XMLPortObject(Namespace, BaseObject, "", loadObjects, saveObjects, xmlelement, loading, true, false); 58 58 } 59 59 60 60 void Namespace::loadObjects(BaseObject* object) 61 61 { 62 object->setNamespace(this); 62 object->setNamespace(this->representingNamespace_); 63 64 if (object->isA(Class(Namespace))) 65 this->addSubnamespace((Namespace*)object); 66 } 67 68 void Namespace::addSubnamespace(Namespace* ns) 69 { 70 std::string name = ns->getName().substr(ns->getName().find("::" 71 72 if (!this->hasSubnamespace(ns->getName())) 73 this->namespaces_[ns->getName()] = ns; 74 else 75 ns->representingNamespace_ = object; 76 } 77 78 bool Namespace::hasSubnamespace(const std::string& name) const 79 { 80 return (this->namespaces_.find(name) != this->namespaces_.end()); 63 81 } 64 82
Note: See TracChangeset
for help on using the changeset viewer.