libdballe  5.18
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.
bool read (Rawmsg &msg)
 Read a message from the file.
void write (const Rawmsg &msg)
 Write the encoded message data to the file.
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.

Protected Member Functions

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

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 () [inline, virtual]

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: