KLayout 0.29.8 (2024-11-26 926dac96c) [master]

API reference - Class Technology

Notation used in Ruby API documentation

Module: db

Description: Represents a technology

This class represents one technology from a set of technologies. The set of technologies available in the system can be obtained with technology_names. Individual technology definitions are returned with technology_by_name. Use create_technology to register new technologies and remove_technology to delete technologies.

Note that a Technology object needs to be registered in the system, before its name can be used to specify a technology, for example in Layout#technology_name. Technology objects created by create_technology are automatically registered. If you create a Technology object directly, you need to register it explicitly:

tech = RBA::Technology::new
tech.load("mytech.lyt")
RBA::Technology::register_technology(tech)

Note that in the latter example, an exception will be thrown if a technology with the same name already exists. Also note, that Technology#register will register a copy of the object, so modifying it after registration will not have any effect.

The Technology class has been introduced in version 0.25.

Public constructors

new Technology ptrnewCreates a new object of this class

Public methods

[const]Technology ptr_const_castReturns a non-const reference to self.
void_createEnsures the C++ object is created
void_destroyExplicitly destroys the object
[const]bool_destroyed?Returns a value indicating whether the object was already destroyed
[const]bool_is_const_object?Returns a value indicating whether the reference is a const reference
void_manageMarks the object as managed by the script side.
void_unmanageMarks the object as no longer owned by the script side.
voidadd_other_layers=(bool add)Sets the flag indicating whether to add other layers to the layer properties
[const]booladd_other_layers?Gets the flag indicating whether to add other layers to the layer properties
voidassign(const Technology other)Assigns another object to self
[const]stringbase_pathGets the base path of the technology
TechnologyComponent ptrcomponent(string name)Gets the technology component with the given name
[const]string[]component_namesGets the names of all components available for component
[const]stringcorrect_path(string path)Makes a file path relative to the base path if one is specified
[const]doubledbuGets the default database unit
voiddbu=(double dbu)Sets the default database unit
[const]stringdefault_base_pathGets the default base path
[const]doubledefault_gridGets the default grid
[const]double[]default_gridsGets the default grids
voiddefault_grids=(double[] grids)Sets the default grids
[const]stringdescriptionGets the description
voiddescription=(string description)Sets the description
[const]new Technology ptrdupCreates a copy of self
[const]stringeff_layer_properties_fileGets the effective path of the layer properties file
[const]stringeff_path(string path)Makes a file path relative to the base path if one is specified
[const]stringexplicit_base_pathGets the explicit base path
voidexplicit_base_path=(string path)Sets the explicit base path
[const]stringgroupGets the technology group
voidgroup=(string group)Sets the technology group
[const]stringlayer_properties_fileGets the path of the layer properties file
voidlayer_properties_file=(string file)Sets the path of the layer properties file
voidload(string file)Loads the technology definition from a file
[const]LoadLayoutOptionsload_layout_optionsGets the layout reader options
voidload_layout_options=(const LoadLayoutOptions options)Sets the layout reader options
[const]stringnameGets the name of the technology
voidname=(string name)Sets the name of the technology
[const]voidsave(string file)Saves the technology definition to a file
[const]SaveLayoutOptionssave_layout_optionsGets the layout writer options
voidsave_layout_options=(const SaveLayoutOptions options)Sets the layout writer options
voidset_default_grids(double[] grids,
double default_grid = 0)
Sets the default grids and the strong default one
[const]stringto_xmlReturns a XML representation of this technolog

Public static methods and constants

voidclear_technologiesClears all technologies
Technology ptrcreate_technology(string name)Creates a new (empty) technology with the given name
boolhas_technology?(string name)Returns a value indicating whether there is a technology with this name
Technology ptrregister_technology(const Technology tech)Registers a technology in the system
voidremove_technology(string name)Removes the technology with the given name from the system
voidtechnologies_from_xml(string xml)Loads the technologies from a XML representation
stringtechnologies_to_xmlReturns a XML representation of all technologies registered in the system
Technology ptrtechnology_by_name(string name)Gets the technology object for a given name
Technologytechnology_from_xml(string xml)Loads the technology from a XML representation
string[]technology_namesGets a list of technology names defined in the system

