Getting Started Documentation Glish Learn More Programming Contact Us
Version 1.9 Build 1556
News FAQ
Search Home


next up previous contents index
Next: updatelib Up: System generation Previous: System generation makefile rules

Subsections



mkinst

Generate template instantiation files from a list.

Synopsis

mkinst [-q] package

Description

mkinst generates a template instantiation file for each entry in the specified file, (templates by default). It leaves the resulting .cc files in the current directory. The format of the entries in the templates file is

   <ident> <.cc file> <.h file> [<extra .h files>] <template declaration> ...

or

   <ident> <.h file> [<extra .h files>] <template declaration> ...

The latter form is for instantiation of purely inline functions. The .cc and .h files are expressed as relative pathnames with respect to $AIPSROOT/code/include. For example:

   1050 aips/Set/Set.cc template class Set<Int>
   1040 aips/Set/Set.cc aips/Cube/Cube.h template class Set<Cube>
   1060 aips/Set/Set.cc template Set<Int> operator+(Set<Int> const &, Set<Int> const &)
   1060 aips/Set/Set.cc template void union(Set<Int> const &, Set<Int> const &)

The ident contains a 4-digit number which is unique amongst all templates based on a particular class implementation .cc or .h file. The name of the template instantiation .cc file is composed of the name of the class .cc or .h file and the ident, for example, the instantiation file for the first entry above would be Set_1050.cc.

Comments in the templates file are signalled by a ``#'' in the first field. Blank lines are also allowed.

Each entry in the templates can be split over several lines. The first line must have the ident and one or more of the necessary include files (.cc or .h). Subsequent lines can be in any order, and have one of the following formats:

    = file.h				 additional include files
    template class Name<...>		 class specialisation
    template <...> ...			 templated class forward declaration
    template <> ...			 non-templated forward declaration
    template ret-val function(....)	 function specialisation
    typedef definition name              typedef, for use in next
    AIPS_[A-Z0-9]*_AUX_TEMPLATES(x, ...) to aid with sub-templates

The AIPS_() macros are provided to aid in the generation of auxilliary templates necessary for some compilers for standard library templates (like the map and vector e.g.). Since macros cannot handle arguments with embedded commas, the typedef option is provided to give macro arguments with commas. See the repositories for examples.

Template declarations can be bracketed by #if #else #endif. For example:

   1040 aips/Set/Set.cc aips/Cube/Cube.h
	template class Set<Cube>
   1050 aips/Set/Set.cc 
	template class Set<Int>
	template <> class ostream
	template <class T> class Vector
	#if !defined(STD_LIB)
    	  template Set<Int> operator+(Set<Int> const &, Set<Int> const &)
      	  template void union(Set<Int> const &, Set<Int> const &)
	#endif

Any template instantiation .cc file in the current directory which does not correspond to an entry in the templates file will be deleted. These files are recognized by having names of the form *_[0-9][0-9][0-9][0-9].cc.

Options

-q
Run quietly.

Notes

Diagnostics

Status return values
0: success
1: the templates file contains one or more bad entries

Examples

Invokation of mkinst is usually done indirectly via specific makefile targets (see §10.9 and §11.4). These maintain the template instantiation files in a subdirectory (tmplinst) of the directory where the templates file resides.
   mkdir tmplinst
   cd tmplinst
   mkinst -q ../templates

See also

reident (p[*]), Remake the idents in a templates list.
duplicates (p[*]), Checks for duplicate entries in templates lists across the system.

Author

Original: 1996/04/17 by Mark Calabretta, ATNF after a perl script by Shelby Yang, NRAO.


next up previous contents index
Next: updatelib Up: System generation Previous: System generation makefile rules   Contents   Index
Please send questions or comments about AIPS++ to aips2-request@nrao.edu.
Copyright © 1995-2000 Associated Universities Inc., Washington, D.C.

Return to AIPS++ Home Page
2006-10-15