Class MailboxGroup.

Inherits Garbage

The MailboxGroup class models a client's group of mailboxes, including the likelihood that the client actually has such a group.

Many clients like to perform the same operation on many mailboxes. In order to limit load and improve performance, Archiveopteryx tries to detect that and restructure the work done.

An instance of this class is created when Archiveopteryx thinks that such an operation may be starting. When a mailbox operation is performed on something this object contains(), a user can check the number of hits() and if deemed large enough, it may choose to process the remaining contents() in advance and cache the results.

MailboxGroup::MailboxGroup( List<Mailbox> * mailboxes, IMAP * imap )

Constructs a group of mailboxes relating to the client of imap, and adds it to imap.

bool MailboxGroup::contains( const Mailbox * m )

Returns true if this group contains m, and false if not.

Also updates the hits() and misses counters, and removes itself if the number of misses is too large.

List<Mailbox> * MailboxGroup::contents() const

Returns a list containing the mailboxes (still) in this group. The list may be empty, but will not be null.

Note that when contains() returns true it removes its mailbox, so contents() will not return a just-tested mailbox.

uint MailboxGroup::count() const

Returns the number of mailboxes (still) in this group.

uint MailboxGroup::hits() const

Returns the number of times contains() returned true.

void MailboxGroup::remove( Mailbox * m )

Removes m from this group.

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