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

pan::ArticleCache Class Reference
[Backend Interfaces]

#include <article-cache.h>

List of all members.

Detailed Description

A disk cache for article bodies.

This allows a cache to be set to a certain maximum size, where the oldest articles will be aged out when the cache is full.

It also has a lock/unlock mechanism to allow the cache to grow past its limit briefly to allow large multipart articles' pieces to all be held at once (for decoding).

FIXME: This should probably be an interface class implemented in data-impl in the same way profiles was.

Definition at line 57 of file article-cache.h.

Public Types

typedef std::vector< Quarkmid_sequence_t
typedef std::vector< std::string > strings_t

Public Member Functions

bool add (const Quark &message_id, const StringView &article)
void add_listener (Listener *l)
 ArticleCache (const StringView &path, size_t max_megs=10)
void clear ()
bool contains (const Quark &message_id) const
strings_t get_filenames (const mid_sequence_t &)
GMimeMessage * get_message (const mid_sequence_t &)
void release (const mid_sequence_t &mids)
void remove_listener (Listener *l)
void reserve (const mid_sequence_t &mids)
void resize ()

Private Types

typedef std::set< Listener * > listeners_t
typedef std::map< Quark, MsgInfo > mid_to_info_t

Private Member Functions

void fire_added (const Quark &mid)
void fire_removed (const quarks_t &mid)
char * get_filename (char *buf, int buflen, const Quark &mid) const
GMimeStream * get_message_file_stream (const Quark &mid) const
GMimeStream * get_message_mem_stream (const Quark &mid) const
void resize (guint64 max_bytes)

Private Attributes

guint64 _current_bytes
listeners_t _listeners
std::map< Quark, int > _locks
size_t _max_megs
mid_to_info_t _mid_to_info
std::string _path


struct  Listener
struct  MsgInfo
struct  MsgInfoCompare

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

Generated by  Doxygen 1.6.0   Back to index