1 // Simple vectors of ring elements.
3 #ifndef _CL_SV_RINGELT_H
4 #define _CL_SV_RINGELT_H
12 typedef cl_heap_SV<_cl_ring_element> cl_heap_SV_ringelt;
14 struct cl_SV_ringelt : public cl_SV<_cl_ring_element,cl_SV_any> {
18 cl_SV_ringelt (const cl_SV_ringelt&);
19 explicit cl_SV_ringelt (std::size_t len);
20 // Assignment operators.
21 cl_SV_ringelt& operator= (const cl_SV_ringelt&);
22 // Private pointer manipulations.
23 operator cl_heap_SV_ringelt* () const;
24 cl_SV_ringelt (cl_heap_SV_ringelt* p) : cl_SV<_cl_ring_element,cl_SV_any> (p) {}
25 cl_SV_ringelt (cl_private_thing p) : cl_SV<_cl_ring_element,cl_SV_any> (p) {}
27 inline cl_SV_ringelt::cl_SV_ringelt (const cl_SV_ringelt& x) : cl_SV<_cl_ring_element,cl_SV_any> (as_cl_private_thing(x)) {}
28 CL_DEFINE_ASSIGNMENT_OPERATOR(cl_SV_ringelt,cl_SV_ringelt)
29 // Returns a new simple vector with uninitialized contents.
30 extern cl_heap_SV_ringelt* cl_make_heap_SV_ringelt_uninit (std::size_t len);
31 // Returns a new simple vector with all elements initialized to some value.
32 extern cl_heap_SV_ringelt* cl_make_heap_SV_ringelt (std::size_t len);
33 inline cl_SV_ringelt::cl_SV_ringelt (std::size_t len)
34 : cl_SV<_cl_ring_element,cl_SV_any> (cl_make_heap_SV_ringelt(len)) {}
36 // Private pointer manipulations.
37 // Never throw away a `struct cl_heap_SV_ringelt *'!
38 inline cl_SV_ringelt::operator cl_heap_SV_ringelt* () const
40 cl_heap_SV_ringelt* hpointer = (cl_heap_SV_ringelt*)pointer;
41 cl_inc_refcount(*this);
44 extern const cl_SV_ringelt cl_null_SV_ringelt;
45 inline cl_SV_ringelt::cl_SV_ringelt ()
46 : cl_SV<_cl_ring_element,cl_SV_any> ((cl_heap_SV_ringelt*) cl_null_SV_ringelt) {}
48 class cl_SV_ringelt_init_helper
52 cl_SV_ringelt_init_helper();
53 ~cl_SV_ringelt_init_helper();
55 static cl_SV_ringelt_init_helper cl_SV_ringelt_init_helper_instance;
57 // Copy a simple vector.
58 inline const cl_SV_ringelt copy (const cl_SV_ringelt& vector)
59 { return The(cl_SV_ringelt) (copy((const cl_SV_any&) vector)); }
62 extern void fprint (std::ostream& stream, const cl_ring& R, const cl_SV_ringelt& x);
66 extern int cl_SV_ringelt_debug_module;
67 CL_FORCE_LINK(cl_SV_ringelt_debug_dummy, cl_SV_ringelt_debug_module)
72 #endif /* _CL_SV_RINGELT_H */