LibrePCB Developers Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
length.h File Reference
#include "../fileio/sexpression.h"
#include <type_safe/constrained_type.hpp>
#include <QtCore>
+ Include dependency graph for length.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  Length
 The Length class is used to represent a length (for example 12.75 millimeters) More...
 
struct  UnsignedLengthVerifier
 
struct  UnsignedLengthConstraint
 
struct  PositiveLengthVerifier
 
struct  PositiveLengthConstraint
 

Namespaces

 librepcb
 

Typedefs

typedef qint64 LengthBase_t
 This type is the ONLY base type to store all lengths (always in nanometers)! More...
 
using UnsignedLength = type_safe::constrained_type< Length, UnsignedLengthConstraint, UnsignedLengthVerifier >
 
using PositiveLength = type_safe::constrained_type< Length, PositiveLengthConstraint, PositiveLengthVerifier >
 

Functions

template<>
SExpression serializeToSExpression (const Length &obj)
 
template<>
Length deserializeFromSExpression (const SExpression &sexpr, bool throwIfEmpty)
 
QDataStream & operator<< (QDataStream &stream, const Length &length)
 
QDebug operator<< (QDebug stream, const Length &length)
 
uint qHash (const Length &key, uint seed=0) noexcept
 
UnsignedLength operator+ (const UnsignedLength &lhs, const UnsignedLength &rhs) noexcept
 
UnsignedLength & operator+= (UnsignedLength &lhs, const UnsignedLength &rhs) noexcept
 
Length operator* (const UnsignedLength &lhs, LengthBase_t rhs) noexcept
 
Length operator/ (const UnsignedLength &lhs, LengthBase_t rhs) noexcept
 
Length operator+ (const Length &lhs, const UnsignedLength &rhs) noexcept
 
Length operator+ (const UnsignedLength &lhs, const Length &rhs) noexcept
 
Length operator- (const Length &lhs, const UnsignedLength &rhs) noexcept
 
Length operator- (const UnsignedLength &lhs, const Length &rhs) noexcept
 
Length operator- (const UnsignedLength &lhs) noexcept
 
bool operator> (const UnsignedLength &lhs, const Length &rhs) noexcept
 
bool operator> (const UnsignedLength &lhs, LengthBase_t rhs) noexcept
 
bool operator>= (const UnsignedLength &lhs, const Length &rhs) noexcept
 
bool operator>= (const UnsignedLength &lhs, LengthBase_t rhs) noexcept
 
bool operator< (const UnsignedLength &lhs, const Length &rhs) noexcept
 
bool operator< (const UnsignedLength &lhs, LengthBase_t rhs) noexcept
 
bool operator== (const UnsignedLength &lhs, const Length &rhs) noexcept
 
bool operator== (const UnsignedLength &lhs, LengthBase_t rhs) noexcept
 
bool operator!= (const UnsignedLength &lhs, const Length &rhs) noexcept
 
bool operator!= (const UnsignedLength &lhs, LengthBase_t rhs) noexcept
 
template<>
SExpression serializeToSExpression (const UnsignedLength &obj)
 
template<>
UnsignedLength deserializeFromSExpression (const SExpression &sexpr, bool throwIfEmpty)
 
QDataStream & operator<< (QDataStream &stream, const UnsignedLength &length)
 
QDebug operator<< (QDebug stream, const UnsignedLength &length)
 
uint qHash (const UnsignedLength &key, uint seed=0) noexcept
 
UnsignedLength positiveToUnsigned (const PositiveLength &l) noexcept
 
PositiveLength operator+ (const PositiveLength &lhs, const PositiveLength &rhs) noexcept
 
PositiveLength operator+ (const PositiveLength &lhs, const UnsignedLength &rhs) noexcept
 
PositiveLength operator+ (const UnsignedLength &lhs, const PositiveLength &rhs) noexcept
 
PositiveLength & operator+= (PositiveLength &lhs, const PositiveLength &rhs) noexcept
 
PositiveLength & operator+= (PositiveLength &lhs, const UnsignedLength &rhs) noexcept
 
UnsignedLength & operator+= (UnsignedLength &lhs, const PositiveLength &rhs) noexcept
 
Length operator* (const PositiveLength &lhs, LengthBase_t rhs) noexcept
 
Length operator/ (const PositiveLength &lhs, LengthBase_t rhs) noexcept
 
Length operator+ (const Length &lhs, const PositiveLength &rhs) noexcept
 
Length operator+ (const PositiveLength &lhs, const Length &rhs) noexcept
 
Length operator- (const Length &lhs, const PositiveLength &rhs) noexcept
 
Length operator- (const PositiveLength &lhs, const Length &rhs) noexcept
 
Length operator- (const UnsignedLength &lhs, const PositiveLength &rhs) noexcept
 
Length operator- (const PositiveLength &lhs, const UnsignedLength &rhs) noexcept
 
Length operator- (const PositiveLength &lhs) noexcept
 
bool operator> (const UnsignedLength &lhs, const PositiveLength &rhs) noexcept
 
bool operator> (const PositiveLength &lhs, const UnsignedLength &rhs) noexcept
 
bool operator> (const PositiveLength &lhs, const Length &rhs) noexcept
 
bool operator> (const PositiveLength &lhs, LengthBase_t rhs) noexcept
 
bool operator>= (const UnsignedLength &lhs, const PositiveLength &rhs) noexcept
 
bool operator>= (const PositiveLength &lhs, const UnsignedLength &rhs) noexcept
 
bool operator>= (const PositiveLength &lhs, const Length &rhs) noexcept
 
bool operator>= (const PositiveLength &lhs, LengthBase_t rhs) noexcept
 
bool operator< (const UnsignedLength &lhs, const PositiveLength &rhs) noexcept
 
bool operator< (const PositiveLength &lhs, const UnsignedLength &rhs) noexcept
 
bool operator< (const PositiveLength &lhs, const Length &rhs) noexcept
 
bool operator< (const PositiveLength &lhs, LengthBase_t rhs) noexcept
 
bool operator== (const UnsignedLength &lhs, const PositiveLength &rhs) noexcept
 
bool operator== (const PositiveLength &lhs, const UnsignedLength &rhs) noexcept
 
bool operator== (const PositiveLength &lhs, const Length &rhs) noexcept
 
bool operator== (const PositiveLength &lhs, LengthBase_t rhs) noexcept
 
bool operator!= (const UnsignedLength &lhs, const PositiveLength &rhs) noexcept
 
bool operator!= (const PositiveLength &lhs, const UnsignedLength &rhs) noexcept
 
bool operator!= (const PositiveLength &lhs, const Length &rhs) noexcept
 
bool operator!= (const PositiveLength &lhs, LengthBase_t rhs) noexcept
 
template<>
SExpression serializeToSExpression (const PositiveLength &obj)
 
template<>
PositiveLength deserializeFromSExpression (const SExpression &sexpr, bool throwIfEmpty)
 
QDataStream & operator<< (QDataStream &stream, const PositiveLength &length)
 
QDebug operator<< (QDebug stream, const PositiveLength &length)
 
uint qHash (const PositiveLength &key, uint seed=0) noexcept