casa
$Rev:20696$
|
Helper functions for users of RetypedArrayEngine. More...
#include <RetypedArraySetGet.h>
Public Member Functions | |
template<class SourceType , class TargetType > | |
void | retypedArrayEngineSet (Array< SourceType > &out, const Array< TargetType > &in) |
Copy the entire target array to the source array. | |
template<class SourceType , class TargetType > | |
void | retypedArrayEngineGet (Array< TargetType > &out, const Array< SourceType > &in) |
Copy the entire source array to the target array. | |
template<class SourceType , class TargetType > | |
void | retypedArrayEngineSet (Array< SourceType > &out, const Array< TargetType > &in, const IPosition &shape, const void *extraArgument) |
Fill an array with SourceType objects from the target array. | |
template<class SourceType , class TargetType > | |
void | retypedArrayEngineGet (Array< TargetType > &out, const Array< SourceType > &in, const IPosition &shape, const void *extraArgument) |
Fill an array with TargetType objects from the source array. |
Helper functions for users of RetypedArrayEngine.
Public interface
The functions in here can be used in the implementation of the CopyInfo class inside a SourceType class used by a RetypedArrayEngine.
The example in RetypedArrayEngine shows how these functions can be used.
These functions make the implementation of the set and get functions in the SourceType objects of the RetypedArrayEngine easier. They are not part of the RetypedArrayEngine.h file to avoid the inclusion of that (heavy) file in a SourceType.
Definition at line 71 of file RetypedArraySetGet.h.
void casa::RetypedArraySetGet_global_functions_RetypedArrayEngineSetGet::retypedArrayEngineGet | ( | Array< TargetType > & | out, |
const Array< SourceType > & | in | ||
) |
Copy the entire source array to the target array.
It will check if the shapes and sizes match.
This very efficient copy function can only be called by the static set function in the SourceType when the TargetType array can directly be copied to the SourceType array.
See RetypedArrayEngine for more information.
void casa::RetypedArraySetGet_global_functions_RetypedArrayEngineSetGet::retypedArrayEngineGet | ( | Array< TargetType > & | out, |
const Array< SourceType > & | in, | ||
const IPosition & | shape, | ||
const void * | extraArgument | ||
) |
Fill an array with TargetType objects from the source array.
This is called when the target is incomplete. The shape and extra argument can help to get the correct elements from the source.
It loops through all elements in the SourceType array and calls the SourceType function
void getElem (TargetType* data, const IPosition& shape, const void* extraArgument);
for each element.
Tip: This retypedArrayEngineGet function is only a convenience function; For optimal performance it may be needed to handcode the loop instead of using this function;
See RetypedArrayEngine for more information.
void casa::RetypedArraySetGet_global_functions_RetypedArrayEngineSetGet::retypedArrayEngineSet | ( | Array< SourceType > & | out, |
const Array< TargetType > & | in | ||
) |
Copy the entire target array to the source array.
It will check if the shapes and sizes match.
This very efficient copy function can only be called by the static set function in the SourceType when the TargetType array can directly be copied to the SourceType array.
See RetypedArrayEngine for more information.
void casa::RetypedArraySetGet_global_functions_RetypedArrayEngineSetGet::retypedArrayEngineSet | ( | Array< SourceType > & | out, |
const Array< TargetType > & | in, | ||
const IPosition & | shape, | ||
const void * | extraArgument | ||
) |
Fill an array with SourceType objects from the target array.
This is called when the target is incomplete. The shape and extra argument can help to set the correct elements in the source.
It loops through all elements in the SourceType array and calls the SourceType function It calls the SourceType function
void setElem (const TargetType* data, const IPosition& shape, const void* extraArgument);
for each element.
Tip: This retypedArrayEngineSet function is only a convenience function; For optimal performance it may be needed to handcode the loop instead of using this function;
See RetypedArrayEngine for more information.