VICUS Library
Documentation of Vicus library
Loading...
Searching...
No Matches
VICUS::AbstractDBElement Class Referenceabstract

#include <VICUS_AbstractDBElement.h>

Inheritance diagram for VICUS::AbstractDBElement:
[legend]

Public Types

enum  ComparisonResult { Equal , OnlyMetaDataDiffers , Different }
 

Public Member Functions

 AbstractDBElement ()=default
 
 AbstractDBElement (unsigned int id, const IBK::MultiLanguageString &name)
 
virtual ~AbstractDBElement ()
 
virtual void readXML (const TiXmlElement *element)=0
 
virtual TiXmlElement * writeXML (TiXmlElement *parent) const =0
 
virtual ComparisonResult equal (const AbstractDBElement *other) const =0
 
void collectChildren (std::set< const AbstractDBElement * > &allChildrenRefs) const
 
void collectLocalChildren (std::set< AbstractDBElement * > &localChildrenRefs) const
 
const QString sourceName () const
 

Public Attributes

unsigned int m_id = INVALID_ID
 
IBK::MultiLanguageString m_displayName
 
QColor m_color
 
bool m_builtIn = false
 
bool m_local = true
 
std::set< AbstractDBElement * > m_childrenRefs
 
bool m_isReferenced = false
 
std::string m_errorMsg
 

Detailed Description

Abstract base class of all database elements, needed to have generic DB table model implementations. ID and display name are mandatory elements for each db element.

Member Enumeration Documentation

◆ ComparisonResult

Enumerator
Equal 

All parameters are identical (Caution: rounding errors!), except maybe the ID.

OnlyMetaDataDiffers 

All critical parameters are identical, yet some metadata (name etc.) may be different.

Different 

Objects are completely different (at least one critical parameter differs).

Constructor & Destructor Documentation

◆ AbstractDBElement() [1/2]

VICUS::AbstractDBElement::AbstractDBElement ( )
default

Default constructor.

◆ AbstractDBElement() [2/2]

VICUS::AbstractDBElement::AbstractDBElement ( unsigned int  id,
const IBK::MultiLanguageString &  name 
)
inline

Initializing constructor.

◆ ~AbstractDBElement()

VICUS::AbstractDBElement::~AbstractDBElement ( )
virtual

Virtual destructor, definition is in VICUS_Material.cpp.

Member Function Documentation

◆ collectChildren()

void VICUS::AbstractDBElement::collectChildren ( std::set< const AbstractDBElement * > &  allChildrenRefs) const

Collects all pointers to child elements

◆ collectLocalChildren()

void VICUS::AbstractDBElement::collectLocalChildren ( std::set< AbstractDBElement * > &  localChildrenRefs) const

Collects all pointers to child elements which are local

◆ equal()

◆ readXML()

virtual void VICUS::AbstractDBElement::readXML ( const TiXmlElement *  element)
pure virtual

Implemented in VICUS::SupplySystem.

◆ sourceName()

const QString VICUS::AbstractDBElement::sourceName ( ) const

Source name for display purposes.

◆ writeXML()

virtual TiXmlElement * VICUS::AbstractDBElement::writeXML ( TiXmlElement *  parent) const
pure virtual

Implemented in VICUS::SupplySystem.

Member Data Documentation

◆ m_builtIn

bool VICUS::AbstractDBElement::m_builtIn = false

If true, this is a built-in DB element and cannot be modified/removed.

◆ m_childrenRefs

std::set<AbstractDBElement*> VICUS::AbstractDBElement::m_childrenRefs

Pointer to elements which are referenced by this element

◆ m_color

QColor VICUS::AbstractDBElement::m_color

False-color for this DB element (optional, may not be necessary for all DB elements).

◆ m_displayName

IBK::MultiLanguageString VICUS::AbstractDBElement::m_displayName

The description text for this DB element.

◆ m_errorMsg

std::string VICUS::AbstractDBElement::m_errorMsg
mutable

Holds error string in order to give users a tooltip in db dialog.

◆ m_id

unsigned int VICUS::AbstractDBElement::m_id = INVALID_ID

Unique ID of this DB element.

◆ m_isReferenced

bool VICUS::AbstractDBElement::m_isReferenced = false
mutable

If true, this element is referenced in the current project

◆ m_local

bool VICUS::AbstractDBElement::m_local = true

Determines wether this element is kept local in the current project or should be stored into the userDB (false).


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