Template.h
Classes
- Template -- Canonicalise, format and other actions on aips++ template definitions (full description)
Interface
- Public Members
- Template()
- explicit Template(const Vector<Vector> &files)
- explicit Template(const String &filename)
- ~Template()
- const String &operator[](uInt n)
- void reset()
- void read(const Vector<String> &files)
- void read(const String &filename)
- uInt getCount() const
- uInt getTDCount() const
- uInt getTCount() const
- uInt getDCount()
- const String &getTDFlist(uInt n)
- const String &getTDlist(uInt n)
- const uInt &getTDfile(uInt n)
- const uInt &getTDline(uInt n)
- const String &getTDname(uInt n)
- void canonical(const Bool tmplonly=False)
- void splitName()
- void sortName(const Bool renumber=False)
- void writeOut(ostream &os, const Bool warn=False)
- void writeDup(ostream &os, const String &userFile, Bool isSys=False)
- Private Members
- Template(const Template &other)
- Template &operator=(const Template &other)
- void setComment(const String &txt, const Bool atstart=False)
- void setOutput(const String &txt)
Review Status
- Reviewed By:
- UNKNOWN
- Date Reviewed:
- before2004/08/25
- Programs:
- Tests:
Prerequisite
Knowledge about the aips++ DYO template system
Synopsis
A set of methods on template repository files and on template definitions to be
used in the reident, used, unused and duplicates programs (see
Sytem manual
for details.
Methods exist to read templates, to canonicalise them for comparison and
search functions and to format them for output.
Motivation
To make template formatting identical across formatting/testing programs.
To Do
Member Description
Default constructor. Need to read data into it
explicit Template(const Vector<Vector> &files)
Create from the file names given
explicit Template(const String &filename)
Create from the file name given
Destructor
Operators
Clear the object for a re-use.
Read the templates file or files into the class. Multiple reading is additive.
Errors are reported to cerr, and commented out in the file.
Get the number of template entries
Get the number of template definition lines found
Get the number of templates found after all processing
Get the number of duplicates found
Get the various template definition information fields.
Meant for testing and special projects only.
void canonical(const Bool tmplonly=False)
Canonicalise the template entries in the object. If switch True, do only
the templates entry for duplication
Split the entries in number, name id, rest
void sortName(const Bool renumber=False)
Sort the data on name and number and fill in missing number. If switch
is True, renumber all template entries in sequence.
void writeOut(ostream &os, const Bool warn=False)
Write the data formatted to the specified file. Notify errors and warnings
by writing to cerr. If warn is False, some warnings will be
compressed into a general warning.
void writeDup(ostream &os, const String &userFile, Bool isSys=False)
Write the duplicate list; the userFile gets ***; isSys gives the system switch
Template(const Template &other)
Copy constructor (not implemented)
Template &operator=(const Template &other)
Assignment (not implemented)
void setComment(const String &txt, const Bool atstart=False)
Save comment
Save a line