version.h
Classes
- VersionInfo -- Version information for AIPS++ (full description)
Interface
- Public Members
- static int majorVersion()
- static int minorVersion()
- static int patch()
- static const char *date()
- static const char *info()
- static void report(std::ostream &os)
Review Status
- Reviewed By:
- nkilleen
- Date Reviewed:
- 1996/10/24
- Programs:
- Tests:
Synopsis
VersionInfo is a small class that reports information on the version
of AIPS++ that an executable was linked with. Normally an application
programmer won't use this class directly, rather it will be used by
the ``Tasking'' system which will report this information in a standard
way.
The available information is:
- majorVersion(): Major version of AIPS++, changes about twice
a year.
- minorVersion(): Minor version of AIPS++, changes about three
times a day. (every exhale).
- patch(): Patch number of this release. Changes when a
bug-fix patch is created.
- date(): String representation of the date when this
release was created (when "exhale" was run).
- info(): Extra information about this release, e.g.
"beta release."
Additionally, there is a report() member function which
summarizes the above to an ostream.
When released to end users, the minor number is always 0. On the other
hand, along the development path the patch number is always zero. The
report() member function takes advantage of this to reformat
the version information to be more in line with what people are used to.
For example, 07.247.00 becomes "0.7 (build 247)" and 08.000.5 becomes
0.8.5. Note that major version 10 will thus be reported as version
1.0
The version information is maintained automatically by "exhale" and
is made available at link time by the make system.
Example
If you knew that a format change occurred at release 10.0 you could write
code like:
if (VersionInfo::majorVersion() >= 10) {
... process the new way
} else {
... process the old way
}
Of course generally it would be better to provide a conversion program
for the persistent data, rather than filling applications with tests
like this.
Motivation
It is important for bug-reporting and other such purposes to be able
to uniquely identify the version of AIPS++ that some problem occurs
in.
To Do
- It would be useful to document the compiler/platform as well.
Member Description
Major version of AIPS++, changes about twice a year.
Minor version of AIPS++, changes about three times a
day (every exhale).
static int patch()
Patch number of this release. Changes when a bug-fix patch is
created.
static const char *date()
String representation of the date when this release was created
(when "exhale" was run).
static const char *info()
Extra information about this release, e.g. "beta release."
static void report(std::ostream &os)
Summarize the above into an ostream. Note that an
ostringstream can be converted to a
String via a constructor.
This information is NOT prepended with "AIPS++ version:" or anything
like that. You may wish to add this yourself. The date is also not
included.