LibrePCB Developers Documentation
Attribute Class Referencefinal

The Attribute class. More...

#include <attribute.h>

+ Collaboration diagram for Attribute:

Public Types

enum class  Event
 
typedef Slot< Attribute, EventOnEditedSlot
 

Public Member Functions

 Attribute ()=delete
 
 Attribute (const Attribute &other) noexcept
 
 Attribute (const SExpression &node)
 
 Attribute (const AttributeKey &key, const AttributeType &type, const QString &value, const AttributeUnit *unit)
 
 ~Attribute () noexcept
 
const AttributeKeygetKey () const noexcept
 
const QString & getName () const noexcept
 
const AttributeTypegetType () const noexcept
 
const AttributeUnitgetUnit () const noexcept
 
const QString & getValue () const noexcept
 
QString getValueTr (bool showUnit) const noexcept
 
bool setKey (const AttributeKey &key) noexcept
 
bool setTypeValueUnit (const AttributeType &type, const QString &value, const AttributeUnit *unit)
 
void serialize (SExpression &root) const
 Serialize into librepcb::SExpression node. More...
 
bool operator== (const Attribute &rhs) const noexcept
 
bool operator!= (const Attribute &rhs) const noexcept
 
Attributeoperator= (const Attribute &rhs) noexcept
 

Public Attributes

Signal< Attribute, EventonEdited
 

Private Member Functions

bool checkAttributesValidity () const noexcept
 

Private Attributes

AttributeKey mKey
 
const AttributeTypemType
 
QString mValue
 
const AttributeUnitmUnit
 

Detailed Description

The Attribute class.

Member Typedef Documentation

◆ OnEditedSlot

Member Enumeration Documentation

◆ Event

enum class Event
strong
Enumerator
KeyChanged 
TypeValueUnitChanged 

Constructor & Destructor Documentation

◆ Attribute() [1/4]

Attribute ( )
delete

◆ Attribute() [2/4]

Attribute ( const Attribute other)
noexcept

◆ Attribute() [3/4]

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

◆ Attribute() [4/4]

Attribute ( const AttributeKey key,
const AttributeType type,
const QString &  value,
const AttributeUnit unit 
)
+ Here is the call graph for this function:

◆ ~Attribute()

~Attribute ( )
noexcept

Member Function Documentation

◆ getKey()

const AttributeKey & getKey ( ) const
inlinenoexcept
+ Here is the caller graph for this function:

◆ getName()

const QString & getName ( ) const
inlinenoexcept

◆ getType()

const AttributeType & getType ( ) const
inlinenoexcept
+ Here is the caller graph for this function:

◆ getUnit()

const AttributeUnit * getUnit ( ) const
inlinenoexcept
+ Here is the caller graph for this function:

◆ getValue()

const QString & getValue ( ) const
inlinenoexcept
+ Here is the caller graph for this function:

◆ getValueTr()

QString getValueTr ( bool  showUnit) const
noexcept

◆ setKey()

bool setKey ( const AttributeKey key)
noexcept
+ Here is the caller graph for this function:

◆ setTypeValueUnit()

bool setTypeValueUnit ( const AttributeType type,
const QString &  value,
const AttributeUnit unit 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ serialize()

void serialize ( SExpression root) const

Serialize into librepcb::SExpression node.

Parameters
rootRoot node to serialize into.
+ Here is the call graph for this function:

◆ operator==()

bool operator== ( const Attribute rhs) const
noexcept

◆ operator!=()

bool operator!= ( const Attribute rhs) const
inlinenoexcept

◆ operator=()

Attribute & operator= ( const Attribute rhs)
noexcept

◆ checkAttributesValidity()

bool checkAttributesValidity ( ) const
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ onEdited

Signal<Attribute, Event> onEdited

◆ mKey

AttributeKey mKey
private

◆ mType

const AttributeType* mType
private

◆ mValue

QString mValue
private

◆ mUnit

const AttributeUnit* mUnit
private

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