LibraryItem class is used to create the hierarchical structure of IP library.
More...
#include <LibraryItem.h>
LibraryItem class is used to create the hierarchical structure of IP library.
Definition at line 26 of file LibraryItem.h.
◆ Level
enum Level is used in constructing new items in library.
Level is used to tell what information to use from VLNV tag in creating new component in hierarchy.
Enumerator |
---|
ROOT | |
VENDOR | |
LIBRARY | |
NAME | |
VERSION | |
Definition at line 36 of file LibraryItem.h.
◆ LibraryItem() [1/2]
LibraryItem::LibraryItem |
( |
QObject * | parent | ) |
|
The default constructor.
@remark Only used when creating a root item for a tree structure.
◆ LibraryItem() [2/2]
LibraryItem::LibraryItem |
( |
VLNV const & | vlnv, |
|
|
Level | level, |
|
|
LibraryItem * | parent ) |
The constructor
- Parameters
-
[in] | vlnv | A VLNV tag that is to be added to database. |
[in] | level | The level of the item in the hierarchy. |
[in] | parent | The parent of this item. |
◆ ~LibraryItem()
virtual LibraryItem::~LibraryItem |
( |
| ) |
|
|
virtual |
◆ child()
Get the child item.
- Parameters
-
[in] | index | index of the child item. |
- Returns
- The child.
◆ clear()
void LibraryItem::clear |
( |
| ) |
|
Remove the children of this item.
◆ createChild()
void LibraryItem::createChild |
( |
VLNV const & | vlnv, |
|
|
Level | level ) |
Create a new child for an existing item.
- Parameters
-
[in] | vlnv | A VLNV tag that is to be added to database. |
[in] | level | The level of the item in the hierarchy. |
◆ findHighestUnique() [1/2]
Find the highest level LibraryItem that still identifies a single item.
This function checks if there are other children. If no other children are found then this function calls parent item to check if it can be used to identify a single item.
- Parameters
-
[in] | childItem | The item that is currently the highest possible item. |
- Returns
- LibraryItem* The item that is to be removed.
◆ findHighestUnique() [2/2]
LibraryItem * LibraryItem::findHighestUnique |
( |
VLNV const & | vlnv | ) |
|
Find the highest level LibraryItem that still identifies a single item.
This function finds the highest level possible to identify a single item.
- Parameters
-
[in] | vlnv | The vlnv element that must be matched. |
- Returns
- The item that is the highest level item.
◆ findItem()
LibraryItem * LibraryItem::findItem |
( |
VLNV const & | vlnv | ) |
|
Find the library item that uniquely represents the specified vlnv.
- Parameters
-
[in] | vlnv | The vlnv that identifies the item to find. |
- Returns
- The LibraryItem that represents the vlnv in the tree.
◆ getIndexOf()
Get the index of the specified item.
- Parameters
-
[in] | item | The library item that's row number is searched. |
- Returns
- The row number of the specified item.
◆ getLevel()
Level LibraryItem::getLevel |
( |
| ) |
const |
Get the level of the item in the hierarchy.
- Returns
- The level the item is in.
◆ getLibraries()
QVector< LibraryItem * > LibraryItem::getLibraries |
( |
| ) |
const |
Get all library items.
- Returns
- All library items under this item.
◆ getNames()
QVector< LibraryItem * > LibraryItem::getNames |
( |
| ) |
const |
Get all name items.
- Returns
- All name items under this item.
◆ getNumberOfChildren()
int LibraryItem::getNumberOfChildren |
( |
| ) |
const |
Get the number of child items the item has.
- Returns
- How many children item owns.
◆ getVendors()
QVector< LibraryItem * > LibraryItem::getVendors |
( |
| ) |
const |
Get all vendor items.
- Returns
- All vendor items under this item.
◆ getVersions()
QVector< LibraryItem * > LibraryItem::getVersions |
( |
| ) |
const |
Get all version items.
- Returns
- All version items under this item.
◆ getVLNV()
VLNV LibraryItem::getVLNV |
( |
| ) |
const |
Get the VLNV tag of this item.
- Returns
- A VLNV instance that is represented by this item.
◆ getVLNVs()
QVector< VLNV > LibraryItem::getVLNVs |
( |
| ) |
const |
Get list of all VLNV tags that exist under this item.
- Returns
- List of all VLNVs.
◆ hasChildren()
bool LibraryItem::hasChildren |
( |
| ) |
const |
Check if this item has children or not.
- Returns
- True if item has child-items, otherwise false.
◆ isValid()
bool LibraryItem::isValid |
( |
| ) |
const |
Checks if the item is valid.
- Returns
- True, if the item is valid, otherwise false.
◆ name()
QString LibraryItem::name |
( |
| ) |
const |
Get the name of the item.
- Returns
- The name of the item.
◆ parent()
Get the parent of the current node.
- Returns
- The parent of the item.
◆ removeChild()
void LibraryItem::removeChild |
( |
LibraryItem * | childItem | ) |
|
Remove a child of this item.
- Parameters
-
[in] | childItem | The child item that should be removed. |
◆ row()
Get the row number of the child item.
- Returns
- The row number where the item is located in its parents list.
◆ setValid()
void LibraryItem::setValid |
( |
bool | valid | ) |
|
Sets the validity of the item.
- Parameters
-
[in] | valid | The validity to set. |
◆ setVlnv()
void LibraryItem::setVlnv |
( |
VLNV & | vlnv | ) |
|
Set the vlnv to match the tree structure of this item
- Parameters
-
[out] | vlnv | The vlnv instance to set. |
The documentation for this class was generated from the following file: