class DaccIn

LIGO Sandbox frame input class.

Inheritance:


Public Methods

DaccIn(void)
Default (Null) constructor
explicit DaccIn(Freader* reader)
Construct using an already allocated frame reader
virtual ~DaccIn()
Destructor
void setBuffer(int N)
Set the number of online buffers to reserve.
void setDebug(int debug=0)
Set the debug flag.
void addFile(const char* File)
Add a file to the file list.
void close(void)
Close the current file.
int open(void)
Open a file.
void endFrame(void)
Release the current data frame.
int nextFrame(void)
Read in a new data frame.
Interval getDt(void) const
Get the Current time.
int getDebug(void) const
Get the debug flag.
const char* getFile(void) const
Get the input file name.
const FrameH* getFrame(void) const
Get a pointer to the current frame header.
string getFrameID(void)
Copy a Frame ID into the specified string.
Time getTime(void) const
Get the Start time.
bool haveFrame(void) const
Get the Start time.
bool isOnline(void) const
Test if online data.
ostream& listFiles(ostream& out) const
List requested files.
bool waitData(bool test_only=false) const
Wait for data or a signal.
const FrameCPP::AdcData* findAdc(const std::string& name) const
Find an Adc data structure with the given channel name and return a pointer to the object
const FrameCPP::AdcData* nextAdc(const std::string& name) const
Look for an Adc data structure with the given channel name starting at the last found Adc

Documentation

DaccIn methods provide an input interface to frame files.
DaccIn(void)
Default (Null) constructor

explicit DaccIn(Freader* reader)
Construct using an already allocated frame reader

virtual ~DaccIn()
Destructor

void setBuffer(int N)
This parameter controls the fraction of the data read into the shared memory to be copied to the data stream and what part of the shared memory resources can be held allocated the stream. 'nbuf' == 0 indicates data is taken as requested. 'nbuf' == -1 indicates that all data written to the shared memory must be copied to the data stream. 'nbuf'==N indicates that up to N buffers (frames) of data should be held until the stream is ready for them.
Parameters:
N - Number of buffers to reserve, or -1 for all.

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

void addFile(const char* File)
One or more file names are added to the file list. Wilcard characters ('*'s) can be used to add several files simultaneously. The file names are sorted to keep them in an increaseing sequence.
Parameters:
File - Name of the file to be added to the input list.

void close(void)
The current file is closed and its name is removed from the file list. Any open shared memory partition is released.

int open(void)
The first file in the file list is opened. If a file is already open, it will be closed, and the next file will be opened. If the file name is of the form "/online/<partname>" the input stream is connected to the the shared memory partition specified by <partname>.
Returns:
Zero if open was sucessful.

void endFrame(void)
The current data frame is released. No new frame is read.

int nextFrame(void)
The current data frame is deleted and a new frame is read. If the input file is not open or if an error occurs on reading the current file, the file is close and a new file is opened.
Returns:
Zero if valid frame read in, otherwise -1.

Interval getDt(void) const
Returns the current frame time interval;

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 FrameH* getFrame(void) const
Returns a pointer to the current frame header.

string getFrameID(void)
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.

bool haveFrame(void) const
Returns the time at which data collection is to start.

bool isOnline(void) const
Test whether the data are from an online shared memory partition.
Returns:
True if DaccIn input source is a shared memory partition.

ostream& listFiles(ostream& out) const
A formatted list of requested files is printed to the specified output stream.

bool waitData(bool test_only=false) const
Wait for data or a signal. waitData returns when a data buffer is found in the online partition or when a signal is caught. If the data are abailable, the return value is true. If test_only is true waitData returns immediately.
Returns:
true if data are availble.
Parameters:
test_only - Return immediately if true.

const FrameCPP::AdcData* findAdc(const std::string& name) const
Find an Adc data structure with the given channel name and return a pointer to the object. If the object isn't found, a null pointer is returned.

const FrameCPP::AdcData* nextAdc(const std::string& name) const
Look for an Adc data structure with the given channel name starting at the last found Adc. Return a pointer to the object. If the object isn't found, a null pointer is returned.


Direct child classes:
Dacc
Author:
John G Zweizig
Version:
1.1; Last modified November 23, 1999

alphabetic index hierarchy of classes


generated by doc++