class FrWriter

DMT frame writer API.

Public Methods

FrWriter(void)
Default (Null) constructor
FrWriter(const char* Name, int Run)
Construct and connect to destination file
~FrWriter(void)
Destructor
void setDebug(int debug=0)
Set the debug flag.
void addChannel(const char* Name, TSeries** TSptr=0)
Add a channel to the request list.
void rmChannel(const char* Name)
Remove a channel from the request list.
int open(const char* File, bool toc=false)
Open a file.
int open(FrameCPP::Output* writer)
Open a file specified by a framewriter.
void close(void)
Close the current data file.
int writeFrame(void)
Fill the requested TSeries.
int buildFrame(const Time& Start=0, const Interval& dT=0.0)
Create a data frame from the data.
void addProcSeries(const char* Name, const TSeries& TS)
Add a pre-processed data structure to the frame.
void addRawSeries(const char* Name, const TSeries& TS)
Add an ADC data structure.
void addSeries(const char* Name, const TSeries& TS)
Add an ADC data structure.
int getDebug(void) const
Get the debug flag.
const char* getFile(void) const
Get the input file name.
const FrameCPP::Frame* getFrame(void) const
Get a pointer to the current frame header.
string getFrameID(void) const
Copy a Frame ID into the specified string.
Time getTime(void) const
Get the Start time.
ostream& list(ostream& out) const
List requested channels.
void copyDetectors(const FrameCPP::Frame& f)
Copy detector information.
void copyHistory(const FrameCPP::Frame& f)
Copy history information.
void copyAuxData(const FrameCPP::Frame& f)
Copy auxillary data.
void addRawAdc(const FrameCPP::Frame& f, const char* Name)
Copy adc data.
void addRawAdc(const FrameCPP::AdcData& adc)
Copy adc data.

Documentation

FrWriter methods are used to create frames from TSeries objects and other data. THe FrWriter API is used as follows. A frame writer is created and then opened with the open() method. Any TSeries that are to be written to all output frames are introoduced to the frame writer with the addChannel() function. For each frame to be written user must build the frame with buildFrame(), add any additional TSeries data with addSeries() or other data using the FrameCPP API and the frame pointer from getFrame() and write it out with writeFrame(). After all frames have been written, the frame writer is closed with close() and/or deleted.
FrWriter(void)
Default (Null) constructor

FrWriter(const char* Name, int Run)
Construct and connect to destination file. Any frame name may be used. The run number should follow the frame standard run number convention.
Parameters:
Name - Frame name.
Current - run number.

~FrWriter(void)
Destructor

void setDebug(int debug=0)
If the debug flag is set, explanatory messages will be printed when an error is encountered.

void addChannel(const char* Name, TSeries** TSptr=0)
The specified channel is added to the list of channels to be processed by buildFrame. A channel may be included in the list only once. Subsequent calls to addChannel will replace the original request. TSptr specifies the location of a pointer to the data. Note that the data are not copied until buildFrame is called. Core must be taken that the specified pointer (TSptr) must therefore still exists and points to valid data at the time buildFrame is called. The data are written with the same type as the TSeries.
Parameters:
Name - Name of channel to collect data from.
TSptr - Address of TSeries pointer.

void rmChannel(const char* Name)
The named channel is removed from the request list.

int open(const char* File, bool toc=false)
The file is opened for output. If a file is already open, it will be closed, and a new file will be opened.
Parameters:
File - name of output file.
tco - If true, write a table of contents.

int open(FrameCPP::Output* writer)
The specified framewriter is used for output. If a file is already open the current frame writer is closed and deleted.

void close(void)
The current data file is closed and the frame writer is deleted.

int writeFrame(void)
Data from TSeries specified by addChannel() are copied to the output frame.

int buildFrame(const Time& Start=0, const Interval& dT=0.0)
A frame is constructed and data from all TSeries specified with addChannel are copied into the frame.
Returns:
Zero if valid frame read in, otherwise -1.
Parameters:
Start - Frame start time.
dT - Frame length.

void addProcSeries(const char* Name, const TSeries& TS)
Add a pre-processed data series to the frame from a TSeries.
Parameters:
Name - Name of ProcData to be added. @Param TS Time series containing pre-processed data.

void addRawSeries(const char* Name, const TSeries& TS)
Add a raw data channel to the frame from a TSeries.
Parameters:
Name - Name of ADC to be added. @Param TS Time series containing Adc data.

void addSeries(const char* Name, const TSeries& TS)
Add a raw data channel to the frame from a TSeries. This is equivalent to addRawSeries, but kept for backward compatibility.
Parameters:
Name - Name of ADC to be added. @Param TS Time series containing Adc data.

int getDebug(void) const
Returns the level of debug information that was requested.
Returns:
Debug print level.

const char* getFile(void) const
Returns a pointer to a string containing the current input file name. If no file is open, a pointer to the next file name is returned.

const FrameCPP::Frame* getFrame(void) const
Returns a pointer to the current frame header.

string getFrameID(void) const
An identifier of the form <ifo-id>-<GPS-time>.F is generated for the current Frame and copied to the specified string.
Returns:
string containing the current frame identifier.

Time getTime(void) const
Returns the time at which data collection is to start.

ostream& list(ostream& out) const
A formatted list of requested channels, their decimation factors, and latest time copied is printed to the specified output stream.

void copyDetectors(const FrameCPP::Frame& f)
Copy the detector information (both processed and simulation) from an existing frame.
Parameters:
f - Frame containing detector information to be copied.

void copyHistory(const FrameCPP::Frame& f)
Copy the history information from an existing frame.
Parameters:
f - Frame containing history information to be copied.

void copyAuxData(const FrameCPP::Frame& f)
Copy the auxillary data from an existing frame.
Parameters:
f - Frame containing auxillary data to be copied.

void addRawAdc(const FrameCPP::Frame& f, const char* Name)
Copy the adc data from an existing frame.
Parameters:
f - Frame containing adc data to be copied.
Name - Name of adc to be copied.

void addRawAdc(const FrameCPP::AdcData& adc)
Copy the adc data from an existing frame.
Parameters:
f - Frame containing auxillary data to be copied.


This class has no child classes.
Author:
John G Zweizig
Version:
1.0; Last modified January 27, 2000

alphabetic index hierarchy of classes


generated by doc++