Class ReportDatabase (version 0.20)

Description: The report database object

A report database is organised around a set of items which are associated with cells and categories. Categories can be organised hierarchically by created sub-categories of other categories. Cells are associated with layout database cells and can come with a example instantiation if the layout database does not allow a unique association of the cells. Items in the database can have a variety of attributes: values, tags and an image object. Values are geometrical objects for example. Tags are a set of boolean flags and an image can be attached to an item to provide a screenshot for visualisation for example. This is the main report database object. The basic use case of this object is to create one inside a LayoutView and populate it with items, cell and categories or load it from a file. Another use case is to create a standalone ReportDatabase object and use the methods provided to perform queries or to populate it.

Class overview

Index

Method Overview

[static] ReportDatabase new( string name )Create a report database
[const] string descriptionGets the databases description
description=( string desc )Sets the databases description
[const] string generatorGets the databases generator
generator=( string generator )Sets the generator string
[const] string filenameGets the file name and path where the report database is stored
[const] string nameGets the database name
[const] string top_cell_nameGets the top cell name
top_cell_name=( string cell_name )Sets the top cell name string
[const] string original_fileGets the original file name and path
original_file=( string path )Sets the original file name and path
[const] unsigned int tag_id( string name )Gets the tag ID for a given tag name
set_tag_description( unsigned int tag_id, string description )Sets the tag description for the given tag ID
[const] string tag_description( unsigned int tag_id )Gets the tag description for the given tag ID
[const] yield const ref RdbCategory each_categoryIterates over all top-level categories
ref RdbCategory create_category( string name )Creates a new top level category
ref RdbCategory create_category( ref RdbCategory parent, string name )Creates a new sub-category
[const] const ref RdbCategory category_by_path( string path )Gets a category by path
[const] const ref RdbCategory category_by_id( unsigned int id )Gets a category by ID
ref RdbCell create_cell( string name )Creates a new cell
ref RdbCell create_cell( string name, string variant )Creates a new cell, potentially as a variant for a cell with the same name
unsigned int[ ] variants( string name )Gets the variants for a given cell name
[const] const ref RdbCell cell_by_qname( string qname )Returns the cell for a given qualified name
[const] const ref RdbCell cell_by_id( unsigned int id )Returns the cell for a given ID
[const] yield const ref RdbCell each_cellIterates over all cells
[const] unsigned int num_itemsReturns the number of items inside the database
[const] unsigned int num_items_visitedReturns the number of items already visited inside the database
[const] unsigned int num_items( unsigned int cell_id, unsigned int category_id )Returns the number of items inside the database for a given cell/category combination
[const] unsigned int num_items_visited( unsigned int cell_id, unsigned int category_id )Returns the number of items visited already for a given cell/category combination
ref RdbItem create_item( unsigned int cell_id, unsigned int category_id )Creates a new item for the given cell/category combination
[const] bool is_modified?Returns a value indicating whether the database has been modified
reset_modifiedReset the modified flag
[const] yield const ref RdbItem each_itemIterates over all iterms inside the database
[const] yield const ref RdbItem each_item_per_cell( unsigned int cell_id )Iterates over all iterms inside the database which are associated with the given cell
[const] yield const ref RdbItem each_item_per_category( unsigned int category_id )Iterates over all iterms inside the database which are associated with the given category
[const] yield const ref RdbItem each_item_per_cell_and_category( unsigned int cell_id, unsigned int category_id )Iterates over all iterms inside the database which are associated with the given cell and category
set_item_visited( RdbItem item, bool visited )Modifies the visited state of an item
load( string filename )Loads the database from the given file
save( string filename )Saves the database to the given file
destroyExplicitly destroy the object
[const] bool destroyedTell, if the object was destroyed

[const] const ref RdbCategory category_by_id( unsigned int id )

Description: Gets a category by ID

returns:The (const) category object or nil if the ID is not valid

[const] const ref RdbCategory category_by_path( string path )

Description: Gets a category by path

path:The full path to the category starting from the top level (subcategories separated by dots)
returns:The (const) category object or nil if the name is not valid

[const] const ref RdbCell cell_by_id( unsigned int id )

Description: Returns the cell for a given ID

id:The ID of the cell
returns:The cell object or nil if no cell with that ID exists

[const] const ref RdbCell cell_by_qname( string qname )

Description: Returns the cell for a given qualified name

qname:The qualified name of the cell (name plus variant name optionally)
returns:The cell object or nil if no such cell exists

ref RdbCategory create_category( string name )

Description: Creates a new top level category

name:The name of the category

ref RdbCategory create_category( ref RdbCategory parent, string name )

Description: Creates a new sub-category

parent:The category under which the category should be created
name:The name of the category

ref RdbCell create_cell( string name, string variant )

Description: Creates a new cell, potentially as a variant for a cell with the same name

name:The name of the cell
variant:The variant name of the cell

ref RdbCell create_cell( string name )

Description: Creates a new cell

name:The name of the cell

ref RdbItem create_item( unsigned int cell_id, unsigned int category_id )

Description: Creates a new item for the given cell/category combination

cell_id:The ID of the cell to which the item is associated
category_id:The ID of the category to which the item is associated

[const] string description

Description: Gets the databases description

The description is a general purpose string that is supposed to further describe the database and it's content in a human-readable form.

returns:The description string

description=( string desc )

Description: Sets the databases description

desc:The description string

destroy

Description: Explicitly destroy the object

Explicitly destroy the object on C++ side if it was owned by the Ruby interpreter. Subsequent access to this object will throw an exception. If the object is not owned by Ruby, this method will do nothing.

[const] bool destroyed

Description: Tell, if the object was destroyed

This method returns true, if the object was destroyed, either explicitly or by the C++ side. The latter may happen, if the object is owned by a C++ object which got destroyed itself.

[const] yield const ref RdbCategory each_category

Description: Iterates over all top-level categories

[const] yield const ref RdbCell each_cell

Description: Iterates over all cells

[const] yield const ref RdbItem each_item

Description: Iterates over all iterms inside the database

[const] yield const ref RdbItem each_item_per_category( unsigned int category_id )

Description: Iterates over all iterms inside the database which are associated with the given category

category_id:The ID of the category for which all associated items should be retrieved

[const] yield const ref RdbItem each_item_per_cell( unsigned int cell_id )

Description: Iterates over all iterms inside the database which are associated with the given cell

cell_id:The ID of the cell for which all associated items should be retrieved

[const] yield const ref RdbItem each_item_per_cell_and_category( unsigned int cell_id, unsigned int category_id )

Description: Iterates over all iterms inside the database which are associated with the given cell and category

cell_id:The ID of the cell for which all associated items should be retrieved
category_id:The ID of the category for which all associated items should be retrieved

[const] string filename

Description: Gets the file name and path where the report database is stored

This property is set when a database is saved or loaded. It cannot be set manually.

returns:The file name and path

[const] string generator

Description: Gets the databases generator

The generator string describes how the database was created, i.e. DRC tool name and tool options. In a later version this should allow to rerun the tool that created the report.

returns:The generator string

generator=( string generator )

Description: Sets the generator string

generator:The generator string

[const] bool is_modified?

Description: Returns a value indicating whether the database has been modified

load( string filename )

Description: Loads the database from the given file

The reader recognizes the format automatically and will choose the appropriate decoder. 'gzip' compressed files are uncompressed automatically.

filename:The file from which to load the database

[const] string name

Description: Gets the database name

The name of the database is supposed to identify the database within a layout view context. The name is modified to be unique when a database is entered into a layout view.

returns:The database name

[static] ReportDatabase new( string name )

Description: Create a report database

The name of the database will be used in the user interface to refer to a certain database.

name:The name of the database

[const] unsigned int num_items

Description: Returns the number of items inside the database

returns:The total number of items

[const] unsigned int num_items( unsigned int cell_id, unsigned int category_id )

Description: Returns the number of items inside the database for a given cell/category combination

cell_id:The ID of the cell for which to retrieve the number
category_id:The ID of the category for which to retrieve the number
returns:The total number of items for the given cell and the given category

[const] unsigned int num_items_visited( unsigned int cell_id, unsigned int category_id )

Description: Returns the number of items visited already for a given cell/category combination

cell_id:The ID of the cell for which to retrieve the number
category_id:The ID of the category for which to retrieve the number
returns:The total number of items visited for the given cell and the given category

[const] unsigned int num_items_visited

Description: Returns the number of items already visited inside the database

returns:The total number of items already visited

[const] string original_file

Description: Gets the original file name and path

The original file name is supposed to describe the file from which this report database was generated.

returns:The original file name and path

original_file=( string path )

Description: Sets the original file name and path

path:The path

reset_modified

Description: Reset the modified flag

save( string filename )

Description: Saves the database to the given file

The database is always saved in KLayout's XML-based format.

filename:The file to which to save the database

set_item_visited( RdbItem item, bool visited )

Description: Modifies the visited state of an item

item:The item to modify
visited:True to set the item to visited state, false otherwise

set_tag_description( unsigned int tag_id, string description )

Description: Sets the tag description for the given tag ID

tag_id:The ID of the tag
description:The description string

[const] string tag_description( unsigned int tag_id )

Description: Gets the tag description for the given tag ID

tag_id:The ID of the tag
returns:The description string

[const] unsigned int tag_id( string name )

Description: Gets the tag ID for a given tag name

This method will always succeed and the tag will be created if it does not exist yet.

name:The tag name
returns:The corresponding tag ID

[const] string top_cell_name

Description: Gets the top cell name

The top cell name identifies the top cell of the design for which the report was generated. This property must be set to establish a proper hierarchical context for a hierarchical report database.

returns:The top cell name

top_cell_name=( string cell_name )

Description: Sets the top cell name string

cell_name:The top cell name

unsigned int[ ] variants( string name )

Description: Gets the variants for a given cell name

name:The basic name of the cell
returns:An array of ID's representing cells that are variants for the given base name