te::qt::widgets::SymbolLibrary Class Reference

This class represents a library of symbols. More...

#include <SymbolLibrary.h>

Public Member Functions

void addGroup (SymbolNode *group, const std::string &groupParentId="")
 It inserts a new symbol to this library. More...
 
void addSymbol (Symbol *symbol, const std::string &groupParentId="")
 It inserts a new symbol to this library. More...
 
void eraseGroup (SymbolNode *group)
 It removes the symbol from this library. More...
 
void eraseSymbol (Symbol *symbol)
 It removes the symbol from this library. More...
 
SymbolNodefindGroupById (const std::string &id) const
 It returns the symbol identified by a given id or NULL if none is found. More...
 
SymbolNodefindParentBySymbolId (const std::string &id)
 It returns the symbol identified by a given id or NULL if none is found. More...
 
SymbolfindSymbolById (const std::string &id) const
 It returns the symbol identified by a given id or NULL if none is found. More...
 
const std::string & getName () const
 
SymbolNodegetRoot () const
 
bool isEmpty ()
 
SymbolNoderemoveGroup (SymbolNode *group)
 It removes the symbol from this library. More...
 
SymbolremoveSymbol (Symbol *symbol)
 It removes the symbol from this library. More...
 
bool swapGroup (const std::string &id, const std::string &toParentId)
 
bool swapSymbol (const std::string &id, const std::string &toParentId)
 
 SymbolLibrary (const std::string &name)
 Constructor. More...
 
std::string version ()
 
virtual ~SymbolLibrary ()
 Destructor. More...
 

Private Attributes

std::string m_name
 The name of the symbol library. More...
 
std::unique_ptr< SymbolNodem_root
 
std::string m_version
 

Detailed Description

This class represents a library of symbols.

See also
Symbol, SymbolLibaryManager

Definition at line 54 of file SymbolLibrary.h.

Constructor & Destructor Documentation

◆ SymbolLibrary()

te::qt::widgets::SymbolLibrary::SymbolLibrary ( const std::string &  name)

Constructor.

◆ ~SymbolLibrary()

virtual te::qt::widgets::SymbolLibrary::~SymbolLibrary ( )
virtual

Destructor.

Member Function Documentation

◆ addGroup()

void te::qt::widgets::SymbolLibrary::addGroup ( SymbolNode group,
const std::string &  groupParentId = "" 
)

It inserts a new symbol to this library.

Parameters
symbolThe new symbol that will be added to this library.

◆ addSymbol()

void te::qt::widgets::SymbolLibrary::addSymbol ( Symbol symbol,
const std::string &  groupParentId = "" 
)

It inserts a new symbol to this library.

Parameters
symbolThe new symbol that will be added to this library.

◆ eraseGroup()

void te::qt::widgets::SymbolLibrary::eraseGroup ( SymbolNode group)

It removes the symbol from this library.

Parameters
symbolThe symbol to be removed.
Exceptions
ExceptionIf the symbol doesn't exist it will raise an exception.

◆ eraseSymbol()

void te::qt::widgets::SymbolLibrary::eraseSymbol ( Symbol symbol)

It removes the symbol from this library.

Parameters
symbolThe symbol to be removed.
Exceptions
ExceptionIf the symbol doesn't exist it will raise an exception.

◆ findGroupById()

SymbolNode* te::qt::widgets::SymbolLibrary::findGroupById ( const std::string &  id) const

It returns the symbol identified by a given id or NULL if none is found.

Parameters
nameThe id of the symbol we are looking for.
Returns
A pointer to a symbol or NULL if none is found.

◆ findParentBySymbolId()

SymbolNode* te::qt::widgets::SymbolLibrary::findParentBySymbolId ( const std::string &  id)

It returns the symbol identified by a given id or NULL if none is found.

Parameters
nameThe id of the symbol we are looking for.
Returns
A pointer to a symbol or NULL if none is found.

◆ findSymbolById()

Symbol* te::qt::widgets::SymbolLibrary::findSymbolById ( const std::string &  id) const

It returns the symbol identified by a given id or NULL if none is found.

Parameters
nameThe id of the symbol we are looking for.
Returns
A pointer to a symbol or NULL if none is found.

◆ getName()

const std::string& te::qt::widgets::SymbolLibrary::getName ( ) const

◆ getRoot()

SymbolNode* te::qt::widgets::SymbolLibrary::getRoot ( ) const

◆ isEmpty()

bool te::qt::widgets::SymbolLibrary::isEmpty ( )

◆ removeGroup()

SymbolNode* te::qt::widgets::SymbolLibrary::removeGroup ( SymbolNode group)

It removes the symbol from this library.

Parameters
symbolThe symbol to be removed.
Exceptions
ExceptionIf the symbol doesn't exist it will raise an exception.

◆ removeSymbol()

Symbol* te::qt::widgets::SymbolLibrary::removeSymbol ( Symbol symbol)

It removes the symbol from this library.

Parameters
symbolThe symbol to be removed.
Exceptions
ExceptionIf the symbol doesn't exist it will raise an exception.

◆ swapGroup()

bool te::qt::widgets::SymbolLibrary::swapGroup ( const std::string &  id,
const std::string &  toParentId 
)

◆ swapSymbol()

bool te::qt::widgets::SymbolLibrary::swapSymbol ( const std::string &  id,
const std::string &  toParentId 
)

◆ version()

std::string te::qt::widgets::SymbolLibrary::version ( )

Member Data Documentation

◆ m_name

std::string te::qt::widgets::SymbolLibrary::m_name
private

The name of the symbol library.

Definition at line 155 of file SymbolLibrary.h.

◆ m_root

std::unique_ptr<SymbolNode> te::qt::widgets::SymbolLibrary::m_root
private

Definition at line 156 of file SymbolLibrary.h.

◆ m_version

std::string te::qt::widgets::SymbolLibrary::m_version
private

Definition at line 157 of file SymbolLibrary.h.


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