Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-19 08:08:31

0001 // Abstract class of integers.
0002 
0003 #ifndef _CL_INTEGER_CLASS_H
0004 #define _CL_INTEGER_CLASS_H
0005 
0006 #include "cln/number.h"
0007 #include "cln/rational_class.h"
0008 
0009 namespace cln {
0010 
0011 class cl_I : public cl_RA {
0012 public:
0013 // Default constructor.
0014     cl_I ();
0015 // Copy constructor.
0016     cl_I (const cl_I&);
0017 // Assignment operators.
0018     cl_I& operator= (const cl_I&);
0019 // Constructors and assignment operators from C numeric types.
0020     cl_I (const int);       // |argument| must be < 2^29
0021     cl_I (const unsigned int);  // argument must be < 2^29
0022     cl_I (const long);
0023     cl_I (const unsigned long);
0024     cl_I (const long long);
0025     cl_I (const unsigned long long);
0026     cl_I& operator= (const int);        // |argument| must be < 2^29
0027     cl_I& operator= (const unsigned int);   // argument must be < 2^29
0028     cl_I& operator= (const long);
0029     cl_I& operator= (const unsigned long);
0030     cl_I& operator= (const long long);
0031     cl_I& operator= (const unsigned long long);
0032 // Other constructors.
0033     cl_I (const char *);
0034 // Private constructor.
0035     cl_I (cl_private_thing);
0036     cl_I (struct cl_fixnum * /* NULL! */, cl_uint);
0037     cl_I (struct cl_heap_bignum *);
0038 public: // Ability to place an object at a given address.
0039     void* operator new (size_t size) { return malloc_hook(size); }
0040     void* operator new (size_t size, void* ptr) { (void)size; return ptr; }
0041     void operator delete (void* ptr) { free_hook(ptr); }
0042 };
0043 
0044 // Private constructors.
0045 inline cl_I::cl_I (cl_private_thing ptr) : cl_RA (ptr) {}
0046 // The assignment operators:
0047 CL_DEFINE_ASSIGNMENT_OPERATOR(cl_I, cl_I)
0048 // The default constructors.
0049 inline cl_I::cl_I ()
0050     : cl_RA ((cl_private_thing) cl_combine(cl_FN_tag,0)) {}
0051 // The copy constructors.
0052 CL_DEFINE_COPY_CONSTRUCTOR2(cl_I,cl_RA)
0053 // Constructors and assignment operators from C numeric types.
0054 CL_DEFINE_INT_CONSTRUCTORS(cl_I)
0055 CL_DEFINE_INT_ASSIGNMENT_OPERATORS(cl_I)
0056 CL_DEFINE_LONG_CONSTRUCTORS(cl_I)
0057 CL_DEFINE_LONG_ASSIGNMENT_OPERATORS(cl_I)
0058 CL_DEFINE_LONGLONG_CONSTRUCTORS(cl_I)
0059 CL_DEFINE_LONGLONG_ASSIGNMENT_OPERATORS(cl_I)
0060 
0061 }  // namespace cln
0062 
0063 #endif /* _CL_INTEGER_CLASS_H */