Skip to content

SizeRange

INCLUDE FILE
#include "SizeRange.h"

class SizeRange

Represents a possibly unbounded range of sizes.

DEFINITION
class SizeRange;

constructor SizeRange

Construct a SizeRange representing unknown size.

DEFINITION
SizeRange ( );

constructor SizeRange

Construct a SizeRange with a minimum and optional maximum.

DEFINITION
SizeRange ( uint64_t  minimum,
std::optional< uint64_t >  maximum );
PARAMETERDESCRIPTION
minimum

The minimum size.

maximum

The maximum size. If not set, the range is unbounded.

constructor SizeRange

Construct a SizeRange representing a known size.

DEFINITION
SizeRange ( uint64_t  size );
PARAMETERDESCRIPTION
size

The size of the range.

method has_sizeconst

Check if the size of the range is known.

DEFINITION
bool  has_size ( ) const;
RETURNSDESCRIPTION
bool

true if the size is known, false otherwise.

method max

Get the maximum of this size range and another.

It takes the maximum of the minimums and maximums of the two ranges.

DEFINITION
SizeRange  max ( const SizeRange & other );
PARAMETERDESCRIPTION
other

The other size range to compare with.

RETURNSDESCRIPTION
SizeRange

A new SizeRange representing the maximum of the two ranges.

method maximum_valueconst

Get the maximum value of the size range.

DEFINITION
std::optional< Value >  maximum_value ( ) const;
RETURNSDESCRIPTION
std::optional< Value >

The maximum value, if any.

method minimum_valueconst

Get the minimum value of the size range.

DEFINITION
Value  minimum_value ( ) const;
RETURNSDESCRIPTION
Value

The minimum value.

method operator!=const

Compare two size ranges for inequality.

DEFINITION
bool  operator!= ( const SizeRange & other ) const;
PARAMETERDESCRIPTION
other

The size range to compare with.

RETURNSDESCRIPTION
bool

true if the size ranges are not equal, false otherwise.

method operator*const

Multiply this size range by a constant.

DEFINITION
SizeRange  operator* ( uint64_t  multiplier ) const;
PARAMETERDESCRIPTION
multiplier

The constant to multiply by.

RETURNSDESCRIPTION
SizeRange

The resulting size range.

method operator*const

Multiply this size range by another size range.

DEFINITION
SizeRange  operator* ( const SizeRange & other ) const;
PARAMETERDESCRIPTION
other

The size range to multiply with.

RETURNSDESCRIPTION
SizeRange

The resulting size range.

method operator+const

Add another size range to this one.

DEFINITION
SizeRange  operator+ ( const SizeRange & other ) const;
PARAMETERDESCRIPTION
other

The size range to add.

RETURNSDESCRIPTION
SizeRange

The resulting size range.

method operator+=

Add another size range to this one and assign the result to this range.

DEFINITION
SizeRange  operator+= ( const SizeRange & other );
PARAMETERDESCRIPTION
other

The size range to add.

RETURNSDESCRIPTION
SizeRange

The resulting size range.

method operator-const

Subtract another size range from this one.

DEFINITION
SizeRange  operator- ( const SizeRange & other ) const;
PARAMETERDESCRIPTION
other

The size range to subtract.

RETURNSDESCRIPTION
SizeRange

The resulting size range.

method operator==const

Compare two size ranges for equality.

DEFINITION
bool  operator== ( const SizeRange & other ) const;
PARAMETERDESCRIPTION
other

The size range to compare with.

RETURNSDESCRIPTION
bool

true if the size ranges are equal, false otherwise.

method sizeconst

Get the size of the range, if it is known.

DEFINITION
std::optional< uint64_t >  size ( ) const;
RETURNSDESCRIPTION
std::optional< uint64_t >

The size of the range, {} if it is unknown.

method valueconst

If the size range has a known size, return it as a Value.

DEFINITION
std::optional< Value >  value ( ) const;
RETURNSDESCRIPTION
std::optional< Value >

The size of the range as a Value, {} if it is unknown.

member maximum

The maximum size of the range. If not set, the range is unbounded.

DEFINITION
std::optional< uint64_t >  maximum;

member minimum

The minimum size of the range.

DEFINITION
uint64_t  minimum;

class formatter< SizeRange >

DEFINITION
class formatter< SizeRange >;

method formatconst

DEFINITION
auto  format ( const SizeRange & size_range,
format_context & ctx ) const;
PARAMETERDESCRIPTION
size_range
ctx
RETURNSDESCRIPTION
auto