Changeset 7494 for code/trunk/src/modules/pickup/PickupManager.cc
- Timestamp:
- Sep 28, 2010, 5:31:59 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/modules/pickup/PickupManager.cc
r7284 r7494 21 21 * 22 22 * Author: 23 * ...23 * Damian 'Mozork' Frick 24 24 * Co-authors: 25 25 * ... … … 100 100 bool PickupManager::registerRepresentation(const PickupIdentifier* identifier, PickupRepresentation* representation) 101 101 { 102 if(identifier == NULL || representation == NULL || this->representations_.find(identifier) != this->representations_.end()) //!< If the Pickupable already has a Representation registered. 102 assert(identifier); 103 assert(representation); 104 105 if(this->representations_.find(identifier) != this->representations_.end()) // If the Pickupable already has a Representation registered. 103 106 return false; 104 107 105 108 this->representations_[identifier] = representation; 106 109 107 COUT(4) << "PickupRepresentation " << representation << " registered with the PickupManager." << std::endl;110 COUT(4) << "PickupRepresentation &" << representation << " registered with the PickupManager." << std::endl; 108 111 return true; 109 112 } … … 121 124 bool PickupManager::unregisterRepresentation(const PickupIdentifier* identifier, PickupRepresentation* representation) 122 125 { 123 if(identifier == NULL || representation == NULL)124 return false;126 assert(identifier); 127 assert(representation); 125 128 126 129 std::map<const PickupIdentifier*, PickupRepresentation*, PickupIdentifierCompare>::iterator it = this->representations_.find(identifier); … … 130 133 this->representations_.erase(it); 131 134 132 COUT(4) << "PickupRepresentation " << representation << " unregistered with the PickupManager." << std::endl;135 COUT(4) << "PickupRepresentation &" << representation << " unregistered with the PickupManager." << std::endl; 133 136 return true; 134 137 } … … 167 170 if(pickup != NULL) 168 171 return this->getRepresentation(pickup->getPickupIdentifier()); 169 172 170 173 return NULL; 171 174 } … … 268 271 if(pickup == NULL) 269 272 return; 270 273 271 274 std::map<Pickupable*, WeakPtr<Pickupable> >::iterator it = this->pickupsList_.find(pickup); // Get the WeakPointer of the Pickupable. 272 275 // If either the input Pickupable is not in the PickupManagers list or it no longer exists, the method returns.
Note: See TracChangeset
for help on using the changeset viewer.