1 // Concrete class of double float numbers.
3 #ifndef _CL_DFLOAT_CLASS_H
4 #define _CL_DFLOAT_CLASS_H
7 #include "cl_float_class.h"
10 class cl_DF : public cl_F {
12 // Default constructor.
14 // Assignment operators.
15 cl_DF& operator= (const cl_DF&);
16 // Optimization of method pointer_p().
17 cl_boolean pointer_p() const
19 // Faster pointer_p() gives a faster copy constructor (but not destructor!!!).
20 cl_DF (const cl_DF& x);
21 // Constructors and assignment operators from C numeric types.
23 cl_DF& operator= (const double);
24 // Other constructors.
26 // Private constructor.
27 cl_DF (cl_private_thing);
28 cl_DF (struct cl_heap_dfloat *);
29 // Private pointer manipulations.
30 operator struct cl_heap_dfloat * () const;
31 public: // Ability to place an object at a given address.
32 void* operator new (size_t size) { return cl_malloc_hook(size); }
33 void* operator new (size_t size, cl_DF* ptr) { (void)size; return ptr; }
34 void operator delete (void* ptr) { cl_free_hook(ptr); }
36 // Friend declarations. They are for the compiler. Just ignore them.
39 // Private constructors.
40 inline cl_DF::cl_DF (cl_private_thing ptr) : cl_F (ptr) {}
41 // The assignment operators:
42 CL_DEFINE_ASSIGNMENT_OPERATOR(cl_DF, cl_DF)
43 // The default constructors.
44 // Private pointer manipulations. Never throw away a `struct cl_heap_dfloat *'!
45 inline cl_DF::operator struct cl_heap_dfloat * () const
47 struct cl_heap_dfloat * hpointer = (struct cl_heap_dfloat *) pointer;
48 cl_inc_refcount(*this);
51 extern const cl_DF cl_DF_0;
52 inline cl_DF::cl_DF ()
53 : cl_F ((cl_private_thing) (struct cl_heap_dfloat *) cl_DF_0) {}
54 CL_REQUIRE(cl_DF_globals)
56 inline cl_DF::cl_DF (struct cl_heap_dfloat * ptr)
57 : cl_F ((cl_private_thing) ptr) {}
59 // The copy constructors.
60 CL_DEFINE_COPY_CONSTRUCTOR2(cl_DF,cl_F)
61 // Constructors and assignment operators from C numeric types.
62 CL_DEFINE_DOUBLE_CONSTRUCTOR(cl_DF)
65 #endif /* _CL_DFLOAT_CLASS_H */