- Timestamp:
- Aug 21, 2010, 4:54:29 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/consolecommands3/src/libraries/core/Functor.h
r7192 r7196 38 38 #include "util/Debug.h" 39 39 #include "util/MultiType.h" 40 #include " SharedPtr.h"40 #include "FunctorPtr.h" 41 41 42 42 namespace orxonox … … 104 104 105 105 public: 106 Functor() : references_(0){ ++instances_s; COUT(0) << "functor ++: " << instances_s << std::endl; }106 Functor() { ++instances_s; COUT(0) << "functor ++: " << instances_s << std::endl; } 107 107 virtual ~Functor() { --instances_s; COUT(0) << "functor --: " << instances_s << std::endl; } 108 108 … … 124 124 125 125 private: 126 inline void incrementReferenceCount()127 { ++this->references_; }128 inline void decrementReferenceCount()129 { --this->references_; if (this->references_ == 0) delete this; }130 131 int references_;132 126 static int instances_s; 133 127 }; … … 212 206 T* object_; 213 207 const T* constObject_; 214 };215 216 217 218 typedef SharedPtr<Functor> FunctorPtr;219 220 typedef SharedChildPtr<FunctorStatic, Functor> FunctorStaticPtr;221 222 template <class T>223 class FunctorMemberPtr : public SharedChildPtr<FunctorMember<T>, Functor>224 {225 public:226 inline FunctorMemberPtr() : SharedChildPtr<FunctorMember<T>, Functor>() {}227 inline FunctorMemberPtr(FunctorMember<T>* pointer) : SharedChildPtr<FunctorMember<T>, Functor>(pointer) {}228 // inline FunctorMemberPtr(const FunctorMemberPtr& other) : SharedChildPtr<FunctorMember<T>, Functor>(other) {}229 208 }; 230 209
Note: See TracChangeset
for help on using the changeset viewer.