casacore
Static Public Member Functions | List of all members
ArrayCopy< T > Struct Template Reference

Copy/convert the array data as needed. More...

#include <PycArrayComH.h>

Static Public Member Functions

static void toPy (void *to, const T *from, size_t nr)
 
static void fromPy (T *to, const void *from, size_t nr)
 
static Array< T > toArray (const IPosition &shape, void *data, bool copy)
 

Detailed Description

template<typename T>
struct ArrayCopy< T >

Copy/convert the array data as needed.

Specializations are defined for complex and string.

Definition at line 48 of file PycArrayComH.h.

Member Function Documentation

◆ fromPy()

template<typename T >
void ArrayCopy< T >::fromPy ( T *  to,
const void *  from,
size_t  nr 
)
static

◆ toArray()

template<typename T >
Array< T > ArrayCopy< T >::toArray ( const IPosition &  shape,
void *  data,
bool  copy 
)
static

If the python array was contiguous, etc., we can directly use its data because the Array used is only temporary. However, if a copy of the Python array was made in PycArray.cc, we cannot do that because the Python copy is out of scope when the Array object gets used.

Definition at line 173 of file PycArrayComCC.h.

References casacore::copy(), casacore::shape(), and casacore::SHARE.

Referenced by makeArray().

◆ toPy()

template<typename T >
void ArrayCopy< T >::toPy ( void *  to,
const T *  from,
size_t  nr 
)
static

Definition at line 147 of file PycArrayComCC.h.


The documentation for this struct was generated from the following files: