FrameDir Class Reference
[Frame utilities]

#include <framedir.hh>

List of all members.

Public Types

typedef Time::ulong_t gps_t
typedef std::map< gps_t,
ffDataSeries
dmap_t
typedef ffDataConstIter file_iterator
typedef dmap_t::const_iterator series_iterator

Public Member Functions

virtual ~FrameDir (void)
 FrameDir ()
 FrameDir (const char *dir, bool delayed=false)
file_iterator find (const Time &t) const throw (NoData)
file_iterator getStart (gps_t time) const
file_iterator getLast (gps_t time) const
int getDebug (void) const
file_iterator begin (void) const
file_iterator end (void) const
series_iterator beginSeries (void) const
series_iterator endSeries (void) const
int sizeSeries () const
int size () const
bool empty () const
void add (const char *dir, bool delayed=false)
void addFile (const char *File, unsigned int Cont=0) throw (BadFile)
void clear (void)
void erase (gps_t time)
void setDebug (int Level)
bool read (const char *File)
bool write (const char *File, bool Longlist=false, gps_t Start=0, gps_t Stop=0, bool SupHead=false)
bool write (std::ostream &Os, bool Longlist=false, gps_t Start=0, gps_t Stop=0, bool SupHead=false)
std::ostream & operator<< (std::ostream &Os)

Static Public Member Functions

static bool parseName (const char *File, gps_t &time, gps_t &tlen, char *pre=0, char *post=0)


Detailed Description

The frame directory class is used to keep a directory of frame files in memory. Each frame is represented by an ffData object indexed by the starting GPS time. The data in the ffData structure are set as follows: The frame file descriptors may be accessed sequentially using a file_iterator# type variable. brief Frame Finder Class
Author:
J. Zweizig
Version:
V1.0; Modified February 3, 2000

Member Typedef Documentation

typedef Time::ulong_t FrameDir::gps_t

GPS time data type.

typedef std::map<gps_t, ffDataSeries> FrameDir::dmap_t

Directory map data type.

typedef ffDataConstIter FrameDir::file_iterator

Iterator provides sequential access to the data on the files in the directory. brief File data iterator.

typedef dmap_t::const_iterator FrameDir::series_iterator

Iterator provides sequential access to the series data. brief Series data iterator.


Constructor & Destructor Documentation

virtual FrameDir::~FrameDir ( void   )  [virtual]

Erase all FrameDir entries. brief FrameDir destructor.

FrameDir::FrameDir (  ) 

Construct an empty frame directory. brief Empty directory constructor.

FrameDir::FrameDir ( const char *  dir,
bool  delayed = false 
) [explicit]

Construct a Frame directory and fill it with data from files matching the specified specification. The frame file specification may contain wild-cards in the file name but not in the directory name. brief Construct and fill a directory.

Parameters:
dir Frame file specification.
delayed Check files when needed, otherwise do it after add.


Member Function Documentation

file_iterator FrameDir::find ( const Time &  t  )  const throw (NoData)

Get the data for the file that covers time t. brief Get file data by time.

file_iterator FrameDir::getStart ( gps_t  time  )  const

Get the iterator of the first period on or after the specified time. brief find the next data segment.

Returns:
Start time of the first data segment after the specified time.
Parameters:
time Begin time for search.

file_iterator FrameDir::getLast ( gps_t  time  )  const

Get the iterator of the first period after the specified time. brief Find the end of the next data segment.

Returns:
End time of the first data segment after the specified time.
Parameters:
time Begin time for search.

int FrameDir::getDebug ( void   )  const [inline]

Get the specified debug level. brief Find the end of the n.

Returns:
End time of the first data segment after the specified time.

file_iterator FrameDir::begin ( void   )  const

Get a file_iterator pointing the first (earliest) frame file entry in the directory. brief Get a iterator pointing to the sequential beginning.

Returns:
A file_iterator pointing to the beginning of the directory.

file_iterator FrameDir::end ( void   )  const

Get a file_iterator pointing the end of the frame file directory. brief Get a iterator pointing to the directory end.

