Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 22, 2010, 12:48:55 AM (14 years ago)
Author:
landauf
Message:

some cleanup in SharedPtr and its relatives

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/consolecommands3/src/libraries/core/SharedPtr.h

    r7197 r7201  
    5050            void destroy()
    5151            {
    52 //                COUT(0) << "delete " << this->pointer_ << std::endl;
    5352                delete this->pointer_;
    5453            }
     
    6766            inline SharedPtr() : pointer_(0), counter_(0), destroyer_(0)
    6867            {
    69 //                COUT(0) << "SharedPtr (1): " << this->pointer_ << std::endl;
    7068            }
    7169
    7270            inline SharedPtr(T* pointer) : pointer_(pointer), counter_(0), destroyer_(0)
    7371            {
    74 //                COUT(0) << "SharedPtr (2): " << this->pointer_ << std::endl;
    7572                if (this->pointer_)
    7673                {
     
    8279            inline SharedPtr(const SharedPtr& other) : pointer_(other.pointer_), counter_(other.counter_), destroyer_(other.destroyer_)
    8380            {
    84 //                COUT(0) << "SharedPtr (3): " << this->pointer_ << std::endl;
    8581                if (this->pointer_)
    8682                    ++(*this->counter_);
     
    9086            inline SharedPtr(const SharedPtr<O>& other) : pointer_(other.pointer_), counter_(other.counter_), destroyer_(other.destroyer_)
    9187            {
    92 //                COUT(0) << "SharedPtr (4): " << this->pointer_ << std::endl;
    9388                if (this->pointer_)
    9489                    ++(*this->counter_);
     
    9792            inline ~SharedPtr()
    9893            {
    99 //                COUT(0) << "~SharedPtr: " << this->pointer_ << std::endl;
    10094                if (this->pointer_)
    10195                {
     
    113107            inline const SharedPtr& operator=(const SharedPtr& other)
    114108            {
    115 //                COUT(0) << "SharedPtr= (1)" << std::endl;
    116109                SharedPtr(other).swap(*this);
    117110                return *this;
     
    121114            inline const SharedPtr& operator=(const SharedPtr<O>& other)
    122115            {
    123 //                COUT(0) << "SharedPtr= (2)" << std::endl;
    124116                SharedPtr(other).swap(*this);
    125117                return *this;
     
    160152            inline SharedPtr(T* pointer, int* counter, SharedPtrDestroyer* destroyer) : pointer_(pointer), counter_(counter), destroyer_(destroyer)
    161153            {
    162 //                COUT(0) << "SharedPtr (5): " << this->pointer_ << std::endl;
    163154                if (this->pointer_)
    164155                    ++(*this->counter_);
     
    176167            inline SharedChildPtr() : Parent() {}
    177168            inline SharedChildPtr(T* pointer) : Parent(pointer) {}
    178 //            inline SharedChildPtr(const SharedChildPtr& other) : Parent(other) {}
    179 //            template <class O>
    180 //            inline SharedChildPtr(const SharedChildPtr<O, T>& other) : Parent(other) {}
    181169            inline SharedChildPtr(const SharedPtr<T>& other) : Parent(other) {}
    182 
    183 //            inline const SharedChildPtr& operator=(const SharedChildPtr& other) { Parent::operator=(other); return *this; }
    184170
    185171            inline T* operator->() const { return static_cast<T*>(Parent::operator->()); }
Note: See TracChangeset for help on using the changeset viewer.