Changeset 7201 for code/branches/consolecommands3/src
- Timestamp:
- Aug 22, 2010, 12:48:55 AM (14 years ago)
- Location:
- code/branches/consolecommands3/src/libraries/core
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/consolecommands3/src/libraries/core/Executor.cc
r7200 r7201 39 39 namespace orxonox 40 40 { 41 int Functor::instances_s = 0;42 int Executor::instances_s = 0;43 44 41 Executor::Executor(const FunctorPtr& functor, const std::string& name) 45 42 { 46 43 this->functor_ = functor; 47 44 this->name_ = name; 48 ++instances_s; COUT(0) << "executor ++: " << instances_s << std::endl;49 45 } 50 46 51 47 Executor::~Executor() 52 48 { 53 --instances_s; COUT(0) << "executor --: " << instances_s << std::endl;54 49 } 55 50 -
code/branches/consolecommands3/src/libraries/core/Executor.h
r7200 r7201 109 109 std::string name_; 110 110 MultiType defaultValue_[MAX_FUNCTOR_ARGUMENTS]; 111 112 private:113 static int instances_s;114 111 }; 115 112 -
code/branches/consolecommands3/src/libraries/core/Functor.h
r7198 r7201 102 102 103 103 public: 104 Functor() { ++instances_s; COUT(0) << "functor ++: " << instances_s << std::endl;}105 virtual ~Functor() { --instances_s; COUT(0) << "functor --: " << instances_s << std::endl;}104 Functor() {} 105 virtual ~Functor() {} 106 106 107 107 virtual MultiType operator()(const MultiType& param1 = MT_Type::Null, const MultiType& param2 = MT_Type::Null, const MultiType& param3 = MT_Type::Null, const MultiType& param4 = MT_Type::Null, const MultiType& param5 = MT_Type::Null) = 0; … … 120 120 121 121 virtual const std::type_info& getHeaderIdentifier() const = 0; 122 123 private:124 static int instances_s;125 122 }; 126 123 -
code/branches/consolecommands3/src/libraries/core/FunctorPtr.h
r7197 r7201 45 45 inline FunctorMemberPtr() : SharedChildPtr<FunctorMember<T>, FunctorPtr>() {} 46 46 inline FunctorMemberPtr(FunctorMember<T>* pointer) : SharedChildPtr<FunctorMember<T>, FunctorPtr>(pointer) {} 47 // inline FunctorMemberPtr(const FunctorMemberPtr& other) : SharedChildPtr<FunctorMember<T>, FunctorPtr>(other) {}48 // template <class O>49 // inline FunctorMemberPtr(const SharedPtr<O>& other) : SharedChildPtr<FunctorMember<T>, FunctorPtr>(other) {}50 // template <class O>51 // inline FunctorMemberPtr(const SharedChildPtr<O, FunctorMember<T> >& other) : SharedChildPtr<FunctorMember<T>, FunctorPtr>(other) {}52 47 inline FunctorMemberPtr(const SharedPtr<FunctorMember<T> >& other) : SharedChildPtr<FunctorMember<T>, FunctorPtr>(other) {} 53 54 /*55 inline const FunctorMemberPtr& operator=(const FunctorMemberPtr& other) { this->SharedChildPtr<FunctorMember<T>, FunctorPtr>::operator=(other); return *this; }56 template <class O>57 inline const FunctorMemberPtr& operator=(const SharedPtr<O>& other) { this->SharedChildPtr<FunctorMember<T>, FunctorPtr>::operator=(other); return *this; }58 */59 private:60 // inline FunctorMemberPtr(FunctorMember<T>* pointer, int* counter) : SharedChildPtr<FunctorMember<T>, FunctorPtr>(pointer, counter) {}61 48 }; 62 /*63 typedef SharedChildPtr<FunctorStatic, Functor> FunctorStaticPtr;64 65 template <class T>66 class FunctorMemberPtr : public SharedChildPtr<FunctorMember<T>, Functor>67 {68 public:69 inline FunctorMemberPtr() : SharedChildPtr<FunctorMember<T>, Functor>() {}70 inline FunctorMemberPtr(FunctorMember<T>* pointer) : SharedChildPtr<FunctorMember<T>, Functor>(pointer) {}71 };72 */73 49 } 74 50 -
code/branches/consolecommands3/src/libraries/core/SharedPtr.h
r7197 r7201 50 50 void destroy() 51 51 { 52 // COUT(0) << "delete " << this->pointer_ << std::endl;53 52 delete this->pointer_; 54 53 } … … 67 66 inline SharedPtr() : pointer_(0), counter_(0), destroyer_(0) 68 67 { 69 // COUT(0) << "SharedPtr (1): " << this->pointer_ << std::endl;70 68 } 71 69 72 70 inline SharedPtr(T* pointer) : pointer_(pointer), counter_(0), destroyer_(0) 73 71 { 74 // COUT(0) << "SharedPtr (2): " << this->pointer_ << std::endl;75 72 if (this->pointer_) 76 73 { … … 82 79 inline SharedPtr(const SharedPtr& other) : pointer_(other.pointer_), counter_(other.counter_), destroyer_(other.destroyer_) 83 80 { 84 // COUT(0) << "SharedPtr (3): " << this->pointer_ << std::endl;85 81 if (this->pointer_) 86 82 ++(*this->counter_); … … 90 86 inline SharedPtr(const SharedPtr<O>& other) : pointer_(other.pointer_), counter_(other.counter_), destroyer_(other.destroyer_) 91 87 { 92 // COUT(0) << "SharedPtr (4): " << this->pointer_ << std::endl;93 88 if (this->pointer_) 94 89 ++(*this->counter_); … … 97 92 inline ~SharedPtr() 98 93 { 99 // COUT(0) << "~SharedPtr: " << this->pointer_ << std::endl;100 94 if (this->pointer_) 101 95 { … … 113 107 inline const SharedPtr& operator=(const SharedPtr& other) 114 108 { 115 // COUT(0) << "SharedPtr= (1)" << std::endl;116 109 SharedPtr(other).swap(*this); 117 110 return *this; … … 121 114 inline const SharedPtr& operator=(const SharedPtr<O>& other) 122 115 { 123 // COUT(0) << "SharedPtr= (2)" << std::endl;124 116 SharedPtr(other).swap(*this); 125 117 return *this; … … 160 152 inline SharedPtr(T* pointer, int* counter, SharedPtrDestroyer* destroyer) : pointer_(pointer), counter_(counter), destroyer_(destroyer) 161 153 { 162 // COUT(0) << "SharedPtr (5): " << this->pointer_ << std::endl;163 154 if (this->pointer_) 164 155 ++(*this->counter_); … … 176 167 inline SharedChildPtr() : Parent() {} 177 168 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) {}181 169 inline SharedChildPtr(const SharedPtr<T>& other) : Parent(other) {} 182 183 // inline const SharedChildPtr& operator=(const SharedChildPtr& other) { Parent::operator=(other); return *this; }184 170 185 171 inline T* operator->() const { return static_cast<T*>(Parent::operator->()); }
Note: See TracChangeset
for help on using the changeset viewer.