55 lines
1.6 KiB

25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
  1. // General vectors of numbers.
  2. #ifndef _CL_GV_NUMBER_H
  3. #define _CL_GV_NUMBER_H
  4. #include "cln/number.h"
  5. #include "cln/GV.h"
  6. namespace cln {
  7. typedef cl_heap_GV<cl_number> cl_heap_GV_number;
  8. struct cl_GV_number : public cl_GV<cl_number,cl_GV_any> {
  9. public:
  10. // Constructors.
  11. cl_GV_number ();
  12. cl_GV_number (const cl_GV_number&);
  13. explicit cl_GV_number (std::size_t len);
  14. // Assignment operators.
  15. cl_GV_number& operator= (const cl_GV_number&);
  16. // Private pointer manipulations.
  17. cl_GV_number (cl_heap_GV_number* p) : cl_GV<cl_number,cl_GV_any> (p) {}
  18. cl_GV_number (cl_private_thing p) : cl_GV<cl_number,cl_GV_any> (p) {}
  19. };
  20. inline cl_GV_number::cl_GV_number (const cl_GV_number& x) : cl_GV<cl_number,cl_GV_any> (as_cl_private_thing(x)) {}
  21. CL_DEFINE_ASSIGNMENT_OPERATOR(cl_GV_number,cl_GV_number)
  22. extern cl_heap_GV_number* cl_make_heap_GV_number (std::size_t len);
  23. inline cl_GV_number::cl_GV_number (std::size_t len)
  24. : cl_GV<cl_number,cl_GV_any> (cl_make_heap_GV_number(len)) {}
  25. // Private pointer manipulations. Never throw away a `struct cl_heap_GV_number *'!
  26. extern const cl_GV_number cl_null_GV_number;
  27. inline cl_GV_number::cl_GV_number ()
  28. : cl_GV<cl_number,cl_GV_any> ((cl_heap_GV_number*) cl_null_GV_number) {}
  29. class cl_GV_number_init_helper
  30. {
  31. static int count;
  32. public:
  33. cl_GV_number_init_helper();
  34. ~cl_GV_number_init_helper();
  35. };
  36. static cl_GV_number_init_helper cl_GV_number_init_helper_instance;
  37. // Copy a vector.
  38. extern const cl_GV_number copy (const cl_GV_number&);
  39. // Debugging support.
  40. #ifdef CL_DEBUG
  41. extern int cl_GV_number_debug_module;
  42. CL_FORCE_LINK(cl_GV_number_debug_dummy, cl_GV_number_debug_module)
  43. #endif
  44. } // namespace cln
  45. #endif /* _CL_GV_NUMBER_H */