2012-04-19 14:35:52 +08:00
|
|
|
#ifndef __CCINTEGER_H__
|
|
|
|
#define __CCINTEGER_H__
|
|
|
|
|
|
|
|
#include "CCObject.h"
|
|
|
|
|
|
|
|
NS_CC_BEGIN
|
|
|
|
|
2012-06-20 18:09:11 +08:00
|
|
|
/**
|
|
|
|
* @addtogroup data_structures
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
class CC_DLL CCInteger : public CCObject
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CCInteger(int v)
|
2013-06-15 14:03:30 +08:00
|
|
|
: _value(v) {}
|
|
|
|
int getValue() const {return _value;}
|
2012-04-20 15:23:00 +08:00
|
|
|
|
2012-06-14 16:05:58 +08:00
|
|
|
static CCInteger* create(int v)
|
2012-04-20 15:23:00 +08:00
|
|
|
{
|
|
|
|
CCInteger* pRet = new CCInteger(v);
|
|
|
|
pRet->autorelease();
|
|
|
|
return pRet;
|
|
|
|
}
|
2013-05-23 04:00:34 +08:00
|
|
|
|
|
|
|
/* override functions */
|
|
|
|
virtual void acceptVisitor(CCDataVisitor &visitor) { visitor.visit(this); }
|
|
|
|
|
2012-04-20 15:23:00 +08:00
|
|
|
private:
|
2013-06-15 14:03:30 +08:00
|
|
|
int _value;
|
2012-04-19 14:35:52 +08:00
|
|
|
};
|
|
|
|
|
2012-06-20 18:09:11 +08:00
|
|
|
// end of data_structure group
|
|
|
|
/// @}
|
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
NS_CC_END
|
|
|
|
|
|
|
|
#endif /* __CCINTEGER_H__ */
|