TTS v3.0.0
The Tiny Test System
 
Loading...
Searching...
No Matches
Data Generators Customization Points

Customization points to customize data generation for user-defined types. More...

Classes

struct  tts::rebuild< Seq, U >
 Type conversion customization point. More...
 

Functions

template<typename T , typename V >
auto tts::as_value (V const &v)
 Single value evaluation customization point.
 
template<typename T >
auto tts::produce (type< T > const &t, auto g, auto... others)
 Data production customization point.
 

Function Documentation

◆ as_value()

template<typename T , typename V >
auto tts::as_value ( V const &  v)

#include <tts/engine/generator.hpp>

Single value evaluation customization point.

This function generate a T from a value v. Default behavior is to convert but this function can be overloaded to handle user-defined type.

Template Parameters
TTarget data type
Parameters
vValue used ot generate the data sample
Returns
A value of type T obtained by conversion of v.

◆ produce()

template<typename T >
auto tts::produce ( type< T > const &  t,
auto  g,
auto...  others 
)

#include <tts/engine/generator.hpp>

Data production customization point.

This function is in charge of producing data of type T using generator g and additional parameters others.... The default implementation simply calls the generator g with the provided parameters.

By default, this function also handles sequence types by producing each of their elements using the provided generator.

Template Parameters
TTarget data type
Parameters
tType wrapper for the target data type
gData generator to use
othersAdditional parameters forwarded to the generator
Returns
A value of type T produced by the generator g.