- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Hierarchy
- Class Members

Classes | Public Member Functions | Static Public Member Functions | List of all members
GSmtp::MessageStore Class Referenceabstract

A class which allows SMTP messages (envelope+content) to be stored and retrieved. More...

`#include <gmessagestore.h>`

Inheritance diagram for GSmtp::MessageStore:

## Classes
class | Iterator
| An iterator class for GSmtp::MessageStore. More...
class | IteratorImp
| A base class for MessageStore::Iterator implementations. More...

## Public Member Functions
virtual | ~MessageStore ()
| Destructor. More...
virtual std::auto_ptr< NewMessage > | newMessage (const std::string &from)=0
| Creates a new message. More...
virtual bool | empty () const =0
| Returns true if the message store is empty. More...
virtual std::auto_ptr< StoredMessage > | get (unsigned long id)=0
| Pulls a message out of the store. More...
virtual Iterator | iterator (bool lock)=0
| Returns an iterator for stored messages. More...
virtual Iterator | failures ()=0
| Returns an iterator for failed messages. More...
virtual void | repoll ()=0
| Ensures that the next updated() signal() has its parameter set to true. More...
virtual void | unfailAll ()=0
| Causes messages marked as failed to be unmarked. More...
virtual void | updated ()=0
| Called by associated classes to indicate that the store has changed. More...
virtual G::Signal1< bool > & | signal ()=0
| Provides a signal which is activated when something might have changed in the store. More...

## Static Public Member Functions
static G::Path | defaultDirectory ()
| Returns a default spool directory, such as "/usr/local/var/spool/emailrelay". More...

## Detailed Description

A class which allows SMTP messages (envelope+content) to be stored and retrieved.

See also
  GSmtp::NewMessage, GSmtp::StoredMessage, GSmtp::ProtocolMessage

Definition at line 45 of file gmessagestore.h.

## Constructor & Destructor Documentation

GSmtp::MessageStore::~MessageStore | ( |  | ) |
| virtual

Destructor.

Definition at line 27 of file gmessagestore.cpp.

## Member Function Documentation

G::Path GSmtp::MessageStore::defaultDirectory | ( |  | ) |
| static

Returns a default spool directory, such as "/usr/local/var/spool/emailrelay".

(Typically has an os-specific implementation.)

Definition at line 30 of file gmessagestore_unix.cpp.

References G_SPOOLDIR.

Referenced by Main::Configuration::spoolDir(), and Main::CommandLineImp::switchSpec().

virtual bool GSmtp::MessageStore::empty | ( |  | ) | const
| pure virtual

Returns true if the message store is empty.

Implemented in GSmtp::FileStore.

Referenced by GSmtp::Client::sendMessagesFrom().

virtual Iterator GSmtp::MessageStore::failures | ( |  | ) |
| pure virtual

Returns an iterator for failed messages.

Implemented in GSmtp::FileStore.

virtual std::auto_ptr<StoredMessage> GSmtp::MessageStore::get | ( | unsigned long | id | ) |
| pure virtual

Pulls a message out of the store.

Throws execptions on error.

See also NewMessage::id().

As a side effect some stored messages may be marked as bad, or deleted (if they have no recipients).

Implemented in GSmtp::FileStore.

virtual Iterator GSmtp::MessageStore::iterator | ( | bool | lock | ) |
| pure virtual

Returns an iterator for stored messages.

(Note that copies of iterators share state. For independent iterators call iterator() for each.)

If 'lock' is true then stored messages returned by the iterator are locked. Normally they are then processed (using StoredMessage::extractContentStream()) and then deleted (by StoredMessage::destroy()).

As a side effect of iteration when 'lock' is true, then some stored messages may be marked as bad, or deleted (if they have no recipients).

Implemented in GSmtp::FileStore.

virtual std::auto_ptr<NewMessage> GSmtp::MessageStore::newMessage | ( | const std::string & | from | ) |
| pure virtual

Creates a new message.

Implemented in GSmtp::FileStore.

virtual void GSmtp::MessageStore::repoll | ( |  | ) |
| pure virtual

Ensures that the next updated() signal() has its parameter set to true.

Implemented in GSmtp::FileStore.

virtual G::Signal1<bool>& GSmtp::MessageStore::signal | ( |  | ) |
| pure virtual

Provides a signal which is activated when something might have changed in the store.

The boolean parameter is used to indicate that repoll()ing is requested.

Implemented in GSmtp::FileStore.

virtual void GSmtp::MessageStore::unfailAll | ( |  | ) |
| pure virtual

Causes messages marked as failed to be unmarked.

Implemented in GSmtp::FileStore.

virtual void GSmtp::MessageStore::updated | ( |  | ) |
| pure virtual

Called by associated classes to indicate that the store has changed.

Results in the signal() being emited.

Implemented in GSmtp::FileStore.

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

- gmessagestore.h
- gmessagestore.cpp
- gmessagestore_unix.cpp