FACT++
1.0
|
A struct which stores a name, a unit and a comment. More...
#include <Description.h>
Public Member Functions | |
Description (const std::string &n, const std::string &c, const std::string &u="") | |
Static Public Member Functions | |
static std::vector< Description > | SplitDescription (const std::string &buffer) |
static std::string | GetHtmlDescription (const std::vector< Description > &vec) |
Public Attributes | |
std::string | name |
std::string | comment |
std::string | unit |
A struct which stores a name, a unit and a comment.
To have proper descriptions of commands and services in the network (and later proper informations in the FITS files) this struct provides a simple storage for a name, a unit and a comment.
Assume you want to write a descriptive string for a command with three arguments. It could look like this:
COMMAND=Description|int[addr]:Address range (from - to)|val[byte]:Value to be set
Description is a general description of the command or service itself, int and val are the names of the arguments (e.g. names of FITS columns), addr and byte have the meaning of a unit (e.g. unit of FITS column) and the text after the colon is a description of the arguments (e.g. comment of a FITS column). The description must not contain a line-break character
.
Such a string can then be converted with SplitDescription into a vector of Description objects, each containing the name, the unit and a comment indivdually. The first object will contain COMMAND as name and Description as comment. The unit will remain empty.
You can omit either the name, the unit or the comment or any combination of them. The descriptions of the individual format strings are separated by a vertical line. If you want to enclose the name into []-braces (e.g. marking an optional argument in a dim command), you have add empty brackets for the units.
For a suggestion for rules for the names please have a look at: http://heasarc.gsfc.nasa.gov/docs/heasarc/ofwg/docs/ofwg_recomm/r15.html
For units please see: http://heasarc.gsfc.nasa.gov/docs/heasarc/ofwg/docs/general/ogip_93_001/ogip_93_001.html
Definition at line 7 of file Description.h.