DATRW++ library: seismic data I/O with multiple formats
datrw::odatstream Class Reference

#include <datwrite.h>

Inheritance diagram for datrw::odatstream:
Collaboration diagram for datrw::odatstream:

Public Member Functions

virtual ~odatstream ()
 
bool debug ()
 indicate debug mode More...
 
void debug (const bool &debug)
 set debug mode More...
 
void flushfileheader ()
 flush file header to file More...
 
bool handlesfilefree () const
 true if file FREE block can be handled More...
 
bool handlesinfo () const
 true if INFO data can be handled More...
 
bool handlessrce () const
 true if SRCE data can be handled More...
 
bool handlestracefree () const
 true if trace FREE block can be handled More...
 
Properties properties () const
 query properties More...
 
Edatatype seriestype () const
 
void setfree (const sff::FREE &free)
 
void setinfo (const sff::INFO &info)
 
void setsrce (const sff::SRCE &srce)
 
void setwid2 (const sff::WID2 &wid2)
 
void writeseries (const Tdseries::Tcoc &series)
 write double data More...
 
void writeseries (const Tfseries::Tcoc &series)
 write single precision float data More...
 
void writeseries (const Tiseries::Tcoc &series)
 write integer data More...
 

Static Public Member Functions

static void help (std::ostream &os=std::cout, const char *name="idatsream")
 print some info about data conversion. More...
 

Protected Member Functions

 odatstream (std::ostream &os, const Edatatype &datatype, const bool &handlesfilefree=false, const bool &handlestracefree=false, const bool &handlessrce=false, const bool &handlesinfo=false, const bool &debug=false)
 constructor is protected: do not create an instance of this class More...
 
void cleartraceheader ()
 clear trace header flags More...
 
sff::FREE free () const
 return FREE data More...
 
bool hasfree () const
 free is available More...
 
bool hasinfo () const
 info is available More...
 
bool hassrce () const
 srce is available More...
 
bool haswid2 () const
 wid2 is available More...
 
sff::INFO info () const
 return SRCE data More...
 
void setdatatype (const Edatatype &daty)
 
sff::SRCE srce () const
 return SRCE data More...
 
sff::WID2 wid2 () const
 return WID2 data More...
 
virtual void writefileheader ()
 actually write the file header More...
 
virtual void writetrace (const Tdseries::Tcoc &series)
 write double data More...
 
virtual void writetrace (const Tfseries::Tcoc &series)
 write single precision float data More...
 
virtual void writetrace (const Tiseries::Tcoc &series)
 write integer data More...
 

Protected Attributes

bool Mdebug
 global debug flag More...
 
std::ostream & Mos
 output stream to be used by this class More...
 

Private Attributes

Edatatype Mdatatype
 
sff::FREE Mfree
 
bool Mfreeset
 
bool Mhandlesfilefree
 
bool Mhandlesinfo
 
bool Mhandlessrce
 
bool Mhandlestracefree
 
bool Mheaderflushed
 
sff::INFO Minfo
 
bool Minfoset
 
sff::SRCE Msrce
 
bool Msrceset
 
sff::WID2 Mwid2
 
bool Mwid2set
 

Detailed Description

output stream to write seismic data (abstract base)

The concept is based on SFF data contents and we will make use of SFF structures.

Note
Design considerations: For most data types it would be convenient to flush data traces to file upon a call to odatstream::writeseries(). For this reason trace data fill be collected by setwid2, setfree, and setinfo and will be flushed to file upon a call to writeseries. Prior to writing the first trace functions odatstream::setsrce() and odatstream::setfree() can be used to write file specific data. This file header will be flushed to file upon calling odatstream::flushfileheader() or upon the first call to odatstream::setwid2(). No file header fields can be written after the first call to odatstream::setwid2(). odatstream::setwid2() must be called for each trace. The other fields are optional.
Design considerations: Functions handlesfilefree(), handlessrce(), handlestracefree(), handlesinfo(), seriestype() contain constant and static functionality only. They could replaced by a static const member, like is done with openmode in derived classes. However, since it is useful to have these functions inherintance transparent, such that we cann call them from oanystream, they are implemented as ordinary members and provide data through a mechanism like is used for idatream::providesd().
All derived classes have to provide an openmode field. This cannot be provided through the function interface, since the field is requested prior to creating an instance of the class.
Due to the design descision just made, a copy of the series will be kept until the next trace will be written, since trace data is flushed in libsffxx upon writing the wid2 data for the next trace.

Definition at line 107 of file datwrite.h.


The documentation for this class was generated from the following files: