E-MailRelay

gnullfilter.h
Go to the documentation of this file.
1//
2// Copyright (C) 2001-2021 Graeme Walker <graeme_walker@users.sourceforge.net>
3//
4// This program is free software: you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as published by
6// the Free Software Foundation, either version 3 of the License, or
7// (at your option) any later version.
8//
9// This program is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU General Public License for more details.
13//
14// You should have received a copy of the GNU General Public License
15// along with this program. If not, see <http://www.gnu.org/licenses/>.
16// ===
17///
18/// \file gnullfilter.h
19///
20
21#ifndef G_SMTP_NULL_FILTER_H
22#define G_SMTP_NULL_FILTER_H
23
24#include "gdef.h"
25#include "gtimer.h"
26#include "gfilter.h"
27
28 namespace GSmtp
29{
30 class NullFilter ;
31}
32
33//| \class GSmtp::NullFilter
34/// A Filter class that does nothing.
35///
36 class GSmtp::NullFilter : public Filter
37{
38 public:
39 NullFilter( GNet::ExceptionSink , bool server_side ) ;
40 ///< Constructor.
41
42 NullFilter( GNet::ExceptionSink , bool server_side , unsigned int exit_code ) ;
43 ///< Constructor for a processor that behaves like an
44 ///< executable that always exits with the given
45 ///< exit code.
46
47 private: // overrides
48 std::string id() const override ; // Override from from GSmtp::Filter.
49 bool simple() const override ; // Override from from GSmtp::Filter.
50 G::Slot::Signal<int> & doneSignal() override ; // Override from from GSmtp::Filter.
51 void start( const MessageId & ) override ; // Override from from GSmtp::Filter.
52 void cancel() override ; // Override from from GSmtp::Filter.
53 bool abandoned() const override ; // Override from from GSmtp::Filter.
54 std::string response() const override ; // Override from from GSmtp::Filter.
55 std::string reason() const override ; // Override from from GSmtp::Filter.
56 bool special() const override ; // Override from from GSmtp::Filter.
57
58 public:
59 ~NullFilter() override = default ;
60 NullFilter( const NullFilter & ) = delete ;
61 NullFilter( NullFilter && ) = delete ;
62 void operator=( const NullFilter & ) = delete ;
63 void operator=( NullFilter && ) = delete ;
64
65 private:
66 void onTimeout() ;
67
68 private:
69 G::Slot::Signal<int> m_done_signal ;
70 Filter::Exit m_exit ;
71 std::string m_id ;
72 GNet::Timer<NullFilter> m_timer ;
73} ;
74
75#endif
GNet::ExceptionSink
A tuple containing an ExceptionHandler interface pointer and a bound 'exception source' pointer.
Definition: gexceptionsink.h:100
GNet::Timer
A timer class template in which the timeout is delivered to the specified method.
Definition: gtimer.h:129
GSmtp::Filter
An interface for processing a message file through a filter.
Definition: gfilter.h:49
GSmtp::MessageId
A somewhat opaque identifer for a MessageStore message.
Definition: gmessagestore.h:43
GSmtp::NullFilter
A Filter class that does nothing.
Definition: gnullfilter.h:37
GSmtp::NullFilter::NullFilter
NullFilter(GNet::ExceptionSink, bool server_side)
Constructor.
Definition: gnullfilter.cpp:25
gfilter.h
gtimer.h
GSmtp
SMTP and message-store classes.
Definition: gadminserver.h:39
GSmtp::Filter::Exit
Interprets an executable filter's exit code.
Definition: gfilter.h:102
G::Slot::Signal< int >