Xsil document parsing
This package exports input and output functions for reading and writing LIGO light-weight data. The approach taken with this library is to provide output manipulators which allow easy XML formatting of data and parameter objects on standard output streams. It is the callers responsibility to cycle through all the data objects which have to be written. A simple example may look like: {verbatim} double x[3] = {1, 3.2, 5.1}; float y[6] = {1.1, 2.2, 3.3, 4.4, 5.5, 6.6}; cout << xsilHeader() << endl; cout << xsilDataBegin ("Result", "Spectrum") << endl; cout << xsilParameter<int> ("Averages", 12) << endl; cout << xsilParameter<bool> ("online", true) << endl; cout << xsilParameter<const char*> ("Channel", "H2:PEM-LVEA_SEISX") << endl; cout << xsilParameter<double> ("scanPoints", *x, 3) << endl; cout << xsilDataEnd<float> (6, y) << endl; cout << xsilTrailer() << endl; {verbatim} which produced the following output: {verbatim} <?xml version="1.0"?> <!DOCTYPE LIGO_LW SYSTEM "http://www.cacr.caltech.edu/projects/ligo_lw.dtd"> <LIGO_LW> <LIGO_LW name="Result" type="Spectrum"> - Parameters:
-
| Averages | 12 |
| online | 1 |
| Channel | H2:PEM-LVEA_SEISX |
| scanPoints | 1 3.2 5.1 |
<Array type="float"> <Dim>6</Dim> <Stream encoding="BigEndian,base64"> P4zMzUAMzM1AUzMzQIzMzUCwAABA0zMz </Stream> </Array> </LIGO_LW> </LIGO_LW> {verbatim}
Input from a LIGO-LW file is handled differently. The user has to contstruct a XML parser object with a input stream and a set if data object callback routines. Whenever a new data object is encountered in the stream it is successively handled to the callback routines until a handler is found which will parse the object. This handler will return a 'callback' object which has methods to handle parameters, and the data associated with the object. The parser will call the parameter handling method for every new parameter belongin to the current data object and it will call the data handling method with the actual data read from the stream.
The classes are further divided into the following groups
Generated on Sun Mar 8 19:20:56 2009 for dmt by
1.5.4