Kactus2
Kactus2 reference guide
Loading...
Searching...
No Matches
LibraryItem Class Reference

LibraryItem class is used to create the hierarchical structure of IP library. More...

#include <LibraryItem.h>

Inheritance diagram for LibraryItem:

Public Types

enum class  Level {
  ROOT = 0 , VENDOR , LIBRARY , NAME ,
  VERSION
}
 

Public Member Functions

 LibraryItem (QObject *parent)
 
 LibraryItem (VLNV const &vlnv, Level level, LibraryItem *parent)
 
virtual ~LibraryItem ()
 The destructor of the class LibraryItem.
 
LibraryItemchild (int index) const
 
void clear ()
 Remove the children of this item.
 
void createChild (VLNV const &vlnv, Level level)
 
LibraryItemfindHighestUnique (LibraryItem *childItem=0)
 
LibraryItemfindHighestUnique (VLNV const &vlnv)
 
LibraryItemfindItem (VLNV const &vlnv)
 
int getIndexOf (LibraryItem *item)
 
Level getLevel () const
 
QVector< LibraryItem * > getLibraries () const
 
QVector< LibraryItem * > getNames () const
 
int getNumberOfChildren () const
 
QVector< LibraryItem * > getVendors () const
 
QVector< LibraryItem * > getVersions () const
 
VLNV getVLNV () const
 
QVector< VLNV > getVLNVs () const
 
bool hasChildren () const
 
bool isValid () const
 
QString name () const
 
LibraryItemparent () const
 
void removeChild (LibraryItem *childItem)
 
int row ()
 
void setValid (bool valid)
 
void setVlnv (VLNV &vlnv)
 

Detailed Description

LibraryItem class is used to create the hierarchical structure of IP library.

Definition at line 26 of file LibraryItem.h.

Member Enumeration Documentation

◆ Level

enum class LibraryItem::Level
strong

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.

Constructor & Destructor Documentation

◆ 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]vlnvA VLNV tag that is to be added to database.
[in]levelThe level of the item in the hierarchy.
[in]parentThe parent of this item.

◆ ~LibraryItem()

virtual LibraryItem::~LibraryItem ( )
virtual

The destructor of the class LibraryItem.

Member Function Documentation

◆ child()

LibraryItem * LibraryItem::child ( int index) const

Get the child item.

Parameters
[in]indexindex 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]vlnvA VLNV tag that is to be added to database.
[in]levelThe level of the item in the hierarchy.

◆ findHighestUnique() [1/2]

LibraryItem * LibraryItem::findHighestUnique ( LibraryItem * childItem = 0)

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]childItemThe 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]vlnvThe 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]vlnvThe vlnv that identifies the item to find.
Returns
The LibraryItem that represents the vlnv in the tree.

◆ getIndexOf()

int LibraryItem::getIndexOf ( LibraryItem * item)

Get the index of the specified item.

Parameters
[in]itemThe 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.
Remarks
Valid VLNV pointer can only be returned if this item is level VERSION.

◆ 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()

LibraryItem * LibraryItem::parent ( ) const

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]childItemThe child item that should be removed.

◆ row()

int LibraryItem::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]validThe validity to set.

◆ setVlnv()

void LibraryItem::setVlnv ( VLNV & vlnv)

Set the vlnv to match the tree structure of this item

Parameters
[out]vlnvThe vlnv instance to set.

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