E-MailRelay

geventlogging.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 geventlogging.h
19///
20
21#ifndef GNET_EVENT_LOGGING_H
22#define GNET_EVENT_LOGGING_H
23
24#include "gdef.h"
25#include "gstringview.h"
26#include "gassert.h"
27#include <string>
28
29 namespace GNet
30{
31 class EventLogging ;
32}
33
34//| \class GNet::EventLogging
35/// An interface for GNet classes that define a logging context
36/// string.
37///
38/// The EventLogging interface pointer should be installed in an
39/// EventState object; then various GNet classes collaborate so
40/// that the G::LogOuput context is set appropriately when events
41/// are delivered to any objects that inherit copies of that
42/// EventState.
43///
44/// \see GNet::EventState, GNet::EventLoggingContext
45///
46 class GNet::EventLogging
47{
48 public:
49 explicit EventLogging( const EventLogging * ) ;
50 ///< Constructor. Sets the next() pointer.
51
52 virtual ~EventLogging() ;
53 ///< Destructor.
54
55 virtual std::string_view eventLoggingString() const ;
56 ///< Returns a string containing logging information
57 ///< for the object. The string-view should refer to
58 ///< a string data member or be a nullptr string-view
59 ///< if there is no logging information.
60
61 const EventLogging * next() const noexcept ;
62 ///< Returns the link pointer.
63
64public:
65 EventLogging( const EventLogging & ) = delete ;
66 EventLogging( EventLogging && ) = delete ;
67 EventLogging & operator=( const EventLogging & ) = delete ;
68 EventLogging & operator=( EventLogging && ) = delete ;
69
70private:
71 const EventLogging * m_next {nullptr} ;
72} ;
73
74#endif
GNet::EventLogging
An interface for GNet classes that define a logging context string.
Definition: geventlogging.h:47
GNet::EventLogging::EventLogging
EventLogging(const EventLogging *)
Constructor. Sets the next() pointer.
Definition: geventlogging.cpp:25
GNet::EventLogging::eventLoggingString
virtual std::string_view eventLoggingString() const
Returns a string containing logging information for the object.
Definition: geventlogging.cpp:34
GNet::EventLogging::~EventLogging
virtual ~EventLogging()
Destructor.
GNet::EventLogging::next
const EventLogging * next() const noexcept
Returns the link pointer.
Definition: geventlogging.cpp:39
gassert.h
gstringview.h
GNet
Network classes.
Definition: gdef.h:1243