Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Concrete class of double float numbers.
0002 
0003 #ifndef _CL_DFLOAT_CLASS_H
0004 #define _CL_DFLOAT_CLASS_H
0005 
0006 #include "cln/number.h"
0007 #include "cln/float_class.h"
0008 
0009 namespace cln {
0010 
0011 class cl_DF : public cl_F {
0012 public:
0013 // Default constructor.
0014     cl_DF ();
0015 // Assignment operators.
0016     cl_DF& operator= (const cl_DF&);
0017 // Optimization of method pointer_p().
0018     bool pointer_p() const
0019         { return true; }
0020 // Faster pointer_p() gives a faster copy constructor (but not destructor!!!).
0021     cl_DF (const cl_DF& x);
0022 // Constructors and assignment operators from C numeric types.
0023     cl_DF (const double);
0024     cl_DF& operator= (const double);
0025 // Other constructors.
0026     cl_DF (const char *);
0027 // Private constructor.
0028     cl_DF (cl_private_thing);
0029     cl_DF (struct cl_heap_dfloat *);
0030 // Private pointer manipulations.
0031     operator struct cl_heap_dfloat * () const;
0032 public: // Ability to place an object at a given address.
0033     void* operator new (size_t size) { return malloc_hook(size); }
0034     void* operator new (size_t size, void* ptr) { (void)size; return ptr; }
0035     void operator delete (void* ptr) { free_hook(ptr); }
0036 private:
0037 // Friend declarations. They are for the compiler. Just ignore them.
0038 };
0039 
0040 // Private constructors.
0041 inline cl_DF::cl_DF (cl_private_thing ptr) : cl_F (ptr) {}
0042 // The assignment operators:
0043 CL_DEFINE_ASSIGNMENT_OPERATOR(cl_DF, cl_DF)
0044 // The default constructors.
0045 // Private pointer manipulations. Never throw away a `struct cl_heap_dfloat *'!
0046 inline cl_DF::operator struct cl_heap_dfloat * () const
0047 {
0048     struct cl_heap_dfloat * hpointer = (struct cl_heap_dfloat *) pointer;
0049     cl_inc_refcount(*this);
0050     return hpointer;
0051 }
0052 extern const cl_DF cl_DF_0;
0053 inline cl_DF::cl_DF ()
0054     : cl_F ((cl_private_thing) (struct cl_heap_dfloat *) cl_DF_0) {}
0055 class cl_DF_globals_init_helper
0056 {
0057     static int count;
0058 public:
0059     cl_DF_globals_init_helper();
0060     ~cl_DF_globals_init_helper();
0061 };
0062 static cl_DF_globals_init_helper cl_DF_globals_init_helper_instance;
0063 
0064 #if 0 // see cl_DF.h
0065 inline cl_DF::cl_DF (struct cl_heap_dfloat * ptr)
0066     : cl_F ((cl_private_thing) ptr) {}
0067 #endif
0068 // The copy constructors.
0069 CL_DEFINE_COPY_CONSTRUCTOR2(cl_DF,cl_F)
0070 // Constructors and assignment operators from C numeric types.
0071 CL_DEFINE_DOUBLE_CONSTRUCTOR(cl_DF)
0072 
0073 }  // namespace cln
0074 
0075 #endif /* _CL_DFLOAT_CLASS_H */