E-MailRelay

gverifierfactorybase.h
Go to the documentation of this file.
1//
2// Copyright (C) 2001-2024 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 gverifierfactorybase.h
19///
20
21#ifndef G_SMTP_VERIFIER_FACTORY_BASE_H
22#define G_SMTP_VERIFIER_FACTORY_BASE_H
23
24#include "gdef.h"
25#include "gverifier.h"
26#include "geventstate.h"
27#include "gstringview.h"
28#include <string>
29#include <utility>
30#include <memory>
31
32 namespace GSmtp
33{
34 class VerifierFactoryBase ;
35}
36
37//| \class GSmtp::VerifierFactoryBase
38/// A factory interface for addresss verifiers.
39///
40 class GSmtp::VerifierFactoryBase
41{
42 public:
43 struct Spec /// Verifier specification tuple for GSmtp::VerifierFactoryBase::newVerifier().
44 {
45 Spec() ;
46 Spec( std::string_view , std::string_view ) ;
47 std::string first ; // "exit", "file", "net", empty on error
48 std::string second ; // reason on error, or eg. "/bin/a" if "file"
49 } ;
50
51 virtual std::unique_ptr<Verifier> newVerifier( GNet::EventState ,
52 const Verifier::Config & config , const Spec & spec ) = 0 ;
53 ///< Returns a Verifier on the heap. Throws if an invalid
54 ///< or unsupported specification.
55
56 virtual ~VerifierFactoryBase() = default ;
57 ///< Destructor.
58} ;
59
60#endif
GNet::EventState
A lightweight object containing an ExceptionHandler pointer, optional ExceptionSource pointer and opt...
Definition: geventstate.h:131
GSmtp::VerifierFactoryBase
A factory interface for addresss verifiers.
Definition: gverifierfactorybase.h:41
GSmtp::VerifierFactoryBase::~VerifierFactoryBase
virtual ~VerifierFactoryBase()=default
Destructor.
GSmtp::VerifierFactoryBase::newVerifier
virtual std::unique_ptr< Verifier > newVerifier(GNet::EventState, const Verifier::Config &config, const Spec &spec)=0
Returns a Verifier on the heap.
geventstate.h
gstringview.h
gverifier.h
GSmtp
SMTP classes.
Definition: gadminserver.h:42
GSmtp::VerifierFactoryBase::Spec
Verifier specification tuple for GSmtp::VerifierFactoryBase::newVerifier().
Definition: gverifierfactorybase.h:44
GSmtp::Verifier::Config
Configuration passed to address verifier constructors.
Definition: gverifier.h:57