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.

43 lines
1.2 KiB

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