Deprecated methods (protected, public, static, non-static and constructors)

voidcreateUse of this method is deprecated. Use _create instead
voiddestroyUse of this method is deprecated. Use _destroy instead
[const]booldestroyed?Use of this method is deprecated. Use _destroyed? instead
[const]boolis_const_object?Use of this method is deprecated. Use _is_const_object? instead

Detailed description

_const_cast

Signature: [const] Technology ptr _const_cast

Description: Returns a non-const reference to self.

Basically, this method allows turning a const object reference to a non-const one. This method is provided as last resort to remove the constness from an object. Usually there is a good reason for a const object reference, so using this method may have undesired side effects.

This method has been introduced in version 0.29.6.

_create

Signature: void _create

Description: Ensures the C++ object is created

Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created.

_destroy

Signature: void _destroy

Description: Explicitly destroys the object

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

_destroyed?

Signature: [const] bool _destroyed?

Description: Returns a value indicating whether the object was already 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.

_is_const_object?

Signature: [const] bool _is_const_object?

Description: Returns a value indicating whether the reference is a const reference

This method returns true, if self is a const reference. In that case, only const methods may be called on self.

_manage

Signature: void _manage

Description: Marks the object as managed by the script side.

After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required.

Usually it's not required to call this method. It has been introduced in version 0.24.

_unmanage

Signature: void _unmanage

Description: Marks the object as no longer owned by the script side.

Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur.

Usually it's not required to call this method. It has been introduced in version 0.24.

add_other_layers=

Signature: void add_other_layers= (bool add)

Description: Sets the flag indicating whether to add other layers to the layer properties

Python specific notes:
The object exposes a writable attribute 'add_other_layers'. This is the setter.

add_other_layers?

Signature: [const] bool add_other_layers?

Description: Gets the flag indicating whether to add other layers to the layer properties

Python specific notes:
The object exposes a readable attribute 'add_other_layers'. This is the getter.

assign

Signature: void assign (const Technology other)

Description: Assigns another object to self

base_path

Signature: [const] string base_path

Description: Gets the base path of the technology

The base path is the effective path where files are read from if their file path is a relative one. If the explicit path is set (see explicit_base_path=), it is used. If not, the default path is used. The default path is the one from which a technology file was imported. The explicit one is the one that is specified explicitly with explicit_base_path=.

clear_technologies

Signature: [static] void clear_technologies

Description: Clears all technologies

This method has been introduced in version 0.26.

component

Signature: TechnologyComponent ptr component (string name)

Description: Gets the technology component with the given name

The names are unique system identifiers. For all names, use component_names.

component_names

Signature: [const] string[] component_names

Description: Gets the names of all components available for component

correct_path

Signature: [const] string correct_path (string path)

Description: Makes a file path relative to the base path if one is specified

This method turns an absolute path into one relative to the base path. Only files below the base path will be made relative. Files above or beside won't be made relative.

See base_path for details about the default base path.

create

Signature: void create

Description: Ensures the C++ object is created

Use of this method is deprecated. Use _create instead

Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created.

create_technology

Signature: [static] Technology ptr create_technology (string name)

Description: Creates a new (empty) technology with the given name

The new technology is already registered in the system.

This method returns a reference to the new technology.

dbu

Signature: [const] double dbu

Description: Gets the default database unit

The default database unit is the one used when creating a layout for example.

Python specific notes:
The object exposes a readable attribute 'dbu'. This is the getter.

dbu=

Signature: void dbu= (double dbu)

Description: Sets the default database unit

Python specific notes:
The object exposes a writable attribute 'dbu'. This is the setter.

default_base_path

Signature: [const] string default_base_path

Description: Gets the default base path

