Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Concrete class of single float numbers.
0002 
0003 #ifndef _CL_FFLOAT_CLASS_H
0004 #define _CL_FFLOAT_CLASS_H
0005 
0006 #include "cln/number.h"
0007 #include "cln/float_class.h"
0008 
0009 namespace cln {
0010 
0011 class cl_FF : public cl_F {
0012 public:
0013 // Default constructor.
0014     cl_FF ();
0015 // Assignment operators.
0016     cl_FF& operator= (const cl_FF&);
0017 // Optimization of method pointer_p().
0018     bool pointer_p() const
0019 #if defined(CL_WIDE_POINTERS)
0020         { return false; }
0021 #else
0022         { return true; }
0023 #endif
0024 // Faster pointer_p() gives a faster copy constructor (but not destructor!!!).
0025     cl_FF (const cl_FF& x);
0026 // Constructors and assignment operators from C numeric types.
0027     cl_FF (const float);
0028     cl_FF& operator= (const float);
0029 // Other constructors.
0030     cl_FF (const char *);
0031 // Private constructor.
0032     cl_FF (cl_private_thing);
0033 #if defined(CL_WIDE_POINTERS)
0034     cl_FF (struct cl_heap_ffloat * /* NULL! */, cl_uint);
0035 #else
0036     cl_FF (struct cl_heap_ffloat *);
0037 // Private pointer manipulations.
0038     operator struct cl_heap_ffloat * () const;
0039 #endif
0040 public: // Ability to place an object at a given address.
0041     void* operator new (size_t size) { return malloc_hook(size); }
0042     void* operator new (size_t size, void* ptr) { (void)size; return ptr; }
0043     void operator delete (void* ptr) { free_hook(ptr); }
0044 };
0045 
0046 // Private constructors.
0047 inline cl_FF::cl_FF (cl_private_thing ptr) : cl_F (ptr) {}
0048 // The assignment operators:
0049 CL_DEFINE_ASSIGNMENT_OPERATOR(cl_FF, cl_FF)
0050 // The default constructors.
0051 #if defined(CL_WIDE_POINTERS)
0052 inline cl_FF::cl_FF ()
0053     : cl_F ((cl_private_thing) cl_combine(cl_FF_tag,0)) {}
0054 #else
0055 // Private pointer manipulations. Never throw away a `struct cl_heap_ffloat *'!
0056 inline cl_FF::operator struct cl_heap_ffloat * () const
0057 {
0058     struct cl_heap_ffloat * hpointer = (struct cl_heap_ffloat *) pointer;
0059     cl_inc_refcount(*this);
0060     return hpointer;
0061 }
0062 extern const cl_FF cl_FF_0;
0063 inline cl_FF::cl_FF ()
0064     : cl_F ((cl_private_thing) (struct cl_heap_ffloat *) cl_FF_0) {}
0065 class cl_FF_globals_init_helper
0066 {
0067     static int count;
0068 public:
0069     cl_FF_globals_init_helper();
0070     ~cl_FF_globals_init_helper();
0071 };
0072 static cl_FF_globals_init_helper cl_FF_globals_init_helper_instance;
0073 #if 0 // see cl_FF.h
0074 inline cl_FF::cl_FF (struct cl_heap_ffloat * ptr)
0075     : cl_F ((cl_private_thing) ptr) {}
0076 #endif
0077 #endif
0078 // The copy constructors.
0079 CL_DEFINE_COPY_CONSTRUCTOR2(cl_FF,cl_F)
0080 // Constructors and assignment operators from C numeric types.
0081 CL_DEFINE_FLOAT_CONSTRUCTOR(cl_FF)
0082 
0083 }  // namespace cln
0084 
0085 #endif /* _CL_FFLOAT_CLASS_H */