Logo Search packages:      
Sourcecode: djvulibre version File versions  Download package

DjVuFileCache Class Reference

#include <DjVuFileCache.h>

Inheritance diagram for DjVuFileCache:


List of all members.

Detailed Description

DjVuFileCache# is a simple list of {DjVuFile} instances. It keeps track of the total size of all elements and can get rid of the oldest one once the total size becomes over some threshold. Its main purpose is to keep the added {DjVuFile} instances alive until their size exceeds some given threshold (set by {set_maximum_size}() function). The user is supposed to use {DjVuPortcaster::name_to_port}() to find a file corresponding to a given name. The cache provides no naming services

Definition at line 128 of file DjVuFileCache.h.

Public Member Functions

void add_file (const GP< DjVuFile > &file)
void clear (void)
void del_file (const DjVuFile *file)
void enable (bool en)
int get_count (void) const
int get_max_size (void) const
bool is_enabled (void) const
void set_max_size (int max_size)

Static Public Member Functions

static GP< DjVuFileCachecreate (const int max_size=5 *2 *1024 *1024)

Protected Member Functions

 DjVuFileCache (const int max_size=5 *2 *1024 *1024)
virtual void file_added (const GP< DjVuFile > &file)
virtual void file_cleared (const GP< DjVuFile > &file)
virtual void file_deleted (const GP< DjVuFile > &file)
GPList< Item > get_items (void)

Protected Attributes

GCriticalSection class_lock
volatile int count
 The reference counter.

Private Member Functions

int calculate_size (void)
void clear_to_size (int size)

Private Attributes

int cur_size
bool enabled
GPList< Item > list
int max_size


class  Item

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index