In file dacc/DaccIn.hh:

class DaccIn

DMT frame input class.

Inheritance:


Public Methods

DaccIn (void)
Default (Null) constructor
explicit DaccIn (FrameCPP::IFrameStream* 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 setTOCMode (bool toc=true)
Set the readmode.
void addFile (const char* File)
Add a file to the file list.
void addFileList (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.
bool getHistory (const std::string& name, Time& t, std::string& com) const
Get history data.
const FrameCPP::FrameH* getFrame (void) const
Get a pointer to the current frame header.
std::string getFrameID (void)
Copy a Frame ID into the specified string.
int getStaticData (const std::string& name=".*", const std::string& det=".*", const Time& startGps=Time(0), const Time& endGps=Time(0))
Get a static data.
FSeries getStaticFSeries (const std::string& name, const Time& gps)
Get a static fseries.
TSeries getStaticTSeries (const std::string& name, const Time& gps)
Get a static TSeries.
Time getTime (void) const
Get the Start time.
bool haveFrame (void) const
Get the Start time.
bool isOnline (void) const
Test if online data.
std::ostream& listFiles (std::ostream& out) const
Reference a file list
bool waitData (bool test_only=false) const
Wait for data or a signal.
const FrameCPP::FrAdcData* 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::FrAdcData* nextAdc (const std::string& name) const
Look for an Adc data structure with the given channel name starting at the last found Adc
const FrameCPP::FrProcData* findProc (const std::string& name) const
Find a Processed Data structure with the given channel name and return a pointer to the object
const FrameCPP::FrProcData* nextProc (const std::string& name) const
Look for a Processed Data structure with the given channel name starting at the last found ProcData
const FrameCPP::FrSimData* findSim (const std::string& name) const
Find a Simulated Data structure with the given channel name and return a pointer to the object
const FrameCPP::FrSimData* nextSim (const std::string& name) const
Look for a Simulated Data structure with the given channel name starting at the last found SimData
FrStatDataRef findStat (const std::string& name, const Time& gps, int vsn=-1)
Find a Static Data structure with the given channel name and valid at the specified time and version

Documentation

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

explicit DaccIn(FrameCPP::IFrameStream* 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 setTOCMode(bool toc=true)
Set the readmode.

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 addFileList(const char* File)
One or more frame file descriptors are read from a text file and added to the list of frames to be processed. Each line of the text file must contain a single file specifier like the those accepted by addFile().
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. In Online data mode, the shared memory partition buffer containing the frame is also 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.

bool getHistory(const std::string& name, Time& t, std::string& com) const
Get the time and comment of the specified history record.
Returns:
true if history found.
Parameters:
name - History record name.
t - History record time (returned);
com - History record comment.

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

std::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.

int getStaticData(const std::string& name=".*", const std::string& det=".*", const Time& startGps=Time(0), const Time& endGps=Time(0))
Fetch all specified static data.
Returns:
Number of static structures read.
Parameters:
name - FrStat name.
det - Detector name.
startGps - Start time of static validity.
endGps - End time of static validity.

FSeries getStaticFSeries(const std::string& name, const Time& gps)
Get a frequency series (FSeries) from a previously read static structure. Note that getStaticData must have been used previously to insure that the necessary static data reside in memory.
Returns:
FSeries.
Parameters:
name - FrStat name.
gps - Time for of static validity.

TSeries getStaticTSeries(const std::string& name, const Time& gps)
Get a time series (TSeries) from a previously read static structure. Note that getStaticData must have been used previously to insure that the necessary static data reside in memory.
Returns:
TSeries.
Parameters:
name - FrStat name.
gps - Time for of static validity.

Time getTime(void) const
Returns the start time of the current (or previous) frame. If the Dacc has no currently valid frame, getTime returns the start time of the last frame read. If no frames have been read, getTime returns Time(0).
Returns:
start time of current or previous frame.

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.

std::ostream& listFiles(std::ostream& out) const
Reference a file list

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 available, 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::FrAdcData* 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::FrAdcData* 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.

const FrameCPP::FrProcData* findProc(const std::string& name) const
Find a Processed 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::FrProcData* nextProc(const std::string& name) const
Look for a Processed Data structure with the given channel name starting at the last found ProcData. Return a pointer to the object. If the object isn't found, a null pointer is returned.

const FrameCPP::FrSimData* findSim(const std::string& name) const
Find a Simulated 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::FrSimData* nextSim(const std::string& name) const
Look for a Simulated Data structure with the given channel name starting at the last found SimData. Return a pointer to the object. If the object isn't found, a null pointer is returned.

FrStatDataRef findStat(const std::string& name, const Time& gps, int vsn=-1)
Find a Static Data structure with the given channel name and valid at the specified time and version. If the versionis negative, the latest version number is returned. A valid FrStatDataRef is returned if found. If the object isn't found, the FrStatDataRef is a null reference (i.e. FrStatDataRef::null() returns true).
Parameters:
name - Name of static data to be found
gps - Time of validity
vsn - Version number


Direct child classes:
Dacc
Author:
John G. Zweizig
Version:
1.2; Last modified May 26, 2004

alphabetic index hierarchy of classes


Please send questions and comments to zweizig_j@ligo.caltech.edu


generated by doc++