GSmtp::Processor Class Reference

An interface for processing message files. More...

#include <gprocessor.h>

Inheritance diagram for GSmtp::Processor:

GSmtp::ExecutableProcessor GSmtp::NetworkProcessor GSmtp::NullProcessor GSmtp::SpamProcessor

List of all members.

Public Member Functions

virtual ~Processor ()
 Destructor.
virtual void start (const std::string &path)=0
 Starts the processor for the given message file.
virtual G::Signal1< bool > & doneSignal ()=0
 Returns a signal which is raised once start() has completed or failed.
virtual void abort ()=0
 Aborts any incomplete processing.
virtual std::string text () const =0
 Returns a non-empty reason string if the processor failed.
virtual bool cancelled () const =0
 Returns true if the processor failed and further message processesing is to be cancelled.
virtual bool repoll () const =0
 Returns true if the processor indicated that the message store should be repolled immediately.


Detailed Description

An interface for processing message files.

 Foo::process()
 {
   m_processor->start( message ) ;
 }
 void Foo::processorDone( bool ok )
 {
   if( ok ) { ... }
   else if( m_processor->cancelled() ) { ... }
   else { handleError(m_processor->text()) ; }
   if( m_processor->repoll() ) { ... }
 }

Definition at line 51 of file gprocessor.h.


Constructor & Destructor Documentation

GSmtp::Processor::~Processor (  )  [virtual]

Destructor.

Definition at line 25 of file gprocessor.cpp.


Member Function Documentation

virtual void GSmtp::Processor::start ( const std::string &  path  )  [pure virtual]

Starts the processor for the given message file.

Any previous, incomplete processing is abort()ed.

Asynchronous completion is indicated by a doneSignal(). The signal may be raised before start() returns.

Implemented in GSmtp::ExecutableProcessor, GSmtp::NetworkProcessor, GSmtp::NullProcessor, and GSmtp::SpamProcessor.

virtual G::Signal1<bool>& GSmtp::Processor::doneSignal (  )  [pure virtual]

Returns a signal which is raised once start() has completed or failed.

The signal parameter is a success flag.

Implemented in GSmtp::ExecutableProcessor, GSmtp::NetworkProcessor, GSmtp::NullProcessor, and GSmtp::SpamProcessor.

virtual void GSmtp::Processor::abort (  )  [pure virtual]

Aborts any incomplete processing.

Implemented in GSmtp::ExecutableProcessor, GSmtp::NetworkProcessor, GSmtp::NullProcessor, and GSmtp::SpamProcessor.

virtual std::string GSmtp::Processor::text (  )  const [pure virtual]

Returns a non-empty reason string if the processor failed.

Implemented in GSmtp::ExecutableProcessor, GSmtp::NetworkProcessor, GSmtp::NullProcessor, and GSmtp::SpamProcessor.

virtual bool GSmtp::Processor::cancelled (  )  const [pure virtual]

Returns true if the processor failed and further message processesing is to be cancelled.

Implemented in GSmtp::ExecutableProcessor, GSmtp::NetworkProcessor, GSmtp::NullProcessor, and GSmtp::SpamProcessor.

virtual bool GSmtp::Processor::repoll (  )  const [pure virtual]

Returns true if the processor indicated that the message store should be repolled immediately.

This this indicator is a side-effect of message processing, independent of success or failure.

Implemented in GSmtp::ExecutableProcessor, GSmtp::NetworkProcessor, GSmtp::NullProcessor, and GSmtp::SpamProcessor.


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

Generated on Fri Apr 18 15:56:13 2008 for E-MailRelay by  doxygen 1.5.5