You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
1.2 KiB

25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
  1. // Concrete class of short float numbers.
  2. #ifndef _CL_SFLOAT_CLASS_H
  3. #define _CL_SFLOAT_CLASS_H
  4. #include "cln/number.h"
  5. #include "cln/float_class.h"
  6. namespace cln {
  7. class cl_SF : public cl_F {
  8. public:
  9. // Default constructor.
  10. cl_SF ();
  11. // Assignment operators.
  12. cl_SF& operator= (const cl_SF&);
  13. // Optimization of method pointer_p().
  14. bool pointer_p() const
  15. { return false; }
  16. // Faster pointer_p() gives a faster copy constructor (but not destructor!!!).
  17. cl_SF (const cl_SF& x);
  18. // Other constructors.
  19. cl_SF (const char *);
  20. // Private constructor.
  21. cl_SF (cl_private_thing);
  22. cl_SF (struct cl_sfloat * /* NULL! */, cl_uint);
  23. public: // Ability to place an object at a given address.
  24. void* operator new (size_t size) { return malloc_hook(size); }
  25. void* operator new (size_t size, void* ptr) { (void)size; return ptr; }
  26. void operator delete (void* ptr) { free_hook(ptr); }
  27. };
  28. // Private constructors.
  29. inline cl_SF::cl_SF (cl_private_thing ptr) : cl_F (ptr) {}
  30. // The assignment operators:
  31. CL_DEFINE_ASSIGNMENT_OPERATOR(cl_SF, cl_SF)
  32. // The default constructors.
  33. inline cl_SF::cl_SF ()
  34. : cl_F ((cl_private_thing) cl_combine(cl_SF_tag,0)) {}
  35. // The copy constructors.
  36. CL_DEFINE_COPY_CONSTRUCTOR2(cl_SF,cl_F)
  37. } // namespace cln
  38. #endif /* _CL_SFLOAT_CLASS_H */