1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- #ifndef __CCINTEGER_H__
- #define __CCINTEGER_H__
- #include "base/CCRef.h"
- #include "base/CCConsole.h"
- #include "base/CCDataVisitor.h"
- #include "platform/CCCommon.h"
- NS_CC_BEGIN
- class CC_DLL __Integer : public Ref, public Clonable
- {
- public:
- static __Integer* create(int v)
- {
- __Integer* pRet = new (std::nothrow) __Integer(v);
- pRet->autorelease();
- return pRet;
- }
-
- __Integer(int v)
- : _value(v) {}
- int getValue() const {return _value;}
-
- virtual ~__Integer() {
- CCLOGINFO("deallocing ~__Integer: %p", this);
- }
-
- virtual void acceptVisitor(DataVisitor &visitor) { visitor.visit(this); }
-
- virtual __Integer* clone() const override
- {
- return __Integer::create(_value);
- }
-
- private:
- int _value;
- };
- NS_CC_END
- #endif
|