See base_path for details about the default base path.

Python specific notes:
The object exposes a readable attribute 'default_base_path'. This is the getter.

default_grid

Signature: [const] double default_grid

Description: Gets the default grid

The default grid is a specific one from the default grid list. It indicates the one that is taken if the current grid is not matching one of the default grids.

To set the default grid, use set_default_grids.

This property has been introduced in version 0.29.

default_grids

Signature: [const] double[] default_grids

Description: Gets the default grids

See default_grids for details.

This property has been introduced in version 0.28.17.

Python specific notes:
The object exposes a readable attribute 'default_grids'. This is the getter.

default_grids=

Signature: void default_grids= (double[] grids)

Description: Sets the default grids

If not empty, this list replaces the global grid list for this technology. Note that this method will reset the default grid (see default_grid). Use set_default_grids to set the default grids and the strong default one.

This property has been introduced in version 0.28.17.

Python specific notes:
The object exposes a writable attribute 'default_grids'. This is the setter.

description

Signature: [const] string description

Description: Gets the description

The technology description is shown to the user in technology selection dialogs and for display purposes.

Python specific notes:
The object exposes a readable attribute 'description'. This is the getter.

description=

Signature: void description= (string description)

Description: Sets the description

Python specific notes:
The object exposes a writable attribute 'description'. This is the setter.

destroy

Signature: void destroy

Description: Explicitly destroys the object

Use of this method is deprecated. Use _destroy instead

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

destroyed?

Signature: [const] bool destroyed?

Description: Returns a value indicating whether the object was already destroyed

Use of this method is deprecated. Use _destroyed? instead

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.

dup

Signature: [const] new Technology ptr dup

Description: Creates a copy of self

Python specific notes:
This method also implements '__copy__' and '__deepcopy__'.

eff_layer_properties_file

Signature: [const] string eff_layer_properties_file

Description: Gets the effective path of the layer properties file

eff_path

Signature: [const] string eff_path (string path)

Description: Makes a file path relative to the base path if one is specified

This method will return the actual path for a file from the file's path. If the input path is a relative one, it will be made absolute by using the base path.

See base_path for details about the default base path.

explicit_base_path

Signature: [const] string explicit_base_path

Description: Gets the explicit base path

See base_path for details about the explicit base path.

Python specific notes:
The object exposes a readable attribute 'explicit_base_path'. This is the getter.

explicit_base_path=

Signature: void explicit_base_path= (string path)

Description: Sets the explicit base path

See base_path for details about the explicit base path.

Python specific notes:
The object exposes a writable attribute 'explicit_base_path'. This is the setter.

group

Signature: [const] string group

Description: Gets the technology group

The technology group is used to group certain technologies together in the technology selection menu. Technologies with the same group are put under a submenu with that group title.

The 'group' attribute has been introduced in version 0.26.2.

Python specific notes:
The object exposes a readable attribute 'group'. This is the getter.

group=

Signature: void group= (string group)

Description: Sets the technology group

See group for details about this attribute.

The 'group' attribute has been introduced in version 0.26.2.

Python specific notes:
The object exposes a writable attribute 'group'. This is the setter.

has_technology?

Signature: [static] bool has_technology? (string name)

Description: Returns a value indicating whether there is a technology with this name

is_const_object?

Signature: [const] bool is_const_object?

Description: Returns a value indicating whether the reference is a const reference

Use of this method is deprecated. Use _is_const_object? instead

This method returns true, if self is a const reference. In that case, only const methods may be called on self.

layer_properties_file

Signature: [const] string layer_properties_file

Description: Gets the path of the layer properties file

If empty, no layer properties file is associated with the technology. If non-empty, this path will be corrected by the base path (see correct_path) and this layer properties file will be loaded for layouts with this technology.

Python specific notes:
The object exposes a readable attribute 'layer_properties_file'. This is the getter.

layer_properties_file=

Signature: void layer_properties_file= (string file)

Description: Sets the path of the layer properties file

See layer_properties_file for details about this property.

Python specific notes:
The object exposes a writable attribute 'layer_properties_file'. This is the setter.

load

Signature: void load (string file)

Description: Loads the technology definition from a file

load_layout_options

Signature: [const] LoadLayoutOptions load_layout_options

Description: Gets the layout reader options

This method returns the layout reader options that are used when reading layouts with this technology.

Change the reader options by modifying the object and using the setter to change it:

opt = tech.load_layout_options
opt.dxf_dbu = 2.5
tech.load_layout_options = opt

Python specific notes:
The object exposes a readable attribute 'load_layout_options'. This is the getter.

load_layout_options=

Signature: void load_layout_options= (const LoadLayoutOptions options)

Description: Sets the layout reader options

See load_layout_options for a description of this property.

Python specific notes:
The object exposes a writable attribute 'load_layout_options'. This is the setter.

name

Signature: [const] string name

Description: Gets the name of the technology

Python specific notes:
The object exposes a readable attribute 'name'. This is the getter.

name=

Signature: void name= (string name)

Description: Sets the name of the technology

Python specific notes:
The object exposes a writable attribute 'name'. This is the setter.

new

Signature: [static] new Technology ptr new

Description: Creates a new object of this class

Python specific notes:
This method is the default initializer of the object.

register_technology

Signature: [static] Technology ptr register_technology (const Technology tech)

Description: Registers a technology in the system

Only after a technology is registered, it can be used in the system, e.g. by specifying its name in Layout#technology_name. While create_technology already registers the technology, this method allows registering a Technology object that has created in other ways.

This method returns a reference to the new technology object, which is a copy of the argument. remove_technology can be used to remove a technology registered by this method.

This method has been introduced in version 0.28.14.

remove_technology

Signature: [static] void remove_technology (string name)

Description: Removes the technology with the given name from the system

save

Signature: [const] void save (string file)

Description: Saves the technology definition to a file

save_layout_options

Signature: [const] SaveLayoutOptions save_layout_options

Description: Gets the layout writer options

This method returns the layout writer options that are used when writing layouts with this technology.

Change the reader options by modifying the object and using the setter to change it:

opt = tech.save_layout_options
opt.dbu = 0.01
tech.save_layout_options = opt

Python specific notes:
The object exposes a readable attribute 'save_layout_options'. This is the getter.

save_layout_options=

Signature: void save_layout_options= (const SaveLayoutOptions options)

Description: Sets the layout writer options

See save_layout_options for a description of this property.

Python specific notes:
The object exposes a writable attribute 'save_layout_options'. This is the setter.

set_default_grids

Signature: void set_default_grids (double[] grids, double default_grid = 0)

Description: Sets the default grids and the strong default one

See default_grids and default_grid for a description of this property. Note that the default grid has to be a member of the 'grids' array to become active.

This method has been introduced in version 0.29.

technologies_from_xml

Signature: [static] void technologies_from_xml (string xml)

Description: Loads the technologies from a XML representation

See technologies_to_xml for details.

technologies_to_xml

Signature: [static] string technologies_to_xml

Description: Returns a XML representation of all technologies registered in the system

technologies_from_xml can be used to restore the technology definitions. This method is provided mainly as a substitute for the pre-0.25 way of accessing technology data through the 'technology-data' configuration parameter. This method will return the equivalent string.

technology_by_name

Signature: [static] Technology ptr technology_by_name (string name)

Description: Gets the technology object for a given name

technology_from_xml

Signature: [static] Technology technology_from_xml (string xml)

Description: Loads the technology from a XML representation

See technology_to_xml for details. Note that this function will create a new Technology object which is not registered in the system. See Technology#register for details.

technology_names

Signature: [static] string[] technology_names

Description: Gets a list of technology names defined in the system

to_xml

Signature: [const] string to_xml

Description: Returns a XML representation of this technolog

technology_from_xml can be used to restore the technology definition.