ZeroErr
载入中...
搜索中...
未找到
zeroerr::AggregateOf< T, Inner > 模板类 参考

AggregateOf is a domain that combines multiple inner domains into a tuple or aggregate type 更多...

#include <aggregate_of.h>

类 zeroerr::AggregateOf< T, Inner > 继承关系图:
zeroerr::AggregateOf< T, Inner > 的协作图:

struct  GetTupleDomainMapValue
 

Public 类型

using ValueType = T
 
using CorpusType = std::tuple< typename Inner::CorpusType... >
 

Public 成员函数

 AggregateOf (Inner &&... inner)
 
CorpusType GetRandomCorpus (Rng &rng) const override
 
ValueType GetValue (const CorpusType &v) const override
 
CorpusType FromValue (const ValueType &v) const override
 
void Mutate (Rng &rng, CorpusType &v, bool only_shrink) const override
 
- Public 成员函数 继承自 zeroerr::Domain< T, std::tuple< Inner::CorpusType... > >
virtual ~Domain ()=default
 
virtual T GetRandomValue (Rng &rng) const
 
virtual T GetValue (const std::tuple< Inner::CorpusType... > &v) const=0
 
virtual std::tuple< Inner::CorpusType... > ParseCorpus (IRObject v) const
 
virtual IRObject SerializeCorpus (const std::tuple< Inner::CorpusType... > &v) const
 
virtual void Mutate (Rng &rng, std::tuple< Inner::CorpusType... > &v, bool only_shrink=false) const=0
 

详细描述

template<typename T, typename... Inner>
class zeroerr::AggregateOf< T, Inner >

AggregateOf is a domain that combines multiple inner domains into a tuple or aggregate type

模板参数
TThe aggregate type to generate (e.g. struct or tuple)
InnerThe inner domain types that will generate each field

This domain allows generating structured data by composing multiple inner domains. Each inner domain generates one field of the aggregate type.

Example:

struct Point {
int x;
int y;
};
auto domain = AggregateOf<Point>(
InRange(0, 100), // Domain for x
InRange(0, 100) // Domain for y
);
AggregateOf is a domain that combines multiple inner domains into a tuple or aggregate type
Definition aggregate_of.h:41
InRange is a domain that generates random values within a specified range
Definition in_range.h:28

成员类型定义说明

◆ CorpusType

template<typename T , typename... Inner>
using zeroerr::AggregateOf< T, Inner >::CorpusType = std::tuple<typename Inner::CorpusType...>

◆ ValueType

template<typename T , typename... Inner>
using zeroerr::AggregateOf< T, Inner >::ValueType = T

构造及析构函数说明

◆ AggregateOf()

template<typename T , typename... Inner>
zeroerr::AggregateOf< T, Inner >::AggregateOf ( Inner &&...  inner)
inline

成员函数说明

◆ FromValue()

template<typename T , typename... Inner>
CorpusType zeroerr::AggregateOf< T, Inner >::FromValue ( const ValueType v) const
inlineoverridevirtual

◆ GetRandomCorpus()

template<typename T , typename... Inner>
CorpusType zeroerr::AggregateOf< T, Inner >::GetRandomCorpus ( Rng rng) const
inlineoverridevirtual

◆ GetValue()

template<typename T , typename... Inner>
ValueType zeroerr::AggregateOf< T, Inner >::GetValue ( const CorpusType v) const
inlineoverride

◆ Mutate()

template<typename T , typename... Inner>
void zeroerr::AggregateOf< T, Inner >::Mutate ( Rng rng,
CorpusType v,
bool  only_shrink 
) const
inlineoverride

该类的文档由以下文件生成: