libdballe  6.8
Public Member Functions | Protected Member Functions
dballe::AofFile Class Reference
Inheritance diagram for dballe::AofFile:
dballe::File

Public Member Functions

 AofFile (const std::string &name, FILE *fd, bool close_on_exit=true)
 
virtual Encoding type () const throw ()
 Get the name of the dba_file. More...
 
bool read (Rawmsg &msg)
 Read a message from the file. More...
 
void write (const Rawmsg &msg)
 Write the encoded message data to the file. More...
 
void read_header ()
 Read the file header, perform some consistency checks then discard the data.
 
void write_dummy_header ()
 Write a dummy file header.
 
void fix_header ()
 Rewrite the file header, scanning the file to compute a correct one.
 
- Public Member Functions inherited from dballe::File
 File (const std::string &name, FILE *fd, bool close_on_exit=true)
 
FILE * stream () const throw ()
 Get the file stream.
 
const std::string & name () const throw ()
 Get the type of the dba_file. More...
 

Protected Member Functions

bool read_record (std::string &res)
 Read a Fortran Unformatted Sequential Binary record from a file. More...
 
void write_record (const std::string &res)
 Write a Fortran Unformatted Sequential Binary record to a file. More...
 
void write_record (const uint32_t *words, size_t wordcount)
 Write a Fortran Unformatted Sequential Binary record to a file. More...
 
void write_word (uint32_t word)
 Write a word to the file, byteswapping it for endianness if needed.
 

Additional Inherited Members

- Static Public Member Functions inherited from dballe::File
static std::auto_ptr< Filecreate (Encoding type, const std::string &name, const char *mode)
 Create a dba_file structure. More...
 
- Protected Attributes inherited from dballe::File
std::string m_name
 Name of the file.
 
FILE * fd
 FILE structure used to read or write to the file.
 
bool close_on_exit
 Set to true if fd should be closed when dba_file_delete() is called.
 
int idx
 Index of the last message read from the file or written to the file.
 

Member Function Documentation

bool dballe::AofFile::read ( Rawmsg msg)
virtual

Read a message from the file.

Parameters
msgThe Rawmsg that will hold the data.
Returns
true if a message has been found in the file, else false.

Implements dballe::File.

bool dballe::AofFile::read_record ( std::string &  res)
protected

Read a Fortran Unformatted Sequential Binary record from a file.

Parameters
resThe data read. The resulting data is an array of 32bit words that will be byteswapped to native endianness if needed.
Returns
true if a record was found, false on EOF
virtual Encoding dballe::AofFile::type ( ) const
throw (
)
inlinevirtual

Get the name of the dba_file.

Returns
The file name.

Implements dballe::File.

void dballe::AofFile::write ( const Rawmsg msg)
virtual

Write the encoded message data to the file.

Parameters
msgThe ::dba_rawmsg with the encoded data to write

Reimplemented from dballe::File.

void dballe::AofFile::write_record ( const std::string &  res)
protected

Write a Fortran Unformatted Sequential Binary record to a file.

Parameters
resThe data to be written, considered an array of 32bit words that will be byteswapped for endianness if needed
void dballe::AofFile::write_record ( const uint32_t *  words,
size_t  wordcount 
)
protected

Write a Fortran Unformatted Sequential Binary record to a file.

Parameters
wordsThe data to be written, as an array of 32bit words that will be byteswapped for endianness if needed

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