Class MessageCache.

Inherits Cache

The MessageCache class caches messages until the Allocator decides to clear out old Garbage. As a special feature, it can also cache messages a few seconds longer, although that should be used sparingly.


Constructs an empty MessageCache. Should not be called directly, only via insert() and find().

Reimplements Garbage::Garbage().

static Message * MessageCache::find( Mailbox * mailbox, uint uid )

Looks for a message in mailbox with uid in the cache and returns a pointer to it, or a null pointer.

static void MessageCache::insert( Mailbox * mb, uint uid, Message * m )

Inserts m into the cache, such that a find( mb, uid ) will find it.

static Message * MessageCache::provide( Mailbox * mailbox, uint uid )

Ensures that there is a message with mailbox and uid in the cache, and returns a pointer to it.

This web page based on source code belonging to The Archiveopteryx Developers. All rights reserved.