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

The Attribute class. More...

#include <attribute.h>

+ Inheritance diagram for Attribute:
+ Collaboration diagram for Attribute:

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
 
void setKey (const AttributeKey &key) noexcept
 
void setTypeValueUnit (const AttributeType &type, const QString &value, const AttributeUnit *unit)
 
void serialize (SExpression &root) const override
 Serialize the object into an existing S-Expression node. More...
 
bool operator== (const Attribute &rhs) const noexcept
 
bool operator!= (const Attribute &rhs) const noexcept
 
Attributeoperator= (const Attribute &rhs)=delete
 
- Public Member Functions inherited from SerializableObject
 SerializableObject () noexcept
 
virtual ~SerializableObject () noexcept
 
SExpression serializeToDomElement (const QString &name) const
 Serialize the object to a new S-Expression node. More...
 

Private Member Functions

bool checkAttributesValidity () const noexcept
 

Private Attributes

AttributeKey mKey
 
const AttributeTypemType
 
QString mValue
 
const AttributeUnitmUnit
 

Additional Inherited Members

- Static Public Member Functions inherited from SerializableObject
template<typename T >
static void serializeObjectContainer (SExpression &root, const T &container, const QString &itemName)
 
template<typename T >
static void serializePointerContainer (SExpression &root, const T &container, const QString &itemName)
 
template<typename T >
static void serializePointerContainerUuidSorted (SExpression &root, const T &container, const QString &itemName)
 

Detailed Description

The Attribute class.

Constructor & Destructor Documentation

Attribute ( )
delete
Attribute ( const Attribute other)
noexcept
Attribute ( const SExpression node)
explicit

+ Here is the call graph for this function:

Attribute ( const AttributeKey key,
const AttributeType type,
const QString &  value,
const AttributeUnit unit 
)

+ Here is the call graph for this function:

~Attribute ( )
noexcept

Member Function Documentation

const AttributeKey& getKey ( ) const
inlinenoexcept

+ Here is the caller graph for this function:

const QString& getName ( ) const
inlinenoexcept
const AttributeType& getType ( ) const
inlinenoexcept

+ Here is the caller graph for this function:

const AttributeUnit* getUnit ( ) const
inlinenoexcept

+ Here is the caller graph for this function:

const QString& getValue ( ) const
inlinenoexcept

+ Here is the caller graph for this function:

QString getValueTr ( bool  showUnit) const
noexcept
void setKey ( const AttributeKey key)
inlinenoexcept

+ Here is the caller graph for this function:

void 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:

void serialize ( SExpression root) const
overridevirtual

Serialize the object into an existing S-Expression node.

This method inserts/appends all attributes and childs of the object to an existing S-Expression node. The content which already exists in the given S-Expression node will not be removed.

Note
The generated S-Expression node has always the format of the application's major version (it's not possible to generate DOMs of older versions).
Parameters
rootThe target DOM root node
Exceptions
ExceptionThis method throws an exception if an error occurs.

Implements SerializableObject.

+ Here is the call graph for this function:

bool operator== ( const Attribute rhs) const
noexcept
bool operator!= ( const Attribute rhs) const
inlinenoexcept
Attribute& operator= ( const Attribute rhs)
delete
bool checkAttributesValidity ( ) const
privatenoexcept

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

AttributeKey mKey
private
const AttributeType* mType
private
QString mValue
private
const AttributeUnit* mUnit
private

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