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

TransactionReader< FR > Class Template Reference

#include <TransactionReader.hpp>

Inheritance diagram for TransactionReader< FR >:

Inheritance graph
[legend]
Collaboration diagram for TransactionReader< FR >:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 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

template<class BIS>
counter_t nextTransactionBIS (BIS &transaction)
 Reads in one transaction from the file and writes it to a class whose type is given by the template.
template<class UAC>
counter_t nextTransactionUAC (UAC &transaction)
 Reads in one transaction from the file and writes it to a class whose type is given by the template.
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.

Protected Attributes

item_t largest_item

Classes

class  params_t

Detailed Description

template<class FR = FDRepr>
class TransactionReader< FR >

Definition at line 19 of file TransactionReader.hpp.


Constructor & Destructor Documentation

template<class FR = FDRepr>
TransactionReader< FR >::TransactionReader const params_t par  )  throw (std::ios_base::failure) [inline]
 

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

Definition at line 38 of file TransactionReader.hpp.


Member Function Documentation

template<class FR = FDRepr>
item_t TransactionReader< FR >::getLargestItem  )  const [inline]
 

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.

template<class FR = FDRepr>
template<class BIS>
counter_t TransactionReader< FR >::nextTransactionBIS BIS &  transaction  )  [inline]
 

Reads in one transaction from the file and writes it to a class whose type is given by the template.

Parameters:
transaction this will be filled up wth the transaction found in the next line of the file.
Returns:
0 if the end of file is reached, otherwise the multiplicity of the read transaction. In the case of end of file, the transaction will be empty.
The template class must have a
 push_back 
method that inserts an item to the transaction. Hence stl::vector<item_t> or any stl::Back Insertion Sequencce template class is applicable. An other restriction is that the template class must have a
 clear 
method that clears its content.

Note:
If the type of the template is a stl::Back Insertion Sequencce then the transaction will not be sorted and it will not be checked, if the transaction contains duplicates.
Also note that the transaction will always be overwritten. For this the function
 clear() 
will be called.

Reimplemented in SimpleTransactionReader.

Definition at line 69 of file TransactionReader.hpp.

template<class FR = FDRepr>
template<class UAC>
counter_t TransactionReader< FR >::nextTransactionUAC UAC &  transaction  )  [inline]
 

Reads in one transaction from the file and writes it to a class whose type is given by the template.

Parameters:
transaction this will be filled up by the transaction found in the next line of the file.
Returns:
0 if the end of file is reached, otherwise the multiplicity of the read transaction. In the case of end of file, the transaction will be empty.
The template class must have a
 insert 
method that inserts an item to the transaction. Hence stl::set<item_t> or any stl::Unique Associative Container template class is applicable. An other restriction is that the template class must have a
 clear 
method that clears its content.

Note:
If the type of the template is a stl::Unique Associative Container then the transaction is obviously ascendingly sorted, and no duplicates occur.
Also note that the transaction will always be overwritten. For this the function
 clear() 
will be called.

Reimplemented in SimpleTransactionReader.

Definition at line 100 of file TransactionReader.hpp.

template<class FR = FDRepr>
void TransactionReader< FR >::setLargestItem item_t  largest_item  )  [inline]
 

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.


Member Data Documentation

template<class FR = FDRepr>
item_t TransactionReader< FR >::largest_item [protected]
 

Definition at line 127 of file TransactionReader.hpp.

Referenced by TransactionReader< StreamRepr >::getLargestItem().


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