1 // Concrete class of single float numbers.
3 #ifndef _CL_FFLOAT_CLASS_H
4 #define _CL_FFLOAT_CLASS_H
7 #include "cl_float_class.h"
10 class cl_FF : public cl_F {
12 // Default constructor.
14 // Assignment operators.
15 cl_FF& operator= (const cl_FF&);
16 // Optimization of method pointer_p().
17 cl_boolean pointer_p() const
18 #if defined(CL_WIDE_POINTERS)
23 // Faster pointer_p() gives a faster copy constructor (but not destructor!!!).
24 cl_FF (const cl_FF& x);
25 // Constructors and assignment operators from C numeric types.
27 cl_FF& operator= (const float);
28 // Other constructors.
30 // Private constructor.
31 cl_FF (cl_private_thing);
32 #if defined(CL_WIDE_POINTERS)
33 cl_FF (struct cl_heap_ffloat * /* NULL! */, cl_uint);
35 cl_FF (struct cl_heap_ffloat *);
36 // Private pointer manipulations.
37 operator struct cl_heap_ffloat * () const;
39 public: // Ability to place an object at a given address.
40 void* operator new (size_t size) { return cl_malloc_hook(size); }
41 void* operator new (size_t size, cl_FF* ptr) { (void)size; return ptr; }
42 void operator delete (void* ptr) { cl_free_hook(ptr); }
45 // Private constructors.
46 inline cl_FF::cl_FF (cl_private_thing ptr) : cl_F (ptr) {}
47 // The assignment operators:
48 CL_DEFINE_ASSIGNMENT_OPERATOR(cl_FF, cl_FF)
49 // The default constructors.
50 #if defined(CL_WIDE_POINTERS)
51 inline cl_FF::cl_FF ()
52 : cl_F ((cl_private_thing) cl_combine(cl_FF_tag,0)) {}
54 // Private pointer manipulations. Never throw away a `struct cl_heap_ffloat *'!
55 inline cl_FF::operator struct cl_heap_ffloat * () const
57 struct cl_heap_ffloat * hpointer = (struct cl_heap_ffloat *) pointer;
58 cl_inc_refcount(*this);
61 extern const cl_FF cl_FF_0;
62 inline cl_FF::cl_FF ()
63 : cl_F ((cl_private_thing) (struct cl_heap_ffloat *) cl_FF_0) {}
64 CL_REQUIRE(cl_FF_globals)
66 inline cl_FF::cl_FF (struct cl_heap_ffloat * ptr)
67 : cl_F ((cl_private_thing) ptr) {}
70 // The copy constructors.
71 CL_DEFINE_COPY_CONSTRUCTOR2(cl_FF,cl_F)
72 // Constructors and assignment operators from C numeric types.
73 CL_DEFINE_FLOAT_CONSTRUCTOR(cl_FF)
76 #endif /* _CL_FFLOAT_CLASS_H */