MCPcopy Create free account
hub / github.com/HaxeFoundation/hxcpp / CppInt32__

Class CppInt32__

include/cpp/CppInt32__.h:17–81  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15 static inline ::Dynamic Name##_dyn() { return ::hx::CreateStaticFunction2(#Name,&CppInt32__::__##Name); }
16
17class CppInt32__
18{
19public:
20 CppInt32__(int inX=0) : mValue(inX) { }
21 CppInt32__(const null &inNull) : mValue(0) { }
22 CppInt32__(const Dynamic &inD);
23 operator int() const { return mValue; }
24 template<typename T>
25 inline CppInt32__ &operator=(T inValue) { mValue = inValue; return *this; }
26
27 static inline CppInt32__ make(int a,int b) { return CppInt32__( (a<<16) | b ); }
28 static inline CppInt32__ ofInt(int a) { return CppInt32__( a ); }
29 static inline int toInt(CppInt32__ a) { __hxcpp_check_overflow(a); return a.mValue; }
30 static inline int toNativeInt(CppInt32__ a) { return a.mValue; }
31 static inline CppInt32__ add(CppInt32__ a,CppInt32__ b) { return CppInt32__( a.mValue + b.mValue ); }
32 static inline CppInt32__ sub(CppInt32__ a,CppInt32__ b) { return CppInt32__( a.mValue - b.mValue ); }
33 static inline CppInt32__ mul(CppInt32__ a,CppInt32__ b) { return CppInt32__( a.mValue * b.mValue ); }
34 static inline CppInt32__ div(CppInt32__ a,CppInt32__ b) { return CppInt32__( a.mValue / b.mValue ); }
35 static inline CppInt32__ mod(CppInt32__ a,CppInt32__ b) { return CppInt32__( a.mValue % b.mValue ); }
36 static inline CppInt32__ shl(CppInt32__ a,int b) { return CppInt32__( a.mValue << (b&31) ); }
37 static inline CppInt32__ shr(CppInt32__ a,int b) { return CppInt32__( a.mValue >> (b&31) ); }
38 static inline CppInt32__ ushr(CppInt32__ a,int b) { return CppInt32__( ((unsigned int)a.mValue) >> (b&31) ); }
39 static inline CppInt32__ _and(CppInt32__ a,CppInt32__ b) { return CppInt32__( a.mValue & b.mValue ); }
40 static inline CppInt32__ _or(CppInt32__ a,CppInt32__ b) { return CppInt32__( a.mValue | b.mValue ); }
41 static inline CppInt32__ _xor(CppInt32__ a,CppInt32__ b) { return CppInt32__( a.mValue ^ b.mValue ); }
42 static inline CppInt32__ neg(CppInt32__ a) { return CppInt32__( -a.mValue ); }
43 static inline CppInt32__ complement(CppInt32__ a) { return CppInt32__( ~a.mValue ); }
44 static inline int compare(CppInt32__ a,CppInt32__ b) { return ( a.mValue - b.mValue ); }
45 static inline bool isNeg(CppInt32__ a) { return a.mValue < 0; }
46 static inline bool isZero(CppInt32__ a) { return a.mValue == 0; }
47 static inline int ucompare(CppInt32__ a,CppInt32__ b) { unsigned int am = a.mValue, bm = b.mValue; return (am == bm) ? 0 : ((am > bm) ? 1 : -1); }
48
49
50 inline bool operator==(const CppInt32__ &inRHS) const { return mValue == inRHS.mValue; }
51
52 inline int operator-(CppInt32__ b) { return mValue - b.mValue; }
53 inline int operator+(CppInt32__ b) { return mValue + b.mValue; }
54 inline int operator*(CppInt32__ b) { return mValue * b.mValue; }
55 inline int operator/(CppInt32__ b) { return mValue / b.mValue; }
56 inline int operator%(CppInt32__ b) { return mValue % b.mValue; }
57
58 HX_I32_DEF_FUNC2(make)
59 HX_I32_DEF_FUNC1(ofInt)
60 HX_I32_DEF_FUNC1(toInt)
61 HX_I32_DEF_FUNC1(toNativeInt)
62 HX_I32_DEF_FUNC2(add)
63 HX_I32_DEF_FUNC2(sub)
64 HX_I32_DEF_FUNC2(mul)
65 HX_I32_DEF_FUNC2(div)
66 HX_I32_DEF_FUNC2(mod)
67 HX_I32_DEF_FUNC2(shl)
68 HX_I32_DEF_FUNC2(shr)
69 HX_I32_DEF_FUNC2(ushr)
70 HX_I32_DEF_FUNC2(_and)
71 HX_I32_DEF_FUNC2(_or)
72 HX_I32_DEF_FUNC2(_xor)
73 HX_I32_DEF_FUNC1(neg)
74 HX_I32_DEF_FUNC1(complement)

Callers 15

makeMethod · 0.70
ofIntMethod · 0.70
addMethod · 0.70
subMethod · 0.70
mulMethod · 0.70
divMethod · 0.70
modMethod · 0.70
shlMethod · 0.70
shrMethod · 0.70
ushrMethod · 0.70
_andMethod · 0.70
_orMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected