LCOV - code coverage report
Current view: top level - casa_sakura - SakuraAlignedArray.h (source / functions) Hit Total Coverage
Test: casacpp_coverage.info Lines: 1 4 25.0 %
Date: 2024-10-10 15:00:01 Functions: 2 6 33.3 %

          Line data    Source code
       1             : #ifndef _CASA_SAKURA_ALIGNED_ARRAY_H_
       2             : #define _CASA_SAKURA_ALIGNED_ARRAY_H_
       3             : 
       4             : #include <iostream>
       5             : #include <memory>
       6             : #include <string>
       7             : 
       8             : //#include <libsakura/sakura.h>
       9             : 
      10             : #include <casacore/casa/aipstype.h>
      11             : #include <casacore/casa/Arrays/Array.h>
      12             : #include <casacore/casa/Arrays/Vector.h>
      13             : 
      14             : namespace casa { //# NAMESPACE CASA - BEGIN
      15             : 
      16             : template<typename T>
      17             : class SakuraAlignedArray {
      18             : public:
      19             :   SakuraAlignedArray(size_t num_data);
      20             :   SakuraAlignedArray(casacore::Vector<T> const &in_vector);
      21             :   ~SakuraAlignedArray();
      22             : 
      23          40 :   T *data() const {return data_;}
      24           0 :   casacore::Vector<T> casaVector() const {
      25           0 :       return casacore::Vector<T>(casacore::IPosition(1, num_data_), data_,
      26           0 :                                  casacore::SHARE);
      27             :   }
      28             : private:
      29             :   void initialize();
      30             :   size_t num_data_;      // number of data to be stored
      31             :   void *storage_;        // starting address of allocated memory (unaligned)
      32             :   T *data_;               // pointer to aligned data
      33             : };
      34             : 
      35             : } //# NAMESPACE CASA - END
      36             : 
      37             : #include <casa_sakura/SakuraAlignedArray.tcc>
      38             : 
      39             : #endif /* _CASA_SAKURA_ALIGNED_ARRAY_H_ */

Generated by: LCOV version 1.16