Returns:
A file_iterator# pointing to the end of the directory.

series_iterator FrameDir::beginSeries ( void   )  const

Get a series_iterator pointing the first series entry in the directory. brief Get a iterator pointing to the beginning of the series.

Returns:
A series_iterator pointing to the beginning of the series.

series_iterator FrameDir::endSeries ( void   )  const

Get a series_iterator pointing the end of the series. brief Get a iterator pointing to the end.

Returns:
A series_iterator# pointing to the end of the series.

int FrameDir::sizeSeries (  )  const

Returns the number of entries in the series list. brief Number of series entries.

int FrameDir::size (  )  const

Returns the number of files in the FrameDir list. brief Number of file entries.

bool FrameDir::empty (  )  const [inline]

Returns true if there are no entries in the FrameDir list. brief Empty list?.

void FrameDir::add ( const char *  dir,
bool  delayed = false 
)

Add all the specified frame files to the Frame Directory. The File specification can contain one or more wild cards in the File name but not in the directory name. brief Add one or more frame files.

Parameters:
dir File name(s) to be added to the FrameDir.
delayed Check files when needed, otherwise do it after add.

void FrameDir::addFile ( const char *  File,
unsigned int  Cont = 0 
) throw (BadFile)

Add a single file to the frame directory. The file name must not contain wild-cards and must conform to the LIGO frame file naming standard i.e. the name must have the following form: "<directory>/<ifo-name>-<start-gps>[-<nsec>][.<extension>]". To allow backward compatibility, the data length and extension may be omitted. The continuation number can be used to specify a series of frame files that cover a continueous duration, have the same length, path prefix and extension. This only works for file that provide the data length in their name. The continuation number specficies the number of additional files beyond the first one. brief Add a file to the FrameDir.

Parameters:
File Name of file to be added to the list.
Cont Additional files following in series.

void FrameDir::clear ( void   ) 

Delete all file descriptors from the FrameDir list. brief Delete all entries.

void FrameDir::erase ( gps_t  time  ) 

Delete the frame series descriptor for the specified time. brief Delete a frame file entry.

Parameters:
time GPS time of start of

void FrameDir::setDebug ( int  Level  )  [inline]

Set the debug printout threshold to a specified level. brief Set debug level.

Parameters:
Level New debug printout level.

bool FrameDir::read ( const char *  File  ) 

Read a list of frame files from a text file. brief Read list file.

Parameters:
File Name of file to be read.
Returns:
True if successful

bool FrameDir::write ( const char *  File,
bool  Longlist = false,
gps_t  Start = 0,
gps_t  Stop = 0,
bool  SupHead = false 
)

Write the list of frame files to a text file. brief Write list file.

Parameters:
File Name of file to be written.
Longlist If true, prints one file per line.
Start Start time (GPS).
Stop Stop time (GPS).
SupHead If true, suppresses file:// head.
Returns:
True if successful

bool FrameDir::write ( std::ostream &  Os,
bool  Longlist = false,
gps_t  Start = 0,
gps_t  Stop = 0,
bool  SupHead = false 
)

Write the list of frame files to a text file. brief Write list file.

Parameters:
Os std::ostream to be written to.
Longlist If true, prints one file per line.
Start Start time (GPS).
Stop Stop time (GPS).
SupHead If true, suppresses file:// head.
Returns:
True if successful

std::ostream& FrameDir::operator<< ( std::ostream &  Os  ) 

Write the list of frame files to an output stream. brief Write list to stream.

Parameters:
Os Output stream
Returns:
Output stream

static bool FrameDir::parseName ( const char *  File,
gps_t time,
gps_t tlen,
char *  pre = 0,
char *  post = 0 
) [static]

Parse a frame file name. brief Parse frame file name

Parameters:
File File name.
time GPS time of frame.
tlen Duration of frame.
pre File name prefix (includes last dash).
post File name postfix.
Returns:
True if a valid frame file name


The documentation for this class was generated from the following file:
Generated on Sun Mar 8 19:21:07 2009 for dmt by  doxygen 1.5.4