rexlib 0.1.0
Device-agnostic array computing library for CryoEM and CryoET image processing, with a pluggable backend architecture
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
rexlib::type_transform Class Reference

Type erased form of a type transform. More...

#include <rexlib/core/operation/type_rule/type_transform.hpp>

Public Types

using apply_function_type = numerical_type(*)(numerical_type)
 Value level half of a transform.
 

Public Member Functions

 type_transform (apply_function_type apply, const numerical_type_domain &domain, const char *relation) noexcept
 Construct a type transform.
 
numerical_type apply (numerical_type type) const noexcept
 Apply the transform to a pivot type.
 
const numerical_type_domain & get_domain () const noexcept
 Get the set of pivot types the transform is defined on.
 
const char * get_relation () const noexcept
 Get the fragment naming the mapping.
 

Detailed Description

Type erased form of a type transform.

Holds the value level half of a transform, the set of pivot types it is defined on, and the fragment naming it in diagnostics.

See also
Type transforms

Constructor & Destructor Documentation

◆ type_transform()

rexlib::type_transform::type_transform ( apply_function_type  apply,
const numerical_type_domain &  domain,
const char *  relation 
)
noexcept

Construct a type transform.

Parameters
applyValue level half of the transform. Must not be null.
domainSet of pivot types the transform is defined on. It must outlive the transform, which the domain tags guarantee by holding it in static storage.
relationFragment naming the mapping, for diagnostics. Must not be null and must outlive the transform.

Member Function Documentation

◆ apply()

numerical_type rexlib::type_transform::apply ( numerical_type  type) const
noexcept

Apply the transform to a pivot type.

Parameters
typeThe pivot type. Must belong to the domain.
Returns
numerical_type The operand type.

◆ get_domain()

const numerical_type_domain & rexlib::type_transform::get_domain ( ) const
noexcept

Get the set of pivot types the transform is defined on.

Returns
const numerical_type_domain& The domain.

◆ get_relation()

const char * rexlib::type_transform::get_relation ( ) const
noexcept

Get the fragment naming the mapping.

Returns
const char* The fragment.

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