#include <CacheDecoderBase.hpp>
Inheritance diagram for CacheDecoderBase< FR >:
Public Types | |
typedef DecoderBase< BufferedOutput< FR > >::params_t | params_t |
Public Member Functions | |
CacheDecoderBase (const params_t *par) | |
~CacheDecoderBase () | |
void | setCodeInverse (const std::vector< item_t > &code_inverse) |
DecoderBase (const params_t *par) | |
template<typename InputIterator> | |
void | writeItemsetAndCounter (InputIterator first, InputIterator last, counter_t support) |
Writes out one itemset and its counter. | |
void | pushItem (item_t item) |
Push an item to the top of the stack. | |
void | write (counter_t support) |
write the content of the stack together with a counter | |
void | pushItemWithWrite (item_t item, counter_t support) |
Push an item to the top of the stack and write the content of it together with a counter. | |
void | pushItemWithPrevSupport (item_t item) |
Push an item to the top of the stack and write the content of it together with the previously used counter. | |
void | popItem () |
Pop an item from the top of the stack. | |
void | popAll () |
remove all items form the stack | |
Static Public Member Functions | |
static bool DINLINE | isDFO () |
Protected Attributes | |
std::vector< std::pair< char *, unsigned int > > | code_inverse |
The inverse of code vector. | |
std::streamsize | buffer_size |
The size of the buffer. | |
char * | buffer |
The buffer. |
With this solution we can spare the expensive int to string conversion when writting out an itemset.
Definition at line 21 of file CacheDecoderBase.hpp.
|
Reimplemented from DecoderBase< BufferedOutput< FR > >. Reimplemented in CacheNormalDecoder< FR >. Definition at line 25 of file CacheDecoderBase.hpp. |
|
Definition at line 26 of file CacheDecoderBase.hpp. |
|
Definition at line 29 of file CacheDecoderBase.hpp. References CacheDecoderBase< FR >::code_inverse. |
|
Definition at line 28 of file DecoderBase.hpp. |
|
Reimplemented in CacheDFDecoder< FR >, SimpleBufferedDFDecoder< FR >, CacheNormalDecoder< FR >, bracz::NonOptDFOutput< FR >, NoOutput< ISDFO, FR >, BufferedNormalOutput< FR >, SimpleOutput, SimpleDFDecoder< BufferedNormalOutput< StreamRepr > >, and BufferedNormalOutput< StreamRepr >. Definition at line 32 of file OutputBase.hpp. |
|
remove all items form the stack
Reimplemented in CacheDFDecoder< FR >, SimpleBufferedDFDecoder< FR >, bracz::NonOptDFOutput< FR >, and NoOutput< ISDFO, FR >. Definition at line 92 of file OutputBase.hpp. Referenced by NoOutput< ISDFO, FR >::popAll(). |
|
Pop an item from the top of the stack.
Reimplemented in CacheDFDecoder< FR >, SimpleBufferedDFDecoder< FR >, bracz::NonOptDFOutput< FR >, NoOutput< ISDFO, FR >, and SimpleDFDecoder< BufferedNormalOutput< StreamRepr > >. Definition at line 87 of file OutputBase.hpp. Referenced by NoOutput< ISDFO, FR >::popItem(). |
|
Push an item to the top of the stack.
Reimplemented in CacheDFDecoder< FR >, SimpleBufferedDFDecoder< FR >, bracz::NonOptDFOutput< FR >, NoOutput< ISDFO, FR >, and SimpleDFDecoder< BufferedNormalOutput< StreamRepr > >. Definition at line 61 of file OutputBase.hpp. Referenced by NoOutput< ISDFO, FR >::pushItem(). |
|
Push an item to the top of the stack and write the content of it together with the previously used counter.
Reimplemented in CacheDFDecoder< FR >, SimpleBufferedDFDecoder< FR >, bracz::NonOptDFOutput< FR >, NoOutput< ISDFO, FR >, and SimpleDFDecoder< BufferedNormalOutput< StreamRepr > >. Definition at line 81 of file OutputBase.hpp. Referenced by NoOutput< ISDFO, FR >::pushItemWithPrevSupport(). |
|
Push an item to the top of the stack and write the content of it together with a counter.
Reimplemented in CacheDFDecoder< FR >, SimpleBufferedDFDecoder< FR >, bracz::NonOptDFOutput< FR >, NoOutput< ISDFO, FR >, and SimpleDFDecoder< BufferedNormalOutput< StreamRepr > >. Definition at line 73 of file OutputBase.hpp. Referenced by NoOutput< ISDFO, FR >::pushItemWithWrite(). |
|
Reimplemented from DecoderBase< BufferedOutput< FR > >. Definition at line 37 of file CacheDecoderBase.hpp. References BufferedOutput< FR >::buffer_size, and Formatter::IntToStringBack(). |
|
write the content of the stack together with a counter
Reimplemented in CacheDFDecoder< FR >, SimpleBufferedDFDecoder< FR >, bracz::NonOptDFOutput< FR >, NoOutput< ISDFO, FR >, and SimpleDFDecoder< BufferedNormalOutput< StreamRepr > >. Definition at line 67 of file OutputBase.hpp. Referenced by NoOutput< ISDFO, FR >::write(). |
|
Writes out one itemset and its counter.
Here you can see an example of the usage #include "common.hpp" #include "io/output/normal/SimpleOutput.hpp" #include "io/StreamRepr.hpp" #include "io/FILERepr.hpp" #include "io/output/OutputBase.hpp" #include "io/output/normal/BufferedNormalOutput.hpp" #include <set> #include <vector> using namespace std; int main() { typedef Bodon::SimpleOutput O_M; // typedef BufferedNormalOutput<FStreamOutput> O_M; // typedef BufferedNormalOutput<FILEOutput> O_M; O_M::params_t par; par.file_name = "output.txt"; O_M o_manager(&par); counter_t support = 19283; // itemset is stored in an array item_t itemset_array[] = {1, 4, 2, 8, 5, 7}; const int N = sizeof(itemset_array) / sizeof(item_t); o_manager.writeItemsetAndCounter( (item_t*) itemset_array, itemset_array + N, support); // itemset is stored in an vector vector<item_t> itemset_vector(itemset_array, itemset_array + N); o_manager.writeItemsetAndCounter( itemset_vector.begin(), itemset_vector.end(), support); // itemset is stored in an set set<item_t> itemset_set(itemset_array, itemset_array + N); o_manager.writeItemsetAndCounter( itemset_set.begin(), itemset_set.end(), support); return 1; } Reimplemented in CacheNormalDecoder< FR >, NoOutput< ISDFO, FR >, BufferedNormalOutput< FR >, SimpleOutput, and BufferedNormalOutput< StreamRepr >. Definition at line 51 of file OutputBase.hpp. Referenced by NoOutput< ISDFO, FR >::writeItemsetAndCounter(). |
|
|
The size of the buffer.
Definition at line 45 of file BufferedOutput.hpp. Referenced by BufferedOutput< StreamRepr >::BufferedOutput(), CacheDecoderBase< FR >::setCodeInverse(), CacheNormalDecoder< FR >::writeItemsetAndCounter(), and BufferedNormalOutput< StreamRepr >::writeItemsetAndCounter(). |
|
The inverse of code vector. code_inverse[i] stores the string representation of that item whose new code is i. Definition at line 63 of file CacheDecoderBase.hpp. Referenced by CacheDFDecoder< FR >::pushItem(), CacheNormalDecoder< FR >::writeItemsetAndCounter(), and CacheDecoderBase< FR >::~CacheDecoderBase(). |