casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions
casa::RetypedArraySetGet_global_functions_RetypedArrayEngineSetGet Struct Reference

Helper functions for users of RetypedArrayEngine. More...

#include <RetypedArraySetGet.h>

List of all members.

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.

Detailed Description

Helper functions for users of RetypedArrayEngine.

Intended use:

Public interface

Review Status

Reviewed By:
UNKNOWN
Date Reviewed:
before2004/08/25
Test programs:
dRetypedArrayEngine
Demo programs:
dRetypedArrayEngine.h

Prerequisite

Synopsis

The functions in here can be used in the implementation of the CopyInfo class inside a SourceType class used by a RetypedArrayEngine.

Example

The example in RetypedArrayEngine shows how these functions can be used.

Motivation

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.


Member Function Documentation

template<class SourceType , class TargetType >
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.

template<class SourceType , class TargetType >
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.

template<class SourceType , class TargetType >
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.

template<class SourceType , class TargetType >
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.


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