Loading...
Searching...
No Matches
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 46 of file PycArrayComH.h.

## Member Function Documentation

## fromPy()

template<typename T>

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

static

Definition at line 160 of file PycArrayComCC.h.

Referenced by toArray().

## 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 fromPy().

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:

- python/Converters/PycArrayComH.h
- python/Converters/PycArrayComCC.h