Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 12, 2009, 1:46:26 PM (15 years ago)
Author:
rgrieder
Message:

Removing superfluous feature: construction callbacks.
If we ever need them again (which I highly doubt since you can achieve the same with an interface class), SVN is at our service.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/pch/src/core/Identifier.cc

    r2662 r3151  
    6363        this->bHasConfigValues_ = false;
    6464        this->bHasConsoleCommands_ = false;
    65         this->bHasConstructionCallback_ = false;
    6665
    6766        this->children_ = new std::set<const Identifier*>();
     
    9392        for (std::map<std::string, XMLPortObjectContainer*>::iterator it = this->xmlportObjectContainers_.begin(); it != this->xmlportObjectContainers_.end(); ++it)
    9493            delete (it->second);
    95         for (std::vector<Functor*>::iterator it = this->constructionCallbacks_.begin(); it != this->constructionCallbacks_.end(); ++it)
    96             delete *it;
    9794    }
    9895
     
    519516
    520517    /**
    521         @brief Adds a construction callback functor that gets called every time an object is created.
    522         @param functor Functor pointer to any function with no argument.
    523     */
    524     void Identifier::addConstructionCallback(Functor* functor)
    525     {
    526         for (unsigned int i = 0; i < this->constructionCallbacks_.size(); ++i)
    527         {
    528             if (this->constructionCallbacks_[i] == functor)
    529                 return;
    530         }
    531         this->constructionCallbacks_.push_back(functor);
    532         this->bHasConstructionCallback_ = true;
    533     }
    534 
    535     /**
    536         @brief Removes a construction callback functor that gets called every time an object is created.
    537         @param functor Functor pointer to any function with no argument.
    538     */
    539     void Identifier::removeConstructionCallback(Functor* functor)
    540     {
    541         for (unsigned int i = 0; i < this->constructionCallbacks_.size(); ++i)
    542         {
    543             if (this->constructionCallbacks_[i] == functor)
    544             {
    545                 this->constructionCallbacks_.erase(this->constructionCallbacks_.begin() + i);
    546             }
    547         }
    548         if (constructionCallbacks_.empty())
    549             this->bHasConstructionCallback_ = false;
    550     }
    551 
    552     /**
    553518        @brief Lists the names of all Identifiers in a std::set<const Identifier*>.
    554519        @param out The outstream
Note: See TracChangeset for help on using the changeset viewer.