LibrePCB Developers Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
AttributeType Class Referenceabstract

The AttributeType class. More...

#include <attributetype.h>

+ Inheritance diagram for AttributeType:
+ Collaboration diagram for AttributeType:

Public Types

enum  Type_t
 Available Attribute Types. More...
 

Public Member Functions

 AttributeType (Type_t type, const QString &typeName, const QString &typeNameTr) noexcept
 
virtual ~AttributeType () noexcept
 
Type_t getType () const noexcept
 
const QString & getName () const noexcept
 
const QString & getNameTr () const noexcept
 
const QList< const
AttributeUnit * > & 
getAvailableUnits () const noexcept
 
const AttributeUnitgetUnitFromString (const QString &unit) const
 
const AttributeUnitgetDefaultUnit () const noexcept
 
bool isUnitAvailable (const AttributeUnit *unit) const noexcept
 
void throwIfValueInvalid (const QString &value) const
 
virtual bool isValueValid (const QString &value) const noexcept=0
 
virtual QString valueFromTr (const QString &value) const noexcept=0
 
virtual QString printableValueTr (const QString &value, const AttributeUnit *unit=nullptr) const noexcept=0
 

Static Public Member Functions

static QList< const
AttributeType * > 
getAllTypes () noexcept
 
static const AttributeTypefromString (const QString &type)
 

Protected Member Functions

 AttributeType ()=delete
 
 AttributeType (const AttributeType &other)=delete
 
AttributeTypeoperator= (const AttributeType &rhs)=delete
 

Protected Attributes

Type_t mType
 
QString mTypeName
 
QString mTypeNameTr
 
QList< const AttributeUnit * > mAvailableUnits
 
const AttributeUnitmDefaultUnit
 

Detailed Description

The AttributeType class.

Member Enumeration Documentation

enum Type_t
strong

Available Attribute Types.

Enumerator
String 
See Also
class #AttrTypeString
Resistance 
See Also
class #AttrTypeResistance
Capacitance 
See Also
class #AttrTypeCapacitance
Inductance 
See Also
class #AttrTypeInductance
Voltage 
See Also
class #AttrTypeVoltage
Current 
See Also
class #AttrTypeCurrent
Power 
See Also
class #AttrTypePower
Frequency 
See Also
class #AttrTypeFrequency
_COUNT 

Constructor & Destructor Documentation

AttributeType ( Type_t  type,
const QString &  typeName,
const QString &  typeNameTr 
)
noexcept
~AttributeType ( )
virtualnoexcept
AttributeType ( )
protecteddelete
AttributeType ( const AttributeType other)
protecteddelete

Member Function Documentation

Type_t getType ( ) const
inlinenoexcept

+ Here is the caller graph for this function:

const QString& getName ( ) const
inlinenoexcept

+ Here is the caller graph for this function:

const QString& getNameTr ( ) const
inlinenoexcept

+ Here is the caller graph for this function:

const QList<const AttributeUnit*>& getAvailableUnits ( ) const
inlinenoexcept

+ Here is the caller graph for this function:

const AttributeUnit * getUnitFromString ( const QString &  unit) const

+ Here is the call graph for this function:

const AttributeUnit* getDefaultUnit ( ) const
inlinenoexcept
bool isUnitAvailable ( const AttributeUnit unit) const
noexcept

+ Here is the caller graph for this function:

void throwIfValueInvalid ( const QString &  value) const

+ Here is the call graph for this function:

virtual bool isValueValid ( const QString &  value) const
pure virtualnoexcept

Implemented in AttrTypeCapacitance, AttrTypeCurrent, AttrTypeFrequency, AttrTypeInductance, AttrTypePower, AttrTypeResistance, AttrTypeString, and AttrTypeVoltage.

+ Here is the caller graph for this function:

virtual QString valueFromTr ( const QString &  value) const
pure virtualnoexcept
virtual QString printableValueTr ( const QString &  value,
const AttributeUnit unit = nullptr 
) const
pure virtualnoexcept
QList< const AttributeType * > getAllTypes ( )
staticnoexcept

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

const AttributeType & fromString ( const QString &  type)
static

+ Here is the call graph for this function:

AttributeType& operator= ( const AttributeType rhs)
protecteddelete

Member Data Documentation

Type_t mType
protected
QString mTypeName
protected
QString mTypeNameTr
protected
QList<const AttributeUnit*> mAvailableUnits
protected
const AttributeUnit* mDefaultUnit
protected

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