Changeset 1574 for code/branches/core3/src/core/MetaObjectList.cc
- Timestamp:
- Jun 9, 2008, 4:35:38 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core3/src/core/MetaObjectList.cc
r1505 r1574 33 33 34 34 #include "MetaObjectList.h" 35 #include "Debug.h" 35 36 36 37 namespace orxonox 37 38 { 39 // ############################### 40 // ### MetaObjectListElement ### 41 // ############################### 42 /** 43 @brief Destructor: Removes the ObjectListBaseElement from the ObjectListBase by linking next_ and prev_ of the ObjectListBaseElement. 44 */ 45 MetaObjectListElement::~MetaObjectListElement() 46 { 47 COUT(5) << "*** MetaObjectList: Removing Object from " << this->list_->getIdentifier()->getName() << "-list." << std::endl; 48 this->list_->notifyIterators(this->element_); 49 50 if (this->element_->next_) 51 this->element_->next_->prev_ = this->element_->prev_; 52 else 53 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 54 55 if (this->element_->prev_) 56 this->element_->prev_->next_ = this->element_->next_; 57 else 58 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 59 60 delete this->element_; 61 } 62 63 64 // ############################### 65 // ### MetaObjectList ### 66 // ############################### 38 67 /** 39 68 @brief Constructor: Sets first_ to zero. … … 49 78 MetaObjectList::~MetaObjectList() 50 79 { 51 BaseMetaObjectListElement* temp;80 MetaObjectListElement* temp; 52 81 while (this->first_) 53 82 { … … 57 86 } 58 87 } 88 89 /** 90 @brief Adds an ObjectList and an element of that list to the MetaObjectList. 91 @param list The ObjectList wherein the element is 92 @param element The element wherein the object is 93 */ 94 void MetaObjectList::add(ObjectListBase* list, ObjectListBaseElement* element) 95 { 96 MetaObjectListElement* temp = this->first_; 97 this->first_ = new MetaObjectListElement(list, element); 98 this->first_->next_ = temp; 99 } 59 100 }
Note: See TracChangeset
for help on using the changeset viewer.