]> www.ginac.de Git - cln.git/blob - include/cln/sfloat_class.h
Replace CL_REQUIRE/CL_PROVIDE(cl_I_ring) with portable code.
[cln.git] / include / cln / 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 "cln/number.h"
7 #include "cln/float_class.h"
8
9 namespace cln {
10
11 class cl_SF : public cl_F {
12 public:
13 // Default constructor.
14         cl_SF ();
15 // Assignment operators.
16         cl_SF& operator= (const cl_SF&);
17 // Optimization of method pointer_p().
18         bool pointer_p() const
19                 { return false; }
20 // Faster pointer_p() gives a faster copy constructor (but not destructor!!!).
21         cl_SF (const cl_SF& x);
22 // Other constructors.
23         cl_SF (const char *);
24 // Private constructor.
25         cl_SF (cl_private_thing);
26         cl_SF (struct cl_sfloat * /* NULL! */, cl_uint);
27 public: // Ability to place an object at a given address.
28         void* operator new (size_t size) { return malloc_hook(size); }
29         void* operator new (size_t size, void* ptr) { (void)size; return ptr; }
30         void operator delete (void* ptr) { free_hook(ptr); }
31 };
32
33 // Private constructors.
34 inline cl_SF::cl_SF (cl_private_thing ptr) : cl_F (ptr) {}
35 // The assignment operators:
36 CL_DEFINE_ASSIGNMENT_OPERATOR(cl_SF, cl_SF)
37 // The default constructors.
38 inline cl_SF::cl_SF ()
39         : cl_F ((cl_private_thing) cl_combine(cl_SF_tag,0)) {}
40 // The copy constructors.
41 CL_DEFINE_COPY_CONSTRUCTOR2(cl_SF,cl_F)
42
43 }  // namespace cln
44
45 #endif /* _CL_SFLOAT_CLASS_H */