1 | #ifndef __rf_integer_hh__ |
---|
2 | #define __rf_integer_hh__ |
---|
3 | |
---|
4 | #include "rf_types.hh" |
---|
5 | #include "rf_expr.hh" |
---|
6 | #include "rf_term.hh" |
---|
7 | #include "pxx_string.hh" |
---|
8 | #include <gmp.h> |
---|
9 | #include <wchar.h> |
---|
10 | |
---|
11 | namespace rftype |
---|
12 | { |
---|
13 | |
---|
14 | using namespace rfrt; |
---|
15 | |
---|
16 | class Integer : |
---|
17 | public Term |
---|
18 | { |
---|
19 | |
---|
20 | public: |
---|
21 | |
---|
22 | inline Integer (intptr_t _n) ; |
---|
23 | inline Integer (Integer const& _n) ; |
---|
24 | inline Integer (char const* _str) ; |
---|
25 | inline Integer (wchar_t const* _str) ; |
---|
26 | inline Integer (pxx::WString& _str) ; |
---|
27 | inline ~Integer () ; |
---|
28 | inline Integer& operator = (Integer const& _n) ; |
---|
29 | |
---|
30 | inline bool operator == (Integer const& _n) const ; |
---|
31 | inline int cmp (Integer const& _n) const ; |
---|
32 | |
---|
33 | inline Integer operator + (Integer const& _n) const ; |
---|
34 | inline Integer operator + (intptr_t _n) const ; |
---|
35 | friend inline Integer operator + (intptr_t _n1, Integer const& _n2) ; |
---|
36 | inline Integer operator - (Integer const& _n) const ; |
---|
37 | inline Integer operator - (intptr_t _n) const ; |
---|
38 | friend inline Integer operator - (intptr_t _n1, Integer const& _n2) ; |
---|
39 | inline Integer operator * (Integer const& _n) const ; |
---|
40 | inline Integer operator * (intptr_t _n) const ; |
---|
41 | friend inline Integer operator * (intptr_t _n1, Integer const& _n2) ; |
---|
42 | inline Integer operator / (Integer const& _n) const ; |
---|
43 | inline Integer operator / (intptr_t _n) const ; |
---|
44 | friend inline Integer operator / (intptr_t _n1, Integer const& _n2) ; |
---|
45 | inline Integer operator % (Integer const& _n) const ; |
---|
46 | inline Integer operator % (intptr_t _n) const ; |
---|
47 | friend inline Integer operator % (intptr_t _n1, Integer const& _n2) ; |
---|
48 | inline Integer div_rem (Integer const& _n, Integer* _remp) const ; |
---|
49 | inline Integer div_rem (intptr_t _n, Integer* _remp) const ; |
---|
50 | friend inline Integer div_rem ( |
---|
51 | intptr_t _n1, Integer const& _n2, Integer* _remp) ; |
---|
52 | inline Integer operator - () const ; |
---|
53 | inline int sign () const ; |
---|
54 | |
---|
55 | inline operator pxx::WString () const ; |
---|
56 | |
---|
57 | static inline Expr create_expr (intptr_t _n) ; |
---|
58 | static inline Expr create_expr (char const* _str) ; |
---|
59 | static inline Expr create_expr (wchar_t const* _str) ; |
---|
60 | static inline Expr create_expr (pxx::WString& _str) ; |
---|
61 | static inline Expr create_expr (Integer const& _n) ; |
---|
62 | inline mpz_t* get_mpz_ptr () const ; |
---|
63 | |
---|
64 | inline size_t get_char_len () const ; |
---|
65 | |
---|
66 | static void ctor (Integer* _to, Integer const* _from) ; |
---|
67 | static void dtor (Integer* _n) ; |
---|
68 | static bool eq (Integer const* _n1, Integer const* _n2) ; |
---|
69 | static int compare (Integer const* _n1, Integer const* _n2) ; |
---|
70 | static uint32_t hash (Integer const* _shint) ; |
---|
71 | static pxx::WString to_string (Integer const* _shint) ; |
---|
72 | static short_type_funcs_t funcs ; |
---|
73 | static TypeRegister reg ; |
---|
74 | |
---|
75 | }; |
---|
76 | |
---|
77 | } |
---|
78 | |
---|
79 | #endif // __rf_integer_hh__ |
---|