cisst-saw
Loading...
Searching...
No Matches
vctStoreBackBinaryOperations< _inputOutputType, _input2Type > Class Template Reference

Define binary operations between objects as classes. More...

#include <vctStoreBackBinaryOperations.h>

Classes

class  Addition
 Returns the sum of the two InputType object. More...
class  Subtraction
 Returns the difference of the two InputType object. More...
class  Multiplication
 Returns the product of the two InputType object. More...
class  Division
 Returns the ratio of the two InputType object. More...
class  FirstOperand
 Return the first operand of (input1, input2), i.e., input1. More...
class  SecondOperand
 Return the first operand of (input1, input2), i.e., input2. More...
class  Maximum
 Return the greater of (input1, input2). More...
class  ClipIn
class  Minimum
 Return the of lesser (input1, input2). More...
class  Swap
 Swap the values of input1, input2. More...

Public Types

typedef _inputOutputType InputOutputType
typedef _input2Type Input2Type

Detailed Description

template<class _inputOutputType, class _input2Type = _inputOutputType>
class vctStoreBackBinaryOperations< _inputOutputType, _input2Type >

Define binary operations between objects as classes.

Class vctStoreBackBinaryOperations is an envelope that wraps binary store back operations between objects as classes. StoreBackOperations defines internal classes such as Addition, Subtraction, etc., and each of the internal classes has one static function named Operate(), which wraps the corresponding operation. The signature of a typical Operate() is

static inline OutputType & Operate(Input1Type & input1, const Input2Type & input2)

Where OutputType, Input1Type, Input2Type are the types of the result and the two operands.

By abstracting very simple operations as inline functions, we can plug the StoreBackOperations internal classes into templated vector operation engines. See an example of such engine in vctFixedSizeVectorRecursiveEngines.h , and an example of plugging an operation into the engine in vctFixedSizeVectorOperations.h .

Parameters
inputOutputTypethe type of the first (left-side) operand, which is an input output
input2Typethe type of the second (right-side) operand)
Note
This class contains the binary operation Swap, whose operation signature is
static inline void Operate(Input1Type & input1, Input2Type & input2)
with no const or return type. It was included here since we didn't want to have a special file for just one operation.
See also
Addition Subtraction Multiplication Division FirstOperand SecondOperand Maximum Minimum

Member Typedef Documentation

◆ Input2Type

template<class _inputOutputType, class _input2Type = _inputOutputType>
typedef _input2Type vctStoreBackBinaryOperations< _inputOutputType, _input2Type >::Input2Type

◆ InputOutputType

template<class _inputOutputType, class _input2Type = _inputOutputType>
typedef _inputOutputType vctStoreBackBinaryOperations< _inputOutputType, _input2Type >::InputOutputType

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