Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

SimpleTransactionReader Class Reference

This is a class that implements StreamTransactionReader::nextTransactionBIS and StreamTransactionReader::nextTransactionBIS procedures. More...

#include <SimpleTransactionReader.hpp>

Inheritance diagram for SimpleTransactionReader:

Inheritance graph
[legend]
Collaboration diagram for SimpleTransactionReader:

Collaboration graph
[legend]
List of all members.

Public Types

typedef FileReprBase::params_t params_t
enum  Mode { READ, WRITE }

Public Member Functions

 SimpleTransactionReader (const params_t *par)
template<class BIS>
counter_t nextTransactionBIS (BIS &transaction)
template<class UAC>
counter_t nextTransactionUAC (UAC &transaction)
 TransactionReader (const params_t *par) throw (std::ios_base::failure)
 
Exceptions:
ios_base::failure this exception is thrown when the input file can not be read

void setLargestItem (item_t largest_item)
 It is possible to associate the largerst item in the transaction file with the transaction reader.
item_t getLargestItem () const
 It returns the largest item.
void rewind ()
void flush ()
std::streamsize readFromFile (char *buffer, std::streamsize buffer_size)
void writeToFile (const char *str, std::streamsize n)

Protected Attributes

item_t largest_item
std::ifstream input_stream
 stream to read
std::ofstream output_stream
 steam to write
char * file_buffer
 the low-level buffer
std::streamsize file_buffer_size
 the size of the lowest level buffer
Mode mode
 operating mode

Private Member Functions

bool getNextItem (int &item, char &c)
 This inline method is responsible to read in one item.

Detailed Description

This is a class that implements StreamTransactionReader::nextTransactionBIS and StreamTransactionReader::nextTransactionBIS procedures.

The main purpose of this class is to provide a basic class for the tests. If the size of the input is large, and the performance is important, you should use a BufferedTransactionReader like LBufferedTransactionReader or BufferedTransactionReader For more information about the performance of the different input classes test_results.html.

See also:
test_results.html

Definition at line 19 of file SimpleTransactionReader.hpp.


Member Typedef Documentation

typedef FileReprBase::params_t StreamRepr::params_t [inherited]
 

Reimplemented in SimpleAssocRuleWriter, SimpleOutput, DecoderBase< BufferedNormalOutput< StreamRepr > >, SimpleDFDecoder< BufferedNormalOutput< StreamRepr > >, BufferedNormalOutput< StreamRepr >, and OutputBase< StreamRepr >.

Definition at line 21 of file StreamRepr.hpp.


Member Enumeration Documentation

enum FileReprBase::Mode [inherited]
 

Enumerator:
READ 
WRITE 

Definition at line 20 of file FileReprBase.hpp.


Constructor & Destructor Documentation

SimpleTransactionReader::SimpleTransactionReader const params_t par  )  [inline]
 

Definition at line 23 of file SimpleTransactionReader.hpp.


Member Function Documentation

void StreamRepr::flush  )  [inline, inherited]
 

Reimplemented from FileReprBase.

Definition at line 63 of file StreamRepr.hpp.

References StreamRepr::output_stream.

item_t TransactionReader< StreamRepr >::getLargestItem  )  const [inline, inherited]
 

It returns the largest item.

Note:
You get the value that you have last set by the setLargestItem function. If the setLargestItem function was never called, then the return value is unspecified.

Definition at line 123 of file TransactionReader.hpp.

References TransactionReader< FR >::largest_item.

bool SimpleTransactionReader::getNextItem int &  item,
char &  c
[inline, private]
 

This inline method is responsible to read in one item.

Parameters:
item this will store the item
c the last character read by the function
Returns:
true if an item was succesfully read in

Definition at line 75 of file SimpleTransactionReader.hpp.

References StreamRepr::input_stream.

Referenced by nextTransactionBIS(), and nextTransactionUAC().

template<class BIS>
counter_t SimpleTransactionReader::nextTransactionBIS BIS &  transaction  )  [inline]
 

Reimplemented from TransactionReader< StreamRepr >.

Definition at line 41 of file SimpleTransactionReader.hpp.

References getNextItem(), and StreamRepr::input_stream.

template<class UAC>
counter_t SimpleTransactionReader::nextTransactionUAC UAC &  transaction  )  [inline]
 

Reimplemented from TransactionReader< StreamRepr >.

Definition at line 60 of file SimpleTransactionReader.hpp.

References getNextItem(), and StreamRepr::input_stream.

std::streamsize StreamRepr::readFromFile char *  buffer,
std::streamsize  buffer_size
[inline, inherited]
 

Reimplemented from FileReprBase.

Definition at line 68 of file StreamRepr.hpp.

References StreamRepr::input_stream.

void StreamRepr::rewind  )  [inline, inherited]
 

Reimplemented from FileReprBase.

Definition at line 58 of file StreamRepr.hpp.

References StreamRepr::input_stream.

void TransactionReader< StreamRepr >::setLargestItem item_t  largest_item  )  [inline, inherited]
 

It is possible to associate the largerst item in the transaction file with the transaction reader.

This method is just for the sake of the convenience (to avoid many parameter passing)

Definition at line 113 of file TransactionReader.hpp.

TransactionReader< StreamRepr >::TransactionReader const params_t par  )  throw (std::ios_base::failure) [inline, inherited]
 

Exceptions:
ios_base::failure this exception is thrown when the input file can not be read

Definition at line 38 of file TransactionReader.hpp.

void StreamRepr::writeToFile const char *  str,
std::streamsize  n
[inline, inherited]
 

Reimplemented from FileReprBase.

Definition at line 72 of file StreamRepr.hpp.

References StreamRepr::output_stream.


Member Data Documentation

char* FileReprBase::file_buffer [protected, inherited]
 

the low-level buffer

Definition at line 89 of file FileReprBase.hpp.

Referenced by FDRepr::FDRepr(), FILERepr::FILERepr(), FileReprBase::FileReprBase(), FDRepr::flush(), StreamRepr::StreamRepr(), FDRepr::writeToFile(), and FileReprBase::~FileReprBase().

std::streamsize FileReprBase::file_buffer_size [protected, inherited]
 

the size of the lowest level buffer

Definition at line 91 of file FileReprBase.hpp.

Referenced by FDRepr::FDRepr(), and FDRepr::flush().

std::ifstream StreamRepr::input_stream [protected, inherited]
 

stream to read

Definition at line 78 of file StreamRepr.hpp.

Referenced by getNextItem(), nextTransactionBIS(), nextTransactionUAC(), StreamRepr::readFromFile(), StreamRepr::rewind(), StreamRepr::StreamRepr(), and StreamRepr::~StreamRepr().

item_t TransactionReader< StreamRepr >::largest_item [protected, inherited]
 

Definition at line 127 of file TransactionReader.hpp.

Mode FileReprBase::mode [protected, inherited]
 

operating mode

Definition at line 93 of file FileReprBase.hpp.

Referenced by SimpleOutputTester::doTest(), FileReprBase::FileReprBase(), and FDRepr::~FDRepr().

std::ofstream StreamRepr::output_stream [protected, inherited]
 

steam to write

Definition at line 80 of file StreamRepr.hpp.

Referenced by StreamRepr::flush(), StreamRepr::StreamRepr(), SimpleAssocRuleWriter::writeAssocRule(), SimpleOutput::writeItemsetAndCounter(), StreamRepr::writeToFile(), and StreamRepr::~StreamRepr().


The documentation for this class was generated from the following file:
Generated on Sun Sep 17 17:55:39 2006 for FIM environment by  doxygen 1.4.4