casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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

template<typename T >
void ArrayCopy< T >::fromPy ( T *  to,
const void *  from,
size_t  nr 
template<typename T >
Array< T > ArrayCopy< T >::toArray ( const IPosition &  shape,
void *  data,
bool  copy 

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, 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 casa::data, casacore::shape(), and casacore::SHARE.

Referenced by makeArray().

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

Definition at line 147 of file PycArrayComCC.h.

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