Glossary

From DANSE

Table of contents

Application (pyre)

An application is a special component that manages and coordinates the work of other components. Application inherits from pyre.inventory.Component.

Binding

Binding is the process of making a piece of code callable. In the DANSE project, we frequently use Python bindings for code written in C, C++, and FORTRAN; that means that we use pieces of code that make functions written in those languages callable from Python. Python bindings involve several components including wrappers; the process is described in Writing C extensions for Python.

Component

A component is an instance of the class pyre.inventory.Component. Components are the basic chunk of code managed by the pyre framework.

To make your own component, subclass Component. Component has an embedded class Inventory; subclasses of Component should similarly have an embedded class Inventory which inherits from Component.Inventory. The inventory is the designated place for the public to interact with components. By having an explicit place to interact with the component, components gain the ability to control whether they accept a given change, and what to do with that setting.

Components are closely related to facilities. Every component specifies the facility to which it can be bound.

Facility

A facility is how one component (let's call it A) specifies that it would like another component to do some work for it. It's a bit like a help-wanted ad. As part of the facility spec, A gets to recommend a default component to do the job, or it can recommend a way to build a component to do the job (factory). Users get the final decision: they can direct that a different component be used, specifying that on the command line or through .pml file(s).

Property

A component requests user input by declaring a property in its inventory. All properties are instances of pyre.inventory.property, and usually they are instances of a property subclass, such as int, float, str, etc. The programmer can specify the public name of a property, a default value, and a validator.

Pyre framework

The pyre framework is a Python-based system for constructing applications. Applications consist of a top level Application component and a set of lower level Components. The framework performs services such as instantiating components, configuring them, and cleaning up.

Pythia

Pythia is a package of related systems. Pythia includes the pyre framework and a number of other packages: related services include a distributed communication system (journal), code-generators (weaver), GUI generators (blade), build system (merlin).

Script

A script is an application meant to be run from the command line. A script usually inherits from the Script class in pyre.applications.Script. For convenience, a "hello world" script may be auto-generated using app.py in pyre.applications, and users may then customize that script to fit their needs.

Template

In C++, a template function (or class) is a technique for defining function (or class) implementation while not specifying types used in the interface. Loosely speaking, templates define implementation but leave interface to be defined later, while inheritance defines interface but delays deciding implementation.

For example, suppose you have two functions:

float addf(float a, float b){return a + b;}
double add( double a, double b){return a + b;}

One template function could replace both of these functions:

template <typename T> 
T add( T a, T b){ return a + b;}

This simplifies writing the code: there's only one function to keep track of, instead of one function for every type. Strictly speaking, this is not a function definition: it is a blueprint for the compiler to create a function definition ("instantiate" the template). The programmer has deferred until later the decision of what type(s) to use in this function. This function will work for any type for which the "+" operator is defined.

The person using this function has to make it clear to the compiler which types are to be involved:

float a=1.2, b=2.3;
float c = add<float>( a,b);

double d = 3.4, e = 4.5;
double f = add<double>( d, e);

Wrapping

Wrapping is the process of providing a new interface to an already existing piece of code. The code that does this is a wrapper.

Personal tools
Document Uploads/Links