Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-19 08:08:33

0001 // Simple vectors of ring elements.
0002 
0003 #ifndef _CL_SV_RINGELT_H
0004 #define _CL_SV_RINGELT_H
0005 
0006 #include "cln/ring.h"
0007 #include "cln/SV.h"
0008 #include "cln/io.h"
0009 
0010 namespace cln {
0011 
0012 typedef cl_heap_SV<_cl_ring_element> cl_heap_SV_ringelt;
0013 
0014 struct cl_SV_ringelt : public cl_SV<_cl_ring_element,cl_SV_any> {
0015 public:
0016     // Constructors.
0017     cl_SV_ringelt ();
0018     cl_SV_ringelt (const cl_SV_ringelt&);
0019     explicit cl_SV_ringelt (std::size_t len);
0020     // Assignment operators.
0021     cl_SV_ringelt& operator= (const cl_SV_ringelt&);
0022     // Private pointer manipulations.
0023     operator cl_heap_SV_ringelt* () const;
0024     cl_SV_ringelt (cl_heap_SV_ringelt* p) : cl_SV<_cl_ring_element,cl_SV_any> (p) {}
0025     cl_SV_ringelt (cl_private_thing p) : cl_SV<_cl_ring_element,cl_SV_any> (p) {}
0026 };
0027 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)) {}
0028 CL_DEFINE_ASSIGNMENT_OPERATOR(cl_SV_ringelt,cl_SV_ringelt)
0029 // Returns a new simple vector with uninitialized contents.
0030 extern cl_heap_SV_ringelt* cl_make_heap_SV_ringelt_uninit (std::size_t len);
0031 // Returns a new simple vector with all elements initialized to some value.
0032 extern cl_heap_SV_ringelt* cl_make_heap_SV_ringelt (std::size_t len);
0033 inline cl_SV_ringelt::cl_SV_ringelt (std::size_t len)
0034     : cl_SV<_cl_ring_element,cl_SV_any> (cl_make_heap_SV_ringelt(len)) {}
0035 
0036 // Private pointer manipulations.
0037 // Never throw away a `struct cl_heap_SV_ringelt *'!
0038 inline cl_SV_ringelt::operator cl_heap_SV_ringelt* () const
0039 {
0040     cl_heap_SV_ringelt* hpointer = (cl_heap_SV_ringelt*)pointer;
0041     cl_inc_refcount(*this);
0042     return hpointer;
0043 }
0044 extern const cl_SV_ringelt cl_null_SV_ringelt;
0045 inline cl_SV_ringelt::cl_SV_ringelt ()
0046     : cl_SV<_cl_ring_element,cl_SV_any> ((cl_heap_SV_ringelt*) cl_null_SV_ringelt) {}
0047 
0048 class cl_SV_ringelt_init_helper
0049 {
0050     static int count;
0051 public:
0052     cl_SV_ringelt_init_helper();
0053     ~cl_SV_ringelt_init_helper();
0054 };
0055 static cl_SV_ringelt_init_helper cl_SV_ringelt_init_helper_instance;
0056 
0057 // Copy a simple vector.
0058 inline const cl_SV_ringelt copy (const cl_SV_ringelt& vector)
0059 { return The(cl_SV_ringelt) (copy((const cl_SV_any&) vector)); }
0060 
0061 // Output.
0062 extern void fprint (std::ostream& stream, const cl_ring& R, const cl_SV_ringelt& x);
0063 
0064 // Debugging support.
0065 #ifdef CL_DEBUG
0066 extern int cl_SV_ringelt_debug_module;
0067 CL_FORCE_LINK(cl_SV_ringelt_debug_dummy, cl_SV_ringelt_debug_module)
0068 #endif
0069 
0070 }  // namespace cln
0071 
0072 #endif /* _CL_SV_RINGELT_H */