Public Member Functions | List of all members
GSmtp::Processor Class Referenceabstract

An interface for processing message files. More...

#include <gprocessor.h>

Inheritance diagram for GSmtp::Processor:
GSmtp::ExecutableProcessor GSmtp::NetworkProcessor GSmtp::NullProcessor GSmtp::SpamProcessor

Public Member Functions

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

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::abort ( )
pure virtual

Aborts any incomplete processing.

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

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

Returns true if the processor indicated that further processesing of the message should be cancelled.

This allows the processor to delete the message if it wants to.

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

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::NullProcessor, GSmtp::SpamProcessor, GSmtp::NetworkProcessor, and GSmtp::ExecutableProcessor.

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::NullProcessor, GSmtp::SpamProcessor, GSmtp::ExecutableProcessor, and GSmtp::NetworkProcessor.

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::NullProcessor, GSmtp::SpamProcessor, GSmtp::NetworkProcessor, and GSmtp::ExecutableProcessor.

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

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

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


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