29 #include "../my_config.h"
55 U_I initial_size = 10240,
56 U_I unused_read_ratio = 10,
57 U_I observation_read_number = 100,
58 U_I max_size_hit_read_ratio = 50,
59 U_I unused_write_ratio = 10,
60 U_I observation_write_number = 100,
61 U_I max_size_hit_write_ratio = 50);
63 const cache & operator = (
const cache & ref) {
throw SRC_BUG; };
88 buf() { buffer = NULL; size = next = last = 0; };
89 buf(
const buf &ref) {
throw SRC_BUG; };
90 ~buf() {
if(buffer != NULL)
delete [] buffer; };
91 void resize(U_I newsize);
93 void clear() { next = last = 0; };
98 struct buf buffer_cache;
99 infinint current_position;
102 bool failed_increase;
106 U_I read_unused_rate;
107 U_I read_overused_rate;
110 U_I write_unused_rate;
111 U_I write_overused_rate;
113 U_I stat_read_unused;
114 U_I stat_read_overused;
115 U_I stat_read_counter;
117 U_I stat_write_overused;
118 U_I stat_write_counter;
122 void clear_read() {
if(read_mode) buffer_cache.clear(); };
infinint get_position()
get the current read/write position
bool skip(const infinint &pos)
skip at the absolute position
class generic_file is defined here as well as class fichierthe generic_file interface is widely used ...
U_I inherited_read(char *a, U_I size)
implementation of read() operation
void inherited_write(const char *a, U_I size)
implementation of the write() operation
bool skip_relative(S_I x)
skip relatively to the current position
void inherited_sync_write()
write down any pending data
void inherited_terminate()
destructor-like call, except that it is allowed to throw exceptions
generic_file(gf_mode m)
main constructor
the cache class implements a very basic read/write caching mechanism
switch module to limitint (32 ou 64 bits integers) or infinint
this is the interface class from which all other data transfer classes inherit
the arbitrary large positive integer class
bool skip_to_eof()
skip to the end of file