E-MailRelay

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

gnullfilter.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2001-2018 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 "gsmtp.h"
26 #include "gtimer.h"
27 #include "gfilter.h"
28
29 namespace GSmtp
30 {
31 class NullFilter ;
32 }
33
34 /// \class GSmtp::NullFilter
35 /// A Filter class that does nothing.
36 ///
37 class GSmtp::NullFilter : public Filter
38 {
39 public:
40 NullFilter( GNet::ExceptionHandler & , bool server_side ) ;
41 ///< Constructor.
42
43 NullFilter( GNet::ExceptionHandler & , bool server_side , unsigned int exit_code ) ;
44 ///< Constructor for a processor that behaves like an
45 ///< executable that always exits with the given
46 ///< exit code.
47
48 virtual ~NullFilter() ;
49 ///< Destructor.
50
51 virtual std::string id() const override ;
52 ///< Override from from GSmtp::Filter.
53
54 virtual bool simple() const override ;
55 ///< Override from from GSmtp::Filter.
56
57 virtual G::Slot::Signal1<int> & doneSignal() override ;
58 ///< Override from from GSmtp::Filter.
59
60 virtual void start( const std::string & path ) override ;
61 ///< Override from from GSmtp::Filter.
62
63 virtual void cancel() override ;
64 ///< Override from from GSmtp::Filter.
65
66 virtual bool abandoned() const override ;
67 ///< Override from from GSmtp::Filter.
68
69 virtual std::string response() const override ;
70 ///< Override from from GSmtp::Filter.
71
72 virtual std::string reason() const override ;
73 ///< Override from from GSmtp::Filter.
74
75 virtual bool special() const override ;
76 ///< Override from from GSmtp::Filter.
77
78 private:
79 NullFilter( const NullFilter & ) ; // not implemented
80 void operator=( const NullFilter & ) ; // not implemented
81 void onTimeout() ;
82
83 private:
84 G::Slot::Signal1<int> m_done_signal ;
85 Filter::Exit m_exit ;
86 std::string m_id ;
87 GNet::Timer<NullFilter> m_timer ;
88 } ;
89
90 #endif
GSmtp::NullFilter::cancel
virtual void cancel() override
Override from from GSmtp::Filter.
Definition: gnullfilter.cpp:74
GSmtp
SMTP and message-store classes.
Definition: gadminserver.h:39
GSmtp::NullFilter::simple
virtual bool simple() const override
Override from from GSmtp::Filter.
Definition: gnullfilter.cpp:49
GSmtp::NullFilter::special
virtual bool special() const override
Override from from GSmtp::Filter.
Definition: gnullfilter.cpp:54
GNet::ExceptionHandler
An abstract interface for handling exceptions thrown out of event-loop callbacks (socket events...
Definition: gexceptionhandler.h:44
GSmtp::NullFilter::start
virtual void start(const std::string &path) override
Override from from GSmtp::Filter.
Definition: gnullfilter.cpp:78
GSmtp::NullFilter::NullFilter
NullFilter(GNet::ExceptionHandler &, bool server_side)
Constructor.
Definition: gnullfilter.cpp:26
GSmtp::NullFilter::doneSignal
virtual G::Slot::Signal1< int > & doneSignal() override
Override from from GSmtp::Filter.
Definition: gnullfilter.cpp:69
GSmtp::Filter
An interface for processing a message file through a filter.
Definition: gfilter.h:48
GSmtp::NullFilter::~NullFilter
virtual ~NullFilter()
Destructor.
Definition: gnullfilter.cpp:40
gtimer.h
GSmtp::NullFilter
A Filter class that does nothing.
Definition: gnullfilter.h:37
GSmtp::NullFilter::reason
virtual std::string reason() const override
Override from from GSmtp::Filter.
Definition: gnullfilter.cpp:64
GSmtp::NullFilter::abandoned
virtual bool abandoned() const override
Override from from GSmtp::Filter.
Definition: gnullfilter.cpp:88
GSmtp::NullFilter::response
virtual std::string response() const override
Override from from GSmtp::Filter.
Definition: gnullfilter.cpp:59
gfilter.h
gsmtp.h
GSmtp::NullFilter::id
virtual std::string id() const override
Override from from GSmtp::Filter.
Definition: gnullfilter.cpp:44
GNet::Timer
A timer class template in which the timeout is delivered to the specified method. ...
Definition: gtimer.h:115
G::Slot::Signal1< int >
GSmtp::Filter::Exit
Interprets an executable filter's exit code.
Definition: gfilter.h:101