Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 20, 2010, 2:59:20 AM (14 years ago)
Author:
landauf
Message:

Added a small SharedPtr template for use in Functor and Executor. It's an intrusive approach that requires the object to implement a reference counter. The SharedPtr is extensible to reflect the hierarchy of Functor, FunctorStatic, FunctorMember<T>, and all subclasses (same for Executor).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/consolecommands3/src/libraries/core/Executor.cc

    r7189 r7192  
    3939namespace orxonox
    4040{
     41    int Functor::instances_s = 0;
     42    int Executor::instances_s = 0;
     43
    4144    Executor::Executor(Functor* functor, const std::string& name)
    4245    {
     46        this->references_ = 0;
    4347        this->functor_ = functor;
    4448        this->name_ = name;
     49        ++instances_s; COUT(0) << "executor ++: " << instances_s << std::endl;
    4550    }
    4651
     
    4853    {
    4954        delete this->functor_;
     55        --instances_s; COUT(0) << "executor --: " << instances_s << std::endl;
    5056    }
    5157
Note: See TracChangeset for help on using the changeset viewer.