]> www.ginac.de Git - cln.git/blob - include/cl_sfloat_class.h
ffa2281ac678057f473bd46e42a5016465dc9b0a
[cln.git] / include / cl_sfloat_class.h
1 // Concrete class of short float numbers.
2
3 #ifndef _CL_SFLOAT_CLASS_H
4 #define _CL_SFLOAT_CLASS_H
5
6 #include "cl_number.h"
7 #include "cl_float_class.h"
8
9
10 class cl_SF : public cl_F {
11 public:
12 // Default constructor.
13         cl_SF ();
14 // Assignment operators.
15         cl_SF& operator= (const cl_SF&);
16 // Optimization of method pointer_p().
17         cl_boolean pointer_p() const
18                 { return cl_false; }
19 // Faster pointer_p() gives a faster copy constructor (but not destructor!!!).
20         cl_SF (const cl_SF& x);
21 // Other constructors.
22         cl_SF (const char *);
23 // Private constructor.
24         cl_SF (cl_private_thing);
25         cl_SF (struct cl_sfloat * /* NULL! */, cl_uint);
26 public: // Ability to place an object at a given address.
27         void* operator new (size_t size) { return cl_malloc_hook(size); }
28         void* operator new (size_t size, cl_SF* ptr) { (void)size; return ptr; }
29         void operator delete (void* ptr) { cl_free_hook(ptr); }
30 };
31
32 // Private constructors.
33 inline cl_SF::cl_SF (cl_private_thing ptr) : cl_F (ptr) {}
34 // The assignment operators:
35 CL_DEFINE_ASSIGNMENT_OPERATOR(cl_SF, cl_SF)
36 // The default constructors.
37 inline cl_SF::cl_SF ()
38         : cl_F ((cl_private_thing) cl_combine(cl_SF_tag,0)) {}
39 // The copy constructors.
40 CL_DEFINE_COPY_CONSTRUCTOR2(cl_SF,cl_F)
41
42
43 #endif /* _CL_SFLOAT_CLASS_H */