E-MailRelay

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

gnetworkfilter.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 gnetworkfilter.h
19 ///
20
21 #ifndef G_SMTP_NETWORK_FILTER__H
22 #define G_SMTP_NETWORK_FILTER__H
23
24 #include "gdef.h"
25 #include "gsmtp.h"
26 #include "gfilter.h"
27 #include "gclientptr.h"
28 #include "grequestclient.h"
29 #include "geventhandler.h"
30
31 namespace GSmtp
32 {
33 class NetworkFilter ;
34 }
35
36 /// \class GSmtp::NetworkFilter
37 /// A Filter class that passes the name of a message file to a
38 /// remote process over the network.
39 ///
40 class GSmtp::NetworkFilter : public Filter
41 {
42 public:
43 NetworkFilter( GNet::ExceptionHandler & ,
44 bool server_side , const std::string & server_location ,
45 unsigned int connection_timeout , unsigned int response_timeout ) ;
46 ///< Constructor.
47
48 virtual ~NetworkFilter() ;
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 NetworkFilter( const NetworkFilter & ) ; // not implemented
80 void operator=( const NetworkFilter & ) ; // not implemented
81 void clientEvent( std::string , std::string ) ;
82
83 private:
84 G::Slot::Signal1<int> m_done_signal ;
85 GNet::ExceptionHandler & m_exception_handler ;
86 bool m_server_side ;
87 GNet::Location m_location ;
88 unsigned int m_connection_timeout ;
89 unsigned int m_response_timeout ;
90 bool m_lazy ;
91 GNet::ClientPtr<RequestClient> m_client ;
92 std::string m_text ;
93 } ;
94
95 #endif
GSmtp
SMTP and message-store classes.
Definition: gadminserver.h:39
GSmtp::NetworkFilter::start
virtual void start(const std::string &path) override
Override from from GSmtp::Filter.
Definition: gnetworkfilter.cpp:55
GSmtp::NetworkFilter
A Filter class that passes the name of a message file to a remote process over the network...
Definition: gnetworkfilter.h:40
GNet::ExceptionHandler
An abstract interface for handling exceptions thrown out of event-loop callbacks (socket events...
Definition: gexceptionhandler.h:44
GNet::Location
A class that holds a host/service name pair and the preferred address family (if any), and also the results of a name-to-address lookup, ie.
Definition: glocation.h:50
GSmtp::NetworkFilter::response
virtual std::string response() const override
Override from from GSmtp::Filter.
Definition: gnetworkfilter.cpp:87
GSmtp::Filter
An interface for processing a message file through a filter.
Definition: gfilter.h:48
GSmtp::NetworkFilter::~NetworkFilter
virtual ~NetworkFilter()
Destructor.
Definition: gnetworkfilter.cpp:40
gclientptr.h
GSmtp::NetworkFilter::reason
virtual std::string reason() const override
Override from from GSmtp::Filter.
Definition: gnetworkfilter.cpp:93
GSmtp::NetworkFilter::simple
virtual bool simple() const override
Override from from GSmtp::Filter.
Definition: gnetworkfilter.cpp:50
geventhandler.h
GSmtp::NetworkFilter::NetworkFilter
NetworkFilter(GNet::ExceptionHandler &, bool server_side, const std::string &server_location, unsigned int connection_timeout, unsigned int response_timeout)
Constructor.
Definition: gnetworkfilter.cpp:27
GSmtp::NetworkFilter::doneSignal
virtual G::Slot::Signal1< int > & doneSignal() override
Override from from GSmtp::Filter.
Definition: gnetworkfilter.cpp:98
GNet::ClientPtr
A smart pointer class for GNet::HeapClient that keeps track of when the contained instance deletes it...
Definition: gclientptr.h:33
gfilter.h
grequestclient.h
gsmtp.h
GSmtp::NetworkFilter::cancel
virtual void cancel() override
Override from from GSmtp::Filter.
Definition: gnetworkfilter.cpp:103
GSmtp::NetworkFilter::special
virtual bool special() const override
Override from from GSmtp::Filter.
Definition: gnetworkfilter.cpp:82
G::Slot::Signal1< int >
GSmtp::NetworkFilter::abandoned
virtual bool abandoned() const override
Override from from GSmtp::Filter.
Definition: gnetworkfilter.cpp:109
GSmtp::NetworkFilter::id
virtual std::string id() const override
Override from from GSmtp::Filter.
Definition: gnetworkfilter.cpp:45