Represents a single component in the library in hierarchy view.
More...
#include <hierarchyitem.h>
|
void | errorMessage (QString const &msg) |
| Send an error message to be printed to user.
|
|
void | noticeMessage (QString const &msg) |
| Send a notification to be printed to user.
|
|
Represents a single component in the library in hierarchy view.
Definition at line 38 of file hierarchyitem.h.
◆ ObjectType
Defines the type of the hierarchy item.
Enumerator |
---|
ROOT | |
COMPONENT | |
BUSDEFINITION | |
ABSDEFINITION | |
COMDEFINITION | |
APIDEFINITION | |
HW_DESIGN | |
SW_DESIGN | |
SYS_DESIGN | |
CATALOG | |
Definition at line 45 of file hierarchyitem.h.
◆ HierarchyItem() [1/2]
HierarchyItem::HierarchyItem |
( |
LibraryInterface * | handler, |
|
|
HierarchyItem * | parent, |
|
|
VLNV const & | vlnv, |
|
|
KactusAttribute::Implementation | implementation = KactusAttribute::KTS_IMPLEMENTATION_COUNT, |
|
|
QString const & | viewName = QString() ) |
The constructor
- Parameters
-
[in] | handler | The instance that manages the library. |
[in] | parent | The owner of this object. |
[in] | vlnv | The vlnv to construct the item for. |
[in] | implementation | The implementation attribute needed by designs. |
[in] | viewName | The name of the view the design belongs to. |
◆ HierarchyItem() [2/2]
The constructor for the root item.
This constructor should only be used to create the root item and no other hierarchy items.
- Parameters
-
[in] | handler | The instance that manages the library. |
[in] | parent | The owner of this item. |
◆ ~HierarchyItem()
virtual HierarchyItem::~HierarchyItem |
( |
| ) |
|
|
virtualdefault |
◆ child()
Get pointer to the child item with given index.
If child with given index does not exist then return null pointer.
- Parameters
-
[in] | index | Row number of the child that's pointer is wanted. |
- Returns
- HierarchyItem*
◆ cleanUp()
void HierarchyItem::cleanUp |
( |
| ) |
|
Removes the child items that are contained in one or several other components.
Note: This function should be called only for the root item.
- Returns
- void
◆ clear()
void HierarchyItem::clear |
( |
| ) |
|
Remove all children from item.
◆ component()
QSharedPointer< Component const > HierarchyItem::component |
( |
| ) |
const |
Get pointer to the component that this item represents
- Returns
- QSharedPointer<Component> The component model.
◆ contains()
bool HierarchyItem::contains |
( |
const VLNV & | vlnv | ) |
const |
Checks if the component or one of it's sub-components contains the vlnv.
- Parameters
-
[in] | vlnv | The vlnv that is searched in hierarchy. |
- Returns
- bool True if the vlnv is found.
◆ countInstances()
int HierarchyItem::countInstances |
( |
const VLNV & | componentVLNV | ) |
|
|
protected |
Count the number of instances for the given vlnv.
- Parameters
-
[in] | componentVLNV | The vlnv of the component that's instance count is counted. |
- Returns
- The number of instantiation times.
◆ createChild()
void HierarchyItem::createChild |
( |
const VLNV & | vlnv | ) |
|
Create a child for the HierarchyItem that represents the given VLNV.
This function should only be called for the root item to create the tree.
- Parameters
-
[in] | vlnv | Identifies the component to represent. |
◆ errorMessage
void HierarchyItem::errorMessage |
( |
QString const & | msg | ) |
|
|
signal |
Send an error message to be printed to user.
◆ findItems()
QVector< HierarchyItem * > HierarchyItem::findItems |
( |
const VLNV & | vlnv | ) |
|
Find the hierarchyItems that represent the given vlnv.
- Parameters
-
[in] | vlnv | Identifies the items. |
- Returns
- QList<HierarchyItem*> contains pointers to the hierarchy items.
◆ getChildItems()
void HierarchyItem::getChildItems |
( |
QList< VLNV > & | itemList | ) |
const |
Get the vlnvs of the items that are this item's children.
- Parameters
-
[in] | itemList | The list where the vlnvs are appended to. |
◆ getChildren()
void HierarchyItem::getChildren |
( |
QList< VLNV > & | childList, |
|
|
const VLNV & | owner ) const |
Get the child items of given object.
This function must only be called to the root item.
- Parameters
-
[in] | childList | The list where the vlnvs of the children are appended. |
[in] | owner | Identifies the object that's children are searched. |
◆ getImplementation()
KactusAttribute::Implementation HierarchyItem::getImplementation |
( |
| ) |
const |
Get the implementation of this item.
Note: This function can only be called for items of type component.
- Returns
- KactusAttribute::Implementation Specifies the implementation.
◆ getIndexOf()
Get the index of specified item.
- Parameters
-
- Returns
- The row number of given item. Returns -1 if item is not found.
◆ getNumberOfChildren()
int HierarchyItem::getNumberOfChildren |
( |
| ) |
const |
Get the number of children this item has.
- Returns
- The number of child items this item has.
◆ getOwners()
int HierarchyItem::getOwners |
( |
QList< VLNV > & | list, |
|
|
const VLNV & | vlnvToSearch ) const |
Get list of objects that have instantiated the given vlnv.
This function makes sure each owner is appended to the list only once.
- Parameters
-
[out] | list | QList where owner vlnvs is appended. |
[in] | vlnvToSearch | The vlnv to that's parents are wanted. |
- Returns
- Number of unique owners found.
◆ getViewName()
QString HierarchyItem::getViewName |
( |
| ) |
const |
Get the name of the view the design belongs to.
If type() is other than design an empty string is returned.
- Returns
- QString containing the view name.
◆ getVLNV()
VLNV const & HierarchyItem::getVLNV |
( |
| ) |
const |
Get the vlnv of this item.
- Returns
- VLNV of the component this item represents.
◆ getVLNVs()
QVector< VLNV > HierarchyItem::getVLNVs |
( |
| ) |
const |
Get the list of vlnvs this item and it's parents contain.
- Returns
- QList<VLNV> contains the list of vlnvs
◆ hasChildren()
bool HierarchyItem::hasChildren |
( |
| ) |
const |
Check if this item has children or not.
- Returns
- True if at least one child item exists.
◆ hasParent()
bool HierarchyItem::hasParent |
( |
const VLNV & | vlnv | ) |
|
Checks if the item has parent on some hierarchy-level with given vlnv.
Function does not just search the direct parent but the whole parent-chain up to the root item.
- Parameters
-
[in] | vlnv | Identifies the parent to search. |
- Returns
- bool True if parent with given vlnv is found.
◆ instanceCount()
int HierarchyItem::instanceCount |
( |
| ) |
const |
Count how many times this component has been instantiated in a containing design.
For items that are not components this function returns -1
- Returns
- The instance count in the containing design.
◆ isDuplicate()
bool HierarchyItem::isDuplicate |
( |
| ) |
const |
Check if this item is instantiated in some item or not.
- Returns
- bool true if item is contained as some item's child.
◆ isHierarchical()
bool HierarchyItem::isHierarchical |
( |
| ) |
const |
Checks if the component this item represents is hierarchical or not.
- Returns
- bool true if the component is hierarchical.
◆ isRoot()
bool HierarchyItem::isRoot |
( |
| ) |
const |
Check if this is the root item or not.
- Returns
- bool True if this is the root item.
◆ isValid()
bool HierarchyItem::isValid |
( |
| ) |
const |
Check if this item is valid or not.
- Returns
- True if item is valid.
◆ noticeMessage
void HierarchyItem::noticeMessage |
( |
QString const & | msg | ) |
|
|
signal |
Send a notification to be printed to user.
◆ parent()
Get the parent of this item.
- Returns
- The parent of this item
◆ parentIsRoot()
bool HierarchyItem::parentIsRoot |
( |
| ) |
const |
Check if the parent of this item is the root item.
- Returns
- bool true if the parent item is root item. If this is the root or parent is normal item then returns false.
◆ referenceCount()
int HierarchyItem::referenceCount |
( |
const VLNV & | vlnv | ) |
const |
Count how many instances of given vlnv is found under this item.
This function does not check if the same owner is counted multiple times if same sub-component is instantiated in several components. If count that contains only unique owners then you should use getOwners().
- Parameters
-
[in] | vlnv | Identifies the component that's instances are searched. |
- Returns
- Number of found instances.
◆ removeItems()
int HierarchyItem::removeItems |
( |
const VLNV & | vlnv | ) |
|
Remove the child items with given vlnv.
- Parameters
-
[in] | vlnv | Identifies the items to remove. |
- Returns
- Amount of child items removed from this item.
◆ row()
int HierarchyItem::row |
( |
| ) |
|
Get the row number of this item on this item's parent.
- Returns
- The row number.
◆ setDuplicate()
void HierarchyItem::setDuplicate |
( |
bool | isDuplicate | ) |
|
Set the duplicate value for this item.
- Parameters
-
[in] | isDuplicate | If true then this item is set as duplicate. |
◆ setValidity()
void HierarchyItem::setValidity |
( |
bool | valid | ) |
|
Set the validity of this item.
- Parameters
-
[in] | valid | Sets the valid value of the item. |
◆ type()
Get the type of this hierarchy item.
- Returns
- ObjectType defines the type of the item.
◆ updateItems()
void HierarchyItem::updateItems |
( |
const VLNV & | vlnv | ) |
|
Update hierarchy items with given vlnv.
- Parameters
-
[in] | vlnv | Identifies the objects to update. |
The documentation for this class was generated from the following file: