MeVisLab Toolbox Reference
ml::TypedProcessing Namespace Reference

Functions

template<template< typename, int, typename > class VariableType, class Processor >
static void call (MLDataType dataType, Processor &processor)
 Call the process<DataType>() method on the given processor, where the DataType type is dynamically selected by the dataType. More...
 
template<template< typename, int, typename > class VariableType1, template< typename, int, typename > class VariableType2, class Processor >
static void call (MLDataType firstDataType, MLDataType secondDataType, Processor &processor)
 Call the process<DataType1, DataType2>() method on the given processor, where the DataType1 and DataType2 types are dynamically selected by the firstDataType and secondDataType. More...
 

Function Documentation

◆ call() [1/2]

template<template< typename, int, typename > class VariableType, class Processor >
static void ml::TypedProcessing::call ( MLDataType  dataType,
Processor &  processor 
)
inlinestatic

Call the process<DataType>() method on the given processor, where the DataType type is dynamically selected by the dataType.

The VariableType can be any VariableType as defined in mlTypedHandlers.h, e.g., IntegerTypes, FloatTypes, or ScalarTypes. The VariableType selects which data types are supported/which template calls are instantiated.

Example showing how to use TypedProcessing to process a TVirtualVolume depending on the dynamic type of the VirtualVolume:

class MyProcessor
{
public:
MyProcessor(VirtualVolume* volume):_volume(volume)
{
}
template <class DataType> void process()
{
TVirtualVolume<DataType> typedVolume(_volume);
// Do something here, e.g., rasterize an object into typedVolume...
}
private:
VirtualVolume* _volume;
};
...
void runMyProcessor(VirtualVolume& volume)
{
MyProcessor p(&volume);
TypedProcessing::call<ScalarTypes>(volume.getDataType(), p);
}

Definition at line 130 of file mlTypedProcessing.h.

References ml::internal::SingleTypeCaller< Processor, VariableType >::process().

Referenced by ml::UnprotectedMainThreadCommunicator::call().

◆ call() [2/2]

template<template< typename, int, typename > class VariableType1, template< typename, int, typename > class VariableType2, class Processor >
static void ml::TypedProcessing::call ( MLDataType  firstDataType,
MLDataType  secondDataType,
Processor &  processor 
)
inlinestatic

Call the process<DataType1, DataType2>() method on the given processor, where the DataType1 and DataType2 types are dynamically selected by the firstDataType and secondDataType.

The VariableType1 and VariableType2 can be any VariableType as defined in mlTypedHandlers.h, e.g., IntegerTypes, FloatTypes, or ScalarTypes. The VariableType1/2 select which data types are supported/which template calls are instantiated.

Definition at line 145 of file mlTypedProcessing.h.

References ml::internal::DualTypeCaller< Processor, VariableType1, VariableType2 >::process().