Information for Developers

General

This page is intended for information that should be used by developers of the Quantities package.

A developers' log is provided in several places: First, files Notes.log in the documentation subdirectories of the source tree contain running notes up to 2008. Then, the WikiSpaces facility of sourceforge was used. However, this was discontinued by sourceforge.net. The resulting logs are provided in the documentation directories as WikiNotes.log. Currently, the <a href="http://sourceforge.net/projects/quantity/develop> WordPress facilities of the project provide a means of keeping (and updating) the developers' logs. Since this facility is very slow at least on some internet connections, it was decided in early 2010 to keep text type log files again on local development machines, in order to have a quick running note facility. However, it is suggested to include in the names these files the developer's and machine's name to distinguish different logs and to avoid clashes when submitting to cvs.

File Layout

The source code is organized in the following subdirectories (under the <_source_directory_>:

Each of the source code directories includes a subdirectory test which contains test programs. Documentation sources are located in subdirectory documentation. Supporting macros for the build system are located in subdirectory m4.

After installation, the following directories are generated and populated:

Thus, the installed file layout looks like this:

<_install_directory_>
+- include
| +- Quantities-<versionnumber>
| | +- Quantities
| | | +- Quantity
| | | +- PhysicalQuantities
| | | +- GeneralQuantities
| | | +- MathematicalQuantities
+- lib
| +- Quantities-<versionnumber>
| +- Quantities-<versionnumber>-o
| +- Quantities-<versionnumber>-d
| +- Quantities-<versionnumber>-o-d
+- share
| +- Quantities-<versionnumber>

Build System

The Quantities build system makes use of the autotools. In particular, during development, autoconf (version 2.63), automake (version 1.10.1) and libtool (version 2.2.6) were employed for the most recent version.

Additional functionality is imported through the boost.m4 macros (latest version, documentation). The most recent download for development was on September 2, 2010. The code was slightly enhanced to accomodate more recent gcc versions (up to 4.5.0).

With the recent autotools (see above), it is no longer necessary to use the bootstrap skript after downloading the cvs code. Rather,

autoreconf --install

will prepare all necessary files.

After this, the sequence

./configure <options>
make
make install
make check
make doc
make doc-install

(see, installation instructions) will install Quantities as described above.

As also mentioned above, libraries compiled and linked according to various configure options may be installed in the respective subdirectories in the <_install_directory_>/lib tree. It is important to purge the object files generated by the compilation step, before it is attempted to compile code with different options with

make clean
in the <_source_directory_> if subsequent compilation with different options is intended.

Note that for linking versions of Quantities with debug information or optimization enabled, the respective versions of the BSUtilities libraries must be available.

Testing

The following suggestions are provided for testing:

Preparing a New Version

If you are a developer and you create a new version of Quantities, you have to set the version number (unfortunately) in several places:
  1. in the main Doxyfile as PROJECT_NUMBER
  2. in configure.ac as an argument to macro AC_INIT
  3. in version.h as value of QUANTITIES_VERSION
  4. in file README (several instances)
  5. in file documentation/history.txt

You should also set the recommended version number of BSUtilities to be used in

  1. configure.ac (several instances)
  2. README (several instances)
  3. file documentation/installation.txt (several instances}

Extending the Capabilities by

Designing New Quantities Types and Objects

Quantities is a package that is implemented mostly in the form of C++ template classes and functions. It is thus extandable by instantiating additional instances of these templates. An extension needs to define a new dimension, new units, a new base quantity and new derived quantities. In some cases, more simple modifications of existing quantities is possible.

Modifications to an Existing Quantity

(to be written)

Additional Quantities

(to be written)

Defining a New Unit

(to be written)

Defining a New Base Quantity

... needs QuantityTraits traits template ...

... defaults ...

(to be written)

Defining a New Derived Quantity

... reasonable set of quantities provided ...

... needs DerivedQuantity type ...

... needs DerivedQuantityTraits traits template ...

... defaults ...

... define OverwriteName/Symbol bools ...

... if bool set to true -> define the string, if set to false -> no definition of string is necessary ...

... define StorageUnit ...

... decide on the mode ...

... for UniqueConstant: only ONE for a particular derived quantity, unresticted number for a base quantity; if several UniqueConstants are needed based on a base quantity -> use different DQT ...

... can be defined ad hoc without typedef ...

Defining a New Physical Quantity

... specific conventions, ...

... physical quantities, base quantities, derived quantities ...

... fundamental physical constants (natural constants) ... (to be written)

back to Quantities start page


Generated on Wed Apr 11 18:07:08 2012 for Quantities by  doxygen 1.5.6