tau tau

Previous topic

tau.core.resources

Next topic

tau.core.simulation

This Page

ResourcesFactory

Inheritance diagram of ResourcesFactory

class ResourcesFactory

A Singleton class designed to provide Simulation related objects.

DftResourceName
the default resource file name
DftResourcePriority
priority for the default resource
findObjectClass(absolute_name)

Obtain the class object corresponding to the given name.

Parameter:absolute_name (str) – the object absolute name string
Return type:tau.core.TauModel
Returns:a class object that should be a subclass of a tau.core.TauModel
Raise:(tau.core.TauException) if the given name is invalid.
getAttribute(alias)

Obtain the object corresponding to the given attribute name. If the corresponding attribute already exists, the existing instance is returned. Otherwise a new instance is stored and returned.

Parameter:alias (str) – attribute name string alias
Return type:tau.core.TauAttribute
Returns:attribute object
Raise:(NameError) if the alias does not exist
Raise:(tau.core.TauException) if the given alias is invalid.
getConfiguration(alias)

Obtain the object corresponding to the given attribute or full name. If the corresponding configuration already exists, the existing instance is returned. Otherwise a new instance is stored and returned.

Parameter:alias (str) – configuration name string alias
Return type:tau.core.TauConfiguration
Returns:configuration object
Raise:(NameError) if the alias does not exist
Raise:(tau.core.TauException) if the given alias is invalid.
getDatabase(alias=None)

Obtain the object corresponding to the given database name or the default database if db_name is None. If the corresponding database object already exists, the existing instance is returned. Otherwise a new instance is stored and returned.

Parameter:alias (str) – database name string alias. If None, the default database is used
Return type:tau.core.TauDatabase
Returns:database object
Raise:(NameError) if the alias does not exist
Raise:(tau.core.TauException) if the given alias is invalid.
getDevice(alias)

Obtain the object corresponding to the given device name. If the corresponding device already exists, the existing instance is returned. Otherwise a new instance is stored and returned.

Parameter:alias – device name string alias.
Return type:tau.core.TauDevice
Returns:device object
Raise:(NameError) if the alias does not exist
Raise:(tau.core.TauException) if the given alias is invalid.
getValue(key)

Returns the value for a given key

Parameter:key (str) – a key
Return type:str
Returns:the value for the given key
init(*args, **kwargs)
Singleton instance initialization. For internal usage only
loadResource(obj=None, priority=1, name=None)

(Re)Loads the given resource.

Parameters:
  • obj (dict or file or None) – the resource object. Default is None meaning in will (re)load the default resource: tau_resources.py from the application directory
  • priority (int) – the resource priority. Default is 1 meaning maximum priority
  • name (str) – an optional name to give to the resource
Return type:

dict

Returns:

a dictionary version of the given resource object

reloadResource(obj=None, priority=1, name=None)

(Re)Loads the given resource.

Parameters:
  • obj (dict or file or None) – the resource object. Default is None meaning in will (re)load the default resource: tau_resources.py from the application directory
  • priority (int) – the resource priority. Default is 1 meaning maximum priority
  • name (str) – an optional name to give to the resource
Return type:

dict

Returns:

a dictionary version of the given resource object

schemes
the list of schemes that this factory supports. For this factory: ‘res’ and ‘resources’ are the supported schemes