#include <vctFastCopy.h>
Collaboration diagram for vctFastCopy:

The static methods in this class should not be used directly. These are helper methods used by the containers methods. To perform a FastCopy (aka memcpy), always use the methods FastCopyOf and FastCopyCompatible defined for vctFixedSizeVector, vctFixedSizeMatrix, vctDynamicVector, vctDynamicMatrix and vctDynamicNArray.
Definition at line 41 of file vctFastCopy.h.
| static bool vctFastCopy::VectorSizeCompatible | ( | const _vector1Type & | vector1, | |
| const _vector2Type & | vector2 | |||
| ) | [inline, static, protected] |
Helper functions to test if sizes or strides are compatible.
Definition at line 48 of file vctFastCopy.h.
Referenced by ThrowUnlessValidVectorSizes(), and VectorCopyCompatible().
| static bool vctFastCopy::ContainerSizesCompatible | ( | const _container1Type & | container1, | |
| const _container2Type & | container2 | |||
| ) | [inline, static, protected] |
Helper functions to test if sizes or strides are compatible.
Definition at line 55 of file vctFastCopy.h.
Referenced by MatrixCopyCompatible(), NArrayCopyCompatible(), and ThrowUnlessValidContainerSizes().
| static bool vctFastCopy::VectorStrideCompatible | ( | const _vector1Type & | vector1, | |
| const _vector2Type & | vector2 | |||
| ) | [inline, static, protected] |
Helper functions to test if sizes or strides are compatible.
Definition at line 62 of file vctFastCopy.h.
Referenced by VectorCopy(), and VectorCopyCompatible().
| static bool vctFastCopy::MatrixStridesCompatible | ( | const _matrix1Type & | matrix1, | |
| const _matrix2Type & | matrix2 | |||
| ) | [inline, static, protected] |
Helper functions to test if sizes or strides are compatible.
Definition at line 70 of file vctFastCopy.h.
Referenced by MatrixCopy(), and MatrixCopyCompatible().
| static bool vctFastCopy::NArrayStridesCompatible | ( | const _nArray1Type & | nArray1, | |
| const _nArray2Type & | nArray2 | |||
| ) | [inline, static, protected] |
Helper functions to test if sizes or strides are compatible.
Definition at line 86 of file vctFastCopy.h.
Referenced by NArrayCopy(), and NArrayCopyCompatible().
| static void vctFastCopy::ThrowUnlessValidVectorSizes | ( | const _vector1Type & | vector1, | |
| const _vector2Type & | vector2 | |||
| ) | throw (std::runtime_error) [inline, static, protected] |
Helper function to throw an exception whenever sizes mismatch. This enforces that a standard message is sent.
Definition at line 99 of file vctFastCopy.h.
References cmnThrow(), and VectorSizeCompatible().
Referenced by VectorCopy().
| static void vctFastCopy::ThrowUnlessValidContainerSizes | ( | const _container1Type & | container1, | |
| const _container2Type & | container2 | |||
| ) | throw (std::runtime_error) [inline, static, protected] |
Helper function to throw an exception whenever sizes mismatch. This enforces that a standard message is sent.
Definition at line 109 of file vctFastCopy.h.
References cmnThrow(), and ContainerSizesCompatible().
Referenced by MatrixCopy(), and NArrayCopy().
| static bool vctFastCopy::VectorCopyCompatible | ( | const _vector1Type & | vector1, | |
| const _vector2Type & | vector2 | |||
| ) | [inline, static] |
Helper functions to test if a fast copy is possible.
Definition at line 130 of file vctFastCopy.h.
References VectorSizeCompatible(), and VectorStrideCompatible().
Referenced by vctDynamicConstVectorBase< vctDynamicVectorOwner< svlFilterSourceVideoCapture::_ImageFormat >, svlFilterSourceVideoCapture::_ImageFormat >::FastCopyCompatible(), and vctFixedSizeConstVectorBase< _size, _stride, int, vctFixedSizeVectorTraits< int, _size, 1 >::array >::FastCopyCompatible().
| static bool vctFastCopy::MatrixCopyCompatible | ( | const _matrix1Type & | matrix1, | |
| const _matrix2Type & | matrix2 | |||
| ) | [inline, static] |
Helper functions to test if a fast copy is possible.
Definition at line 140 of file vctFastCopy.h.
References ContainerSizesCompatible(), and MatrixStridesCompatible().
Referenced by vctDynamicConstMatrixBase< vctDynamicMatrixOwner< float >, float >::FastCopyCompatible().
| static bool vctFastCopy::NArrayCopyCompatible | ( | const _nArray1Type & | nArray1, | |
| const _nArray2Type & | nArray2 | |||
| ) | [inline, static] |
Helper functions to test if a fast copy is possible.
Definition at line 150 of file vctFastCopy.h.
References ContainerSizesCompatible(), and NArrayStridesCompatible().
Referenced by vctDynamicConstNArrayBase< vctDynamicNArrayRefOwner< _elementType, _dimension >, _elementType, _dimension >::FastCopyCompatible().
| static bool vctFastCopy::VectorCopy | ( | _destinationVectorType & | destination, | |
| const _sourceVectorType & | source, | |||
| bool | performSafetyChecks | |||
| ) | [inline, static] |
Function to use memcpy whenever possible. This is not really and engine since it has no loop nor plugable operation, but it performs a similar size check as other engines.
Definition at line 166 of file vctFastCopy.h.
References ThrowUnlessValidVectorSizes(), and VectorStrideCompatible().
Referenced by vctDynamicVectorBase< vctDynamicVectorOwner< svlFilterSourceVideoCapture::_ImageFormat >, svlFilterSourceVideoCapture::_ImageFormat >::FastCopyOf(), and vctFixedSizeVectorBase< _size, 1, svlPoint2D, vctFixedSizeVectorTraits< svlPoint2D, _size, 1 >::array >::FastCopyOf().
| static bool vctFastCopy::MatrixCopy | ( | _destinationMatrixType & | destination, | |
| const _sourceMatrixType & | source, | |||
| bool | performSafetyChecks | |||
| ) | [inline, static] |
Function to use memcpy whenever possible. This is not really and engine since it has no loop nor plugable operation, but it performs a similar size check as other engines. This method will attempt to copy either the whole matrix using a single memcpy or one memcpy for each row or column whenever possible.
First the method performs a serie of checks to make sure both matrices are compatible. If the sizes are incorrect, the method will throw an exception as do all cisstVector engines. If the strides are not compatible for a memcpy, the method return false. The safety checks can be skipped by turning the second parameter (performSafetyChecks) to false.
Then the method will test if both matrices are compact to figure out if a single memcpy is possible. Otherwise, the methods will compare the strides, assuming that either both row or column strides are equal to one.
Definition at line 213 of file vctFastCopy.h.
References MatrixStridesCompatible(), and ThrowUnlessValidContainerSizes().
Referenced by vctDynamicMatrixBase< vctDynamicMatrixOwner< float >, float >::FastCopyOf(), and vctFixedSizeMatrixBase< _rows, _cols, _rowMajor?_cols:1, _rowMajor?1:_rows, double, vctFixedSizeMatrixTraits< double, _rows, _cols, _rowMajor?_cols:1, _rowMajor?1:_rows >::array >::FastCopyOf().
| static bool vctFastCopy::NArrayCopy | ( | _destinationNArrayType & | destination, | |
| const _sourceNArrayType & | source, | |||
| bool | performSafetyChecks | |||
| ) | [inline, static] |
Function to use memcpy whenever possible. This is not really and engine since it has no loop nor plugable operation, but it performs a similar size check as other engines. This method will attempt to copy either the whole nArray using a single memcpy.
Definition at line 289 of file vctFastCopy.h.
References NArrayStridesCompatible(), and ThrowUnlessValidContainerSizes().
Referenced by vctDynamicNArrayBase< vctDynamicNArrayRefOwner< _elementType, _dimension >, _elementType, _dimension >::FastCopyOf().
const bool vctFastCopy::SkipChecks = false [static] |
Flags used to skip or perform safety checks in FastCopy.
Definition at line 123 of file vctFastCopy.h.
const bool vctFastCopy::PerformChecks = true [static] |
Flags used to skip or perform safety checks in FastCopy.
Definition at line 124 of file vctFastCopy.h.