Template.h

Classes

Template -- Canonicalise, format and other actions on aips++ template definitions (full description)

class Template

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)
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)

Description

Review Status

Date Reviewed:
yyyy/mm/dd
Programs:
Tests:

Prerequisite

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

Template()

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

~Template()

Destructor

const String &operator[](uInt n)

Operators

void reset()

Clear the object for a re-use.

void read(const Vector<String> &files)
void read(const String &filename)

Read the templates file or files into the class. Multiple reading is additive. Errors are reported to cerr, and commented out in the file.

uInt getCount() const

Get the number of template entries

uInt getTDCount() const

Get the number of template definition lines found

uInt getTCount() const

Get the number of templates found after all processing

uInt getDCount()

Get the number of duplicates found

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)

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

void splitName()

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)

Write the data formatted to the specified file. Notify errors and warnings by writing to cerr

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

void setOutput(const String &txt)

Save a line