Changeset 1747 for code/trunk/src/core/MetaObjectList.cc
- Timestamp:
- Sep 9, 2008, 4:25:52 AM (17 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
/code/branches/core3 (added) merged: 1573-1574,1583-1586,1591-1594,1596-1597,1603,1606-1607,1610-1611,1655,1658,1676-1679,1681-1685,1687,1716-1723,1725-1729,1736
- Property svn:mergeinfo changed
-
code/trunk/src/core/MetaObjectList.cc
r1505 r1747 33 33 34 34 #include "MetaObjectList.h" 35 #include "ObjectListBase.h" 36 #include "Identifier.h" 37 #include "util/Debug.h" 35 38 36 39 namespace orxonox 37 40 { 41 // ############################### 42 // ### MetaObjectListElement ### 43 // ############################### 44 /** 45 @brief Destructor: Removes the ObjectListBaseElement from the ObjectListBase by linking next_ and prev_ of the ObjectListBaseElement. 46 */ 47 MetaObjectListElement::~MetaObjectListElement() 48 { 49 COUT(5) << "*** MetaObjectList: Removing Object from " << this->list_->getIdentifier()->getName() << "-list." << std::endl; 50 this->list_->notifyIterators(this->element_->objectBase_); 51 52 if (this->element_->next_) 53 this->element_->next_->prev_ = this->element_->prev_; 54 else 55 this->list_->last_ = this->element_->prev_; // If there is no next_, we deleted the last object and have to update the last_ pointer of the list 56 57 if (this->element_->prev_) 58 this->element_->prev_->next_ = this->element_->next_; 59 else 60 this->list_->first_ = this->element_->next_; // If there is no prev_, we deleted the first object and have to update the first_ pointer of the list 61 62 delete this->element_; 63 } 64 65 66 // ############################### 67 // ### MetaObjectList ### 68 // ############################### 38 69 /** 39 70 @brief Constructor: Sets first_ to zero. … … 49 80 MetaObjectList::~MetaObjectList() 50 81 { 51 BaseMetaObjectListElement* temp;82 MetaObjectListElement* temp; 52 83 while (this->first_) 53 84 { … … 57 88 } 58 89 } 90 91 /** 92 @brief Adds an ObjectList and an element of that list to the MetaObjectList. 93 @param list The ObjectList wherein the element is 94 @param element The element wherein the object is 95 */ 96 void MetaObjectList::add(ObjectListBase* list, ObjectListBaseElement* element) 97 { 98 MetaObjectListElement* temp = this->first_; 99 this->first_ = new MetaObjectListElement(list, element); 100 this->first_->next_ = temp; 101 } 59 102 }
Note: See TracChangeset
for help on using the changeset viewer.