Changeset 2084 for code/branches/objecthierarchy/src/core/Identifier.cc
- Timestamp:
- Nov 1, 2008, 2:51:02 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/objecthierarchy/src/core/Identifier.cc
r2063 r2084 63 63 this->bHasConfigValues_ = false; 64 64 this->bHasConsoleCommands_ = false; 65 this->bHasConstructionCallback_ = false; 65 66 66 67 this->children_ = new std::set<const Identifier*>(); … … 508 509 509 510 /** 511 @brief Adds a construction callback functor that gets called every time an object is created. 512 @param functor Functor pointer to any function with no argument. 513 */ 514 void Identifier::addConstructionCallback(Functor* functor) 515 { 516 for (unsigned int i = 0; i < this->constructionCallbacks_.size(); ++i) 517 { 518 if (this->constructionCallbacks_[i] == functor) 519 return; 520 } 521 this->constructionCallbacks_.push_back(functor); 522 this->bHasConstructionCallback_ = true; 523 } 524 525 /** 526 @brief Removes a construction callback functor that gets called every time an object is created. 527 @param functor Functor pointer to any function with no argument. 528 */ 529 void Identifier::removeConstructionCallback(Functor* functor) 530 { 531 for (unsigned int i = 0; i < this->constructionCallbacks_.size(); ++i) 532 { 533 if (this->constructionCallbacks_[i] == functor) 534 { 535 this->constructionCallbacks_.erase(this->constructionCallbacks_.begin() + i); 536 } 537 } 538 if (constructionCallbacks_.empty()) 539 this->bHasConstructionCallback_ = false; 540 } 541 542 /** 510 543 @brief Lists the names of all Identifiers in a std::set<const Identifier*>. 511 544 @param out The outstream
Note: See TracChangeset
for help on using the changeset viewer.