ZeroErr
载入中...
搜索中...
未找到
zeroerr::ContainerOfBase结构体 参考

ContainerOf is a domain that generates random containers filled with elements from an inner domain 更多...

#include <container_of.h>

类 zeroerr::ContainerOfBase 继承关系图:

Public 成员函数

void WithMaxSize (unsigned value)
void WithMinSize (unsigned value)
void WithSize (unsigned value)

Public 属性

int min_size = 0
int max_size = 100
int size = -1

Protected 成员函数

void validate () const
unsigned randomSize (Rng &rng) const
template<class Inner, class Corpus>
void mutate (Rng &rng, Corpus &v, bool only_shrink, const Inner &inner) const

静态 Protected 成员函数

static int checkedSize (unsigned value)

详细描述

ContainerOf is a domain that generates random containers filled with elements from an inner domain

模板参数
TThe container type to generate (e.g. vector, list, set)
InnerDomainThe domain type used to generate the container elements

This domain allows generating containers where each element is generated by an inner domain. It supports configuring the size constraints of the generated containers.

Example:

// Generate vectors of ints between 0-100
auto domain = ContainerOf<std::vector<int>>(InRange(0, 100));
// Generate sets of strings
// Configure size constraints
domain.WithMinSize(5); // At least 5 elements
domain.WithMaxSize(10); // At most 10 elements
domain.WithSize(7); // Exactly 7 elements
Arbitrary is a domain that generates random values of a given type
定义 arbitrary.h:42
InRange is a domain that generates random values within a specified range
定义 in_range.h:31
std::enable_if< detail::is_associative_container< T >::value, AssociativeContainerOf< T, Inner > >::type ContainerOf(Inner &&inner)
定义 container_of.h:174

成员函数说明

◆ checkedSize()

int zeroerr::ContainerOfBase::checkedSize ( unsigned value)
inlinestaticprotected

◆ mutate()

template<class Inner, class Corpus>
void zeroerr::ContainerOfBase::mutate ( Rng & rng,
Corpus & v,
bool only_shrink,
const Inner & inner ) const
inlineprotected

◆ randomSize()

unsigned zeroerr::ContainerOfBase::randomSize ( Rng & rng) const
inlineprotected

◆ validate()

void zeroerr::ContainerOfBase::validate ( ) const
inlineprotected

◆ WithMaxSize()

void zeroerr::ContainerOfBase::WithMaxSize ( unsigned value)
inline

◆ WithMinSize()

void zeroerr::ContainerOfBase::WithMinSize ( unsigned value)
inline

◆ WithSize()

void zeroerr::ContainerOfBase::WithSize ( unsigned value)
inline

类成员变量说明

◆ max_size

int zeroerr::ContainerOfBase::max_size = 100

◆ min_size

int zeroerr::ContainerOfBase::min_size = 0

◆ size

int zeroerr::ContainerOfBase::size = -1

该结构体的文档由以下文件生成: