LibrePCB Developers Documentation
BoundedUnsignedRatio Class Reference

The BoundedUnsignedRatio class represents a ratio limited to a range specified by min/max values. More...

#include <boundedunsignedratio.h>

+ Collaboration diagram for BoundedUnsignedRatio:

Public Member Functions

 BoundedUnsignedRatio ()=delete
 
 BoundedUnsignedRatio (const BoundedUnsignedRatio &other) noexcept
 
 BoundedUnsignedRatio (const UnsignedRatio &ratio, const UnsignedLength &min, const UnsignedLength &max)
 
 BoundedUnsignedRatio (const SExpression &node)
 
 ~BoundedUnsignedRatio () noexcept
 
const UnsignedRatiogetRatio () const noexcept
 
const UnsignedLengthgetMinValue () const noexcept
 
const UnsignedLengthgetMaxValue () const noexcept
 
UnsignedLength calcValue (const Length &input) const noexcept
 
void serialize (SExpression &root) const
 
BoundedUnsignedRatiooperator= (const BoundedUnsignedRatio &rhs) noexcept
 
bool operator== (const BoundedUnsignedRatio &rhs) const noexcept
 
bool operator!= (const BoundedUnsignedRatio &rhs) const noexcept
 

Private Member Functions

void throwIfInvalid () const
 

Private Attributes

UnsignedRatio mRatio
 
UnsignedLength mMinValue
 
UnsignedLength mMaxValue
 

Detailed Description

The BoundedUnsignedRatio class represents a ratio limited to a range specified by min/max values.

Constructor & Destructor Documentation

◆ BoundedUnsignedRatio() [1/4]

◆ BoundedUnsignedRatio() [2/4]

BoundedUnsignedRatio ( const BoundedUnsignedRatio other)
noexcept

◆ BoundedUnsignedRatio() [3/4]

BoundedUnsignedRatio ( const UnsignedRatio ratio,
const UnsignedLength min,
const UnsignedLength max 
)
+ Here is the call graph for this function:

◆ BoundedUnsignedRatio() [4/4]

BoundedUnsignedRatio ( const SExpression node)
explicit
+ Here is the call graph for this function:

◆ ~BoundedUnsignedRatio()

~BoundedUnsignedRatio ( )
noexcept

Member Function Documentation

◆ getRatio()

const UnsignedRatio& getRatio ( ) const
inlinenoexcept
+ Here is the caller graph for this function:

◆ getMinValue()

const UnsignedLength& getMinValue ( ) const
inlinenoexcept
+ Here is the caller graph for this function:

◆ getMaxValue()

const UnsignedLength& getMaxValue ( ) const
inlinenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ calcValue()

UnsignedLength calcValue ( const Length input) const
noexcept
+ Here is the caller graph for this function:

◆ serialize()

void serialize ( SExpression root) const
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ operator=()

BoundedUnsignedRatio & operator= ( const BoundedUnsignedRatio rhs)
noexcept
+ Here is the caller graph for this function:

◆ operator==()

bool operator== ( const BoundedUnsignedRatio rhs) const
noexcept
+ Here is the caller graph for this function:

◆ operator!=()

bool operator!= ( const BoundedUnsignedRatio rhs) const
inlinenoexcept
+ Here is the call graph for this function:

◆ throwIfInvalid()

void throwIfInvalid ( ) const
private
+ Here is the caller graph for this function:

Member Data Documentation

◆ mRatio

UnsignedRatio mRatio
private

◆ mMinValue

UnsignedLength mMinValue
private

◆ mMaxValue

UnsignedLength mMaxValue
private

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