Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members

FXEX::FXBinaryLogReader Class Reference

A binary log file allows applications to log entries to a file, faster and more compact than a normal log file. More...

#include <FXBinaryLogReader.h>

List of all members.

Public Methods

 FXBinaryLogReader (const FXString &file="", FXuint opts=0)
FXbool name (const FXString &file)
FXString name ()
FXbool opened ()
FXBinaryLogDataread ()
virtual ~FXBinaryLogReader ()

Friends

FXStreamoperator<< (FXStream &store, const FXBinaryLogReader &b)
FXStreamoperator>> (FXStream &store, FXBinaryLogReader &b)


Detailed Description

A binary log file allows applications to log entries to a file, faster and more compact than a normal log file.

How this differs from a normal log file is that, up to 1000% of the speed of a log file is consumed in the printf style parsing of the input string. By using numbers only, no parsing is necessary. As an added bonus, you dont log many bytes per log entry so the disk I/O time is reduced.

The upshot is that a binary logger can run many times quicker than a text file logger, and that the storage of that information is more compact. The downside is that you need a custom program to read the file (see FXBinaryLogReader).

File format:

Notes: 1. The log file stores the endian-ness of the CPU architecture so that the log file can later be read back on any type of CPU. 2. Log entries are automatically written on file open/close (as debug entries)

It is envisaged that you could use this logger in an embedded application. You would log the values you need, when you identify a condition that needs to be logged. You should create a specific enumerated value, for all possible log cases.

Definition at line 81 of file FXBinaryLogReader.h.


Constructor & Destructor Documentation

FXEX::FXBinaryLogReader::FXBinaryLogReader const FXString & file = "",
FXuint opts = 0
 

Give me a log file.

virtual FXEX::FXBinaryLogReader::~FXBinaryLogReader [virtual]
 

done.


Member Function Documentation

FXbool FXEX::FXBinaryLogReader::name const FXString & file
 

Change the location of the log file - change is immediate.

FXString FXEX::FXBinaryLogReader::name
 

get the current filename.

FXbool FXEX::FXBinaryLogReader::opened
 

indicates whether the log file can/will be read from.

FXBinaryLogData* FXEX::FXBinaryLogReader::read
 

read log entries from the file.


Friends And Related Function Documentation

FXStream& operator<< FXStream & store,
const FXBinaryLogReader & b
[friend]
 

Save to stream.

FXStream& operator>> FXStream & store,
FXBinaryLogReader & b
[friend]
 

load from stream.