From 421e8c8c793740aaf34feff761716c1c51d8f04e Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Mon, 20 Dec 2021 20:00:03 +0000 Subject: Add the final keyword to all remaining classes that can have it. --- include/bancache.h | 4 ++-- include/base.h | 11 +++++++---- include/channelmanager.h | 2 +- include/channels.h | 3 ++- include/clientprotocol.h | 21 ++++++++++++-------- include/clientprotocolevent.h | 6 ++++-- include/clientprotocolmsg.h | 39 +++++++++++++++++++++++++------------- include/command_parse.h | 2 +- include/configparser.h | 2 +- include/configreader.h | 15 ++++++++------- include/ctables.h | 11 +++++++---- include/cull.h | 5 +++-- include/dynamic.h | 3 ++- include/dynref.h | 15 ++++++++++----- include/event.h | 3 ++- include/extensible.h | 14 +++++++++----- include/filelogger.h | 3 ++- include/fileutils.h | 6 +++--- include/flat_map.h | 15 ++++++++++----- include/inspircd.h | 4 ++-- include/inspsocket.h | 9 ++++++--- include/iohook.h | 6 ++++-- include/listmode.h | 3 ++- include/logger.h | 7 ++++--- include/membership.h | 4 +++- include/message.h | 2 +- include/mode.h | 17 +++++++++++------ include/modechange.h | 4 ++-- include/modules.h | 11 +++++++---- include/modules/account.h | 3 ++- include/modules/away.h | 2 +- include/modules/callerid.h | 6 ++++-- include/modules/ctctags.h | 8 +++++--- include/modules/exemption.h | 2 +- include/modules/extban.h | 2 +- include/modules/geolocation.h | 9 ++++++--- include/modules/hash.h | 3 ++- include/modules/httpd.h | 23 +++++++++++++--------- include/modules/invite.h | 9 ++++++--- include/modules/ircv3.h | 6 ++++-- include/modules/ircv3_batch.h | 12 ++++++++---- include/modules/ircv3_replies.h | 8 ++++---- include/modules/ircv3_servertime.h | 6 ++++-- include/modules/isupport.h | 2 +- include/modules/ldap.h | 13 ++++++++----- include/modules/names.h | 3 ++- include/modules/shun.h | 3 ++- include/modules/sql.h | 11 +++++++---- include/modules/ssl.h | 17 +++++++++++------ include/modules/stats.h | 8 +++++--- include/modules/who.h | 3 ++- include/modules/whois.h | 6 ++++-- include/numericbuilder.h | 22 +++++++++++++-------- include/parammode.h | 6 ++++-- include/server.h | 3 ++- include/snomasks.h | 4 ++-- include/socket.h | 5 +++-- include/socketengine.h | 5 +++-- include/threadsocket.h | 3 ++- include/timer.h | 2 +- include/token_list.h | 2 +- include/uid.h | 2 +- include/usermanager.h | 2 +- include/users.h | 16 +++++++++++----- include/xline.h | 20 ++++++++++++------- 65 files changed, 317 insertions(+), 187 deletions(-) (limited to 'include') diff --git a/include/bancache.h b/include/bancache.h index 10477c33b..0463f7f9c 100644 --- a/include/bancache.h +++ b/include/bancache.h @@ -32,7 +32,7 @@ * entries expire every few hours, which is a reasonable expiry for any reasonable * sized network. */ -class CoreExport BanCacheHit +class CoreExport BanCacheHit final { public: /** Type of cached ban @@ -52,7 +52,7 @@ class CoreExport BanCacheHit /** A manager for ban cache, which allocates and deallocates and checks cached bans. */ -class CoreExport BanCacheManager +class CoreExport BanCacheManager final { /** A container of ban cache items. */ diff --git a/include/base.h b/include/base.h index 7b5f6232d..57084695b 100644 --- a/include/base.h +++ b/include/base.h @@ -80,7 +80,7 @@ class CoreExport usecountbase }; template -class reference +class reference final { T* value = nullptr; public: @@ -136,7 +136,8 @@ class reference * be loaded. If this happens, the error message returned by ModuleException::GetReason will be displayed to the user * attempting to load the module, or dumped to the console if the ircd is currently loading for the first time. */ -class CoreExport CoreException : public std::exception +class CoreExport CoreException + : public std::exception { protected: /** Holds the error message to be displayed @@ -174,7 +175,8 @@ class CoreExport CoreException : public std::exception }; class Module; -class CoreExport ModuleException : public CoreException +class CoreExport ModuleException + : public CoreException { public: /** This constructor can be used to specify an error message before throwing. @@ -200,7 +202,8 @@ enum ServiceType { }; /** A structure defining something that a module can provide */ -class CoreExport ServiceProvider : public Cullable +class CoreExport ServiceProvider + : public Cullable { public: /** Module that is providing this service */ diff --git a/include/channelmanager.h b/include/channelmanager.h index 78c9fa46b..f4a12a3ff 100644 --- a/include/channelmanager.h +++ b/include/channelmanager.h @@ -22,7 +22,7 @@ typedef std::unordered_map ChannelMap; /** Manages state relating to channels. */ -class CoreExport ChannelManager +class CoreExport ChannelManager final { private: /** A map of channel names to the channel object. */ diff --git a/include/channels.h b/include/channels.h index bb3c56238..7edb2b4c9 100644 --- a/include/channels.h +++ b/include/channels.h @@ -37,7 +37,8 @@ * This class represents a channel, and contains its name, modes, topic, topic set time, * etc, and an instance of the BanList type. */ -class CoreExport Channel : public Extensible +class CoreExport Channel final + : public Extensible { public: /** A map of Memberships on a channel keyed by User pointers diff --git a/include/clientprotocol.h b/include/clientprotocol.h index c70e61def..69ae1064f 100644 --- a/include/clientprotocol.h +++ b/include/clientprotocol.h @@ -34,7 +34,7 @@ namespace ClientProtocol /** Contains a message parsed from wire format. * Used by Serializer::Parse(). */ -struct ClientProtocol::ParseOutput +struct ClientProtocol::ParseOutput final { /** Command name, must not be empty. */ @@ -51,7 +51,7 @@ struct ClientProtocol::ParseOutput /** A selection of zero or more tags in a TagMap. */ -class ClientProtocol::TagSelection +class ClientProtocol::TagSelection final { std::bitset<64> selection; @@ -178,7 +178,8 @@ class ClientProtocol::MessageSource * All messages have a command name, a list of parameters and a map of tags, the last two can be empty. * They also always have a source, see class MessageSource. */ -class ClientProtocol::Message : public ClientProtocol::MessageSource +class ClientProtocol::Message + : public ClientProtocol::MessageSource { public: /** Contains information required to identify a specific version of a serialized message. @@ -533,7 +534,8 @@ class ClientProtocol::MessageTagEvent * with tags before the message is sent and they have the job of determining whether a user should * get a message tag or be allowed to send one. */ -class ClientProtocol::MessageTagProvider : public Events::ModuleEventListener +class ClientProtocol::MessageTagProvider + : public Events::ModuleEventListener { public: /** Constructor. @@ -580,7 +582,8 @@ class ClientProtocol::MessageTagProvider : public Events::ModuleEventListener * A protocol event hook is attached to a single event type. It has the ability to alter or block messages * sent to users which belong to the event the hook is attached to. */ -class ClientProtocol::EventHook : public Events::ModuleEventListener +class ClientProtocol::EventHook + : public Events::ModuleEventListener { public: static std::string GetEventName(const std::string& name) @@ -624,7 +627,8 @@ class ClientProtocol::EventHook : public Events::ModuleEventListener * Protocol event hooks can be attached to the instances of these providers. The core has event * providers for most common IRC events defined in RFC1459. */ -class ClientProtocol::EventProvider : public Events::ModuleEventProvider +class ClientProtocol::EventProvider final + : public Events::ModuleEventProvider { public: /** Constructor. @@ -641,7 +645,7 @@ class ClientProtocol::EventProvider : public Events::ModuleEventProvider /** Commonly used client protocol events. * Available via InspIRCd::GetRFCEvents(). */ -struct ClientProtocol::RFCEvents +struct ClientProtocol::RFCEvents final { EventProvider numeric; EventProvider join; @@ -678,7 +682,8 @@ struct ClientProtocol::RFCEvents /** Base class for client protocol serializers. * A serializer has to implement serialization and parsing of protocol messages to/from wire format. */ -class CoreExport ClientProtocol::Serializer : public DataProvider +class CoreExport ClientProtocol::Serializer + : public DataProvider { private: ClientProtocol::MessageTagEvent evprov; diff --git a/include/clientprotocolevent.h b/include/clientprotocolevent.h index 4ebcd0551..62be09b9c 100644 --- a/include/clientprotocolevent.h +++ b/include/clientprotocolevent.h @@ -29,7 +29,8 @@ namespace ClientProtocol } } -struct ClientProtocol::Events::Join : public ClientProtocol::Messages::Join, public ClientProtocol::Event +struct ClientProtocol::Events::Join + : public ClientProtocol::Messages::Join, public ClientProtocol::Event { Join() : ClientProtocol::Event(ServerInstance->GetRFCEvents().join, *this) @@ -49,7 +50,8 @@ struct ClientProtocol::Events::Join : public ClientProtocol::Messages::Join, pub } }; -class ClientProtocol::Events::Mode : public ClientProtocol::Event +class ClientProtocol::Events::Mode + : public ClientProtocol::Event { std::list modelist; std::vector modemsgplist; diff --git a/include/clientprotocolmsg.h b/include/clientprotocolmsg.h index e62f9373b..d451dc904 100644 --- a/include/clientprotocolmsg.h +++ b/include/clientprotocolmsg.h @@ -45,7 +45,8 @@ namespace ClientProtocol * The first parameter is the target of the numeric which is almost always the nick of the user * the numeric will be sent to. */ -class ClientProtocol::Messages::Numeric : public ClientProtocol::Message +class ClientProtocol::Messages::Numeric + : public ClientProtocol::Message { char numericstr[4]; @@ -102,7 +103,8 @@ class ClientProtocol::Messages::Numeric : public ClientProtocol::Message /** JOIN message. * Sent when a user joins a channel. */ -class ClientProtocol::Messages::Join : public ClientProtocol::Message +class ClientProtocol::Messages::Join + : public ClientProtocol::Message { Membership* memb; @@ -152,7 +154,8 @@ class ClientProtocol::Messages::Join : public ClientProtocol::Message /** PART message. * Sent when a user parts a channel. */ -struct ClientProtocol::Messages::Part : public ClientProtocol::Message +struct ClientProtocol::Messages::Part + : public ClientProtocol::Message { /** Constructor. * @param memb Member parting. @@ -170,7 +173,8 @@ struct ClientProtocol::Messages::Part : public ClientProtocol::Message /** KICK message. * Sent when a user is kicked from a channel. */ -struct ClientProtocol::Messages::Kick : public ClientProtocol::Message +struct ClientProtocol::Messages::Kick + : public ClientProtocol::Message { /** Constructor. * @param source User that does the kick. @@ -189,7 +193,8 @@ struct ClientProtocol::Messages::Kick : public ClientProtocol::Message /** QUIT message. * Sent when a user quits. */ -struct ClientProtocol::Messages::Quit : public ClientProtocol::Message +struct ClientProtocol::Messages::Quit + : public ClientProtocol::Message { /** Constructor. * @param source User quitting. @@ -206,7 +211,8 @@ struct ClientProtocol::Messages::Quit : public ClientProtocol::Message /** NICK message. * Sent when a user changes their nickname. */ -struct ClientProtocol::Messages::Nick : public ClientProtocol::Message +struct ClientProtocol::Messages::Nick + : public ClientProtocol::Message { /** Constructor. * @param source User changing nicks. @@ -222,7 +228,8 @@ struct ClientProtocol::Messages::Nick : public ClientProtocol::Message /** MODE message. * Sent when modes are changed on a user or channel. */ -class ClientProtocol::Messages::Mode : public ClientProtocol::Message +class ClientProtocol::Messages::Mode + : public ClientProtocol::Message { Channel* chantarget; User* usertarget; @@ -388,7 +395,8 @@ class ClientProtocol::Messages::Mode : public ClientProtocol::Message /** TOPIC message. */ -struct ClientProtocol::Messages::Topic : public ClientProtocol::Message +struct ClientProtocol::Messages::Topic + : public ClientProtocol::Message { /** Constructor. * @param source User changing the topic. @@ -405,7 +413,8 @@ struct ClientProtocol::Messages::Topic : public ClientProtocol::Message /** PRIVMSG and NOTICE message. */ -class ClientProtocol::Messages::Privmsg : public ClientProtocol::Message +class ClientProtocol::Messages::Privmsg + : public ClientProtocol::Message { void PushTargetChan(char status, const Channel* targetchan) { @@ -617,7 +626,8 @@ class ClientProtocol::Messages::Privmsg : public ClientProtocol::Message /** INVITE message. * Sent when a user is invited to join a channel. */ -struct ClientProtocol::Messages::Invite : public ClientProtocol::Message +struct ClientProtocol::Messages::Invite + : public ClientProtocol::Message { /** Constructor. * @param source User inviting the target user. @@ -635,7 +645,8 @@ struct ClientProtocol::Messages::Invite : public ClientProtocol::Message /** PING message. * Used to check if a connection is still alive. */ -struct ClientProtocol::Messages::Ping : public ClientProtocol::Message +struct ClientProtocol::Messages::Ping + : public ClientProtocol::Message { /** Constructor. * The ping cookie is the name of the local server. @@ -659,7 +670,8 @@ struct ClientProtocol::Messages::Ping : public ClientProtocol::Message /** PONG message. * Sent as a reply to PING. */ -struct ClientProtocol::Messages::Pong : public ClientProtocol::Message +struct ClientProtocol::Messages::Pong + : public ClientProtocol::Message { /** Constructor. * @param cookie Ping cookie. Must remain valid as long as this object is alive. @@ -676,7 +688,8 @@ struct ClientProtocol::Messages::Pong : public ClientProtocol::Message /** ERROR message. * Sent to clients upon disconnection. */ -struct ClientProtocol::Messages::Error : public ClientProtocol::Message +struct ClientProtocol::Messages::Error + : public ClientProtocol::Message { /** Constructor. * @param text Error text. diff --git a/include/command_parse.h b/include/command_parse.h index a6b9f6868..74de719ae 100644 --- a/include/command_parse.h +++ b/include/command_parse.h @@ -31,7 +31,7 @@ * call command handlers by name, and chop up comma separated * parameters into multiple calls. */ -class CoreExport CommandParser +class CoreExport CommandParser final { public: typedef std::unordered_map CommandMap; diff --git a/include/configparser.h b/include/configparser.h index ca22a613e..b28e81fdb 100644 --- a/include/configparser.h +++ b/include/configparser.h @@ -22,7 +22,7 @@ #pragma once -struct ParseStack +struct ParseStack final { std::vector reading; insp::flat_map vars; diff --git a/include/configreader.h b/include/configreader.h index bcbdbfdb9..4747a93a5 100644 --- a/include/configreader.h +++ b/include/configreader.h @@ -34,7 +34,7 @@ #include "token_list.h" /** Structure representing a single \ in config */ -class CoreExport ConfigTag +class CoreExport ConfigTag final { public: /** A mapping of configuration keys to their assigned values. */ @@ -112,7 +112,7 @@ public: /** Defines the server's length limits on various length-limited * items such as topics, nicknames, channel names etc. */ -class ServerLimits +class ServerLimits final { public: /** Maximum line length */ @@ -147,7 +147,7 @@ class ServerLimits size_t GetMaxMask() const { return MaxNick + 1 + MaxUser + 1 + MaxHost; } }; -struct CommandLineConf +struct CommandLineConf final { /** If this value is true, the owner of the * server specified -nofork on the command @@ -196,7 +196,7 @@ struct CommandLineConf char** argv; }; -class CoreExport OperInfo +class CoreExport OperInfo final { public: TokenList AllowedOperCommands; @@ -235,7 +235,7 @@ class CoreExport OperInfo * and storage of the configuration data needed to run the ircd, such as * the servername, connect classes, /ADMIN data, MOTDs and filenames etc. */ -class CoreExport ServerConfig +class CoreExport ServerConfig final { private: void ApplyModules(User* user); @@ -499,7 +499,8 @@ class CoreExport ServerConfig /** The background thread for config reading, so that reading from executable includes * does not block. */ -class CoreExport ConfigReaderThread : public Thread +class CoreExport ConfigReaderThread final + : public Thread { private: /** The new server configuration. */ @@ -533,7 +534,7 @@ class CoreExport ConfigReaderThread : public Thread }; /** Represents the status of a config load. */ -class CoreExport ConfigStatus +class CoreExport ConfigStatus final { public: /** Whether this is the initial config load. */ diff --git a/include/ctables.h b/include/ctables.h index 7bcdecda9..8e3c01664 100644 --- a/include/ctables.h +++ b/include/ctables.h @@ -87,7 +87,7 @@ enum class RouteType : uint8_t }; /** Describes the routing of an IRC message. */ -class RouteDescriptor +class RouteDescriptor final { public: /** The target of the message in question. */ @@ -135,7 +135,8 @@ class RouteDescriptor /** A structure that defines a command. Every command available * in InspIRCd must be defined as derived from Command. */ -class CoreExport CommandBase : public ServiceProvider +class CoreExport CommandBase + : public ServiceProvider { public: /** Encapsulates parameters to a command. */ @@ -219,7 +220,8 @@ class CoreExport CommandBase : public ServiceProvider virtual ~CommandBase() = default; }; -class CoreExport Command : public CommandBase +class CoreExport Command + : public CommandBase { protected: /** Initializes a new instance of the Command class. @@ -276,7 +278,8 @@ class CoreExport Command : public CommandBase virtual void TellNotRegistered(LocalUser* user, const Params& parameters); }; -class CoreExport SplitCommand : public Command +class CoreExport SplitCommand + : public Command { protected: /** Initializes a new instance of the SplitCommand class. diff --git a/include/cull.h b/include/cull.h index bcda9ccd7..b50fcb5e6 100644 --- a/include/cull.h +++ b/include/cull.h @@ -53,7 +53,7 @@ class CoreExport Cullable * avoid problems with references to deleted pointers if an object were deleted * during execution. */ -class CoreExport CullList +class CoreExport CullList final { std::vector list; std::vector SQlist; @@ -70,7 +70,8 @@ class CoreExport CullList }; /** Represents an action which is executable by an action list */ -class CoreExport ActionBase : public Cullable +class CoreExport ActionBase + : public Cullable { public: /** Executes this action. */ diff --git a/include/dynamic.h b/include/dynamic.h index a7842ffb1..1f797e864 100644 --- a/include/dynamic.h +++ b/include/dynamic.h @@ -37,7 +37,8 @@ /** The DLLManager class is able to load a module file by filename, * and locate its init_module symbol. */ -class CoreExport DLLManager : public Cullable +class CoreExport DLLManager final + : public Cullable { private: /** The last error string. */ diff --git a/include/dynref.h b/include/dynref.h index 6fdd24d74..778653b9b 100644 --- a/include/dynref.h +++ b/include/dynref.h @@ -22,7 +22,8 @@ #include "base.h" -class CoreExport dynamic_reference_base : public insp::intrusive_list_node +class CoreExport dynamic_reference_base + : public insp::intrusive_list_node { public: class CaptureHook @@ -65,7 +66,8 @@ inline void dynamic_reference_base::check() } template -class dynamic_reference : public dynamic_reference_base +class dynamic_reference + : public dynamic_reference_base { public: dynamic_reference(Module* Creator, const std::string& Name) @@ -94,7 +96,8 @@ class dynamic_reference : public dynamic_reference_base }; template -class dynamic_reference_nocheck : public dynamic_reference_base +class dynamic_reference_nocheck + : public dynamic_reference_base { public: dynamic_reference_nocheck(Module* Creator, const std::string& Name) @@ -122,14 +125,16 @@ class dynamic_reference_nocheck : public dynamic_reference_base }; class ModeHandler; -class ChanModeReference : public dynamic_reference_nocheck +class ChanModeReference final + : public dynamic_reference_nocheck { public: ChanModeReference(Module* mod, const std::string& modename) : dynamic_reference_nocheck(mod, "mode/" + modename) {} }; -class UserModeReference : public dynamic_reference_nocheck +class UserModeReference final + : public dynamic_reference_nocheck { public: UserModeReference(Module* mod, const std::string& modename) diff --git a/include/event.h b/include/event.h index f256f27c4..4b02ed420 100644 --- a/include/event.h +++ b/include/event.h @@ -133,7 +133,8 @@ class Events::ModuleEventProvider /** Base class for abstract classes describing cross-module events. * Subscribers should NOT inherit directly from this class. */ -class Events::ModuleEventListener : private dynamic_reference_base::CaptureHook +class Events::ModuleEventListener + : private dynamic_reference_base::CaptureHook { /** Reference to the provider, can be NULL if none of the provider modules are loaded */ diff --git a/include/extensible.h b/include/extensible.h index 26463b6aa..e829179d3 100644 --- a/include/extensible.h +++ b/include/extensible.h @@ -168,7 +168,7 @@ class CoreExport Extensible bool Serialize(Serializable::Data& data) override; }; -class CoreExport ExtensionManager +class CoreExport ExtensionManager final { public: typedef std::map ExtMap; @@ -188,7 +188,8 @@ class CoreExport ExtensionManager /** Represents a simple ExtensionItem. */ template > -class SimpleExtItem : public ExtensionItem +class SimpleExtItem + : public ExtensionItem { public: /** Initializes an instance of the SimpleExtItem class. @@ -235,7 +236,8 @@ class SimpleExtItem : public ExtensionItem }; /** Encapsulates an ExtensionItem which has a string value. */ -class CoreExport StringExtItem : public SimpleExtItem +class CoreExport StringExtItem + : public SimpleExtItem { protected: /** Whether to sync this StringExtItem across the network. */ @@ -264,7 +266,8 @@ class CoreExport StringExtItem : public SimpleExtItem }; /** Encapsulates an ExtensionItem which has a integer value. */ -class CoreExport IntExtItem : public ExtensionItem +class CoreExport IntExtItem + : public ExtensionItem { protected: /** Whether to sync this IntExtItem across the network. */ @@ -315,7 +318,8 @@ class CoreExport IntExtItem : public ExtensionItem }; /** Encapsulates an ExtensionItem which has a boolean value. */ -class CoreExport BoolExtItem : public ExtensionItem +class CoreExport BoolExtItem + : public ExtensionItem { protected: /** Whether to sync this BoolExtItem across the network. */ diff --git a/include/filelogger.h b/include/filelogger.h index f5d2caab6..9bf86918e 100644 --- a/include/filelogger.h +++ b/include/filelogger.h @@ -29,7 +29,8 @@ /** A logging class which logs to a streamed file. */ -class CoreExport FileLogStream : public LogStream +class CoreExport FileLogStream final + : public LogStream { private: FileWriter *f; diff --git a/include/fileutils.h b/include/fileutils.h index cd542b1f0..e3ba27e97 100644 --- a/include/fileutils.h +++ b/include/fileutils.h @@ -21,7 +21,7 @@ #pragma once /** Represents the position within a file. */ -class CoreExport FilePosition +class CoreExport FilePosition final { public: /** The name of the file that the position points to. */ @@ -45,7 +45,7 @@ class CoreExport FilePosition }; /** Provides an easy method of reading a text file into memory. */ -class CoreExport FileReader +class CoreExport FileReader final { /** The lines of text in the file. */ std::vector lines; @@ -79,7 +79,7 @@ class CoreExport FileReader }; /** Implements methods for file system access */ -class CoreExport FileSystem +class CoreExport FileSystem final { private: FileSystem() = delete; diff --git a/include/flat_map.h b/include/flat_map.h index b53a95ca2..04be3b1a4 100644 --- a/include/flat_map.h +++ b/include/flat_map.h @@ -29,7 +29,8 @@ namespace detail { template -class map_pair_compare : public Comp +class map_pair_compare final + : public Comp { typedef T value_type; typedef typename value_type::first_type key_type; @@ -202,7 +203,8 @@ class flat_map_base } // namespace detail template , typename ElementComp = Comp> -class flat_set : public detail::flat_map_base +class flat_set + : public detail::flat_map_base { typedef detail::flat_map_base base_type; @@ -256,7 +258,8 @@ class flat_set : public detail::flat_map_base }; template , typename ElementComp = Comp> -class flat_multiset : public detail::flat_map_base +class flat_multiset + : public detail::flat_map_base { typedef detail::flat_map_base base_type; @@ -310,7 +313,8 @@ class flat_multiset : public detail::flat_map_base }; template , typename ElementComp = Comp > -class flat_map : public detail::flat_map_base, Comp, T, detail::map_pair_compare, ElementComp> > +class flat_map + : public detail::flat_map_base, Comp, T, detail::map_pair_compare, ElementComp> > { typedef detail::flat_map_base, Comp, T, detail::map_pair_compare, ElementComp> > base_type; @@ -377,7 +381,8 @@ class flat_map : public detail::flat_map_base, Comp, T, detail:: }; template , typename ElementComp = Comp > -class flat_multimap : public detail::flat_map_base, Comp, T, detail::map_pair_compare, ElementComp> > +class flat_multimap + : public detail::flat_map_base, Comp, T, detail::map_pair_compare, ElementComp> > { typedef detail::flat_map_base, Comp, T, detail::map_pair_compare, ElementComp> > base_type; diff --git a/include/inspircd.h b/include/inspircd.h index e12ee74d3..c469e4d98 100644 --- a/include/inspircd.h +++ b/include/inspircd.h @@ -111,7 +111,7 @@ CoreExport extern InspIRCd* ServerInstance; * It is used by the InspIRCd class, which internally * has an instance of it. */ -class serverstats +class serverstats final { public: /** Number of accepted connections @@ -187,7 +187,7 @@ class serverstats * object, and a list of active Module objects, and facilities for Module * objects to interact with the core system it implements. */ -class CoreExport InspIRCd +class CoreExport InspIRCd final { private: /** The current time, updated in the mainloop diff --git a/include/inspsocket.h b/include/inspsocket.h index 712fd7891..b019c6cc5 100644 --- a/include/inspsocket.h +++ b/include/inspsocket.h @@ -78,7 +78,8 @@ class BufferedSocket; /** Used to time out socket connections */ -class CoreExport SocketTimeout : public Timer +class CoreExport SocketTimeout final + : public Timer { private: /** BufferedSocket the class is attached to @@ -111,7 +112,8 @@ class CoreExport SocketTimeout : public Timer * StreamSocket is a class that wraps a TCP socket and handles send * and receive queues, including passing them to IO hooks */ -class CoreExport StreamSocket : public EventHandler +class CoreExport StreamSocket + : public EventHandler { public: /** Socket send queue @@ -371,7 +373,8 @@ class CoreExport StreamSocket : public EventHandler * * To use BufferedSocket, you must inherit a class from it. */ -class CoreExport BufferedSocket : public StreamSocket +class CoreExport BufferedSocket + : public StreamSocket { public: /** Timeout object or NULL diff --git a/include/iohook.h b/include/iohook.h index 8055667a8..a04bc0faf 100644 --- a/include/iohook.h +++ b/include/iohook.h @@ -66,7 +66,8 @@ class IOHookProvider virtual void OnConnect(StreamSocket* sock) = 0; }; -class IOHook : public Cullable +class IOHook + : public Cullable { public: /** The IOHookProvider for this hook, contains information about the hook, @@ -108,7 +109,8 @@ class IOHook : public Cullable virtual int OnStreamSocketRead(StreamSocket* sock, std::string& recvq) = 0; }; -class IOHookMiddle : public IOHook +class IOHookMiddle + : public IOHook { /** Data already processed by the IOHook waiting to go down the chain */ diff --git a/include/listmode.h b/include/listmode.h index 910207263..afb6cf381 100644 --- a/include/listmode.h +++ b/include/listmode.h @@ -23,7 +23,8 @@ /** The base class for list modes, should be inherited. */ -class CoreExport ListModeBase : public ModeHandler +class CoreExport ListModeBase + : public ModeHandler { public: /** An item in a listmode's list diff --git a/include/logger.h b/include/logger.h index a3530325d..b68556f75 100644 --- a/include/logger.h +++ b/include/logger.h @@ -38,7 +38,7 @@ enum LogLevel /** Simple wrapper providing periodic flushing to a disk-backed file. */ -class CoreExport FileWriter +class CoreExport FileWriter final { protected: /** The log file (fd is inside this somewhere, @@ -91,7 +91,8 @@ class CoreExport FileWriter /** LogStream base class. Modules (and other stuff) inherit from this to decide what logging they are interested in, and what to do with it. */ -class CoreExport LogStream : public Cullable +class CoreExport LogStream + : public Cullable { protected: LogLevel loglvl; @@ -116,7 +117,7 @@ class CoreExport LogStream : public Cullable typedef std::map FileLogMap; -class CoreExport LogManager +class CoreExport LogManager final { private: /** Lock variable, set to true when a log is in progress, which prevents further logging from happening and creating a loop. diff --git a/include/membership.h b/include/membership.h index 1bac0cf95..18f06e2ef 100644 --- a/include/membership.h +++ b/include/membership.h @@ -32,7 +32,9 @@ * All prefix modes a member has is tracked by this object. Moreover, Memberships are Extensibles * meaning modules can add arbitrary data to them using extensions (see m_delaymsg for an example). */ -class CoreExport Membership : public Extensible, public insp::intrusive_list_node +class CoreExport Membership final + : public Extensible + , public insp::intrusive_list_node { public: /** Type of the Membership id diff --git a/include/message.h b/include/message.h index e7765d5d0..1ae49ee1f 100644 --- a/include/message.h +++ b/include/message.h @@ -88,7 +88,7 @@ class CoreExport MessageDetails }; /** Represents the target of a message (NOTICE, PRIVMSG, etc). */ -class CoreExport MessageTarget +class CoreExport MessageTarget final { public: /** An enumeration of possible message target types. */ diff --git a/include/mode.h b/include/mode.h index 7a07a0428..85a987cb4 100644 --- a/include/mode.h +++ b/include/mode.h @@ -96,7 +96,8 @@ class ParamModeBase; * mode is expected to have a parameter, then this is * equivalent to returning MODEACTION_DENY. */ -class CoreExport ModeHandler : public ServiceProvider +class CoreExport ModeHandler + : public ServiceProvider { public: typedef size_t Id; @@ -358,7 +359,8 @@ class CoreExport ModeHandler : public ServiceProvider * for example changing the topic on a channel having +t set requires a rank that is >= than the rank of a halfop, * but there is no such restriction when +t isn't set. */ -class CoreExport PrefixMode : public ModeHandler +class CoreExport PrefixMode + : public ModeHandler { protected: /** The prefix character granted by this mode. '@' for op, '+' for voice, etc. @@ -451,7 +453,8 @@ class CoreExport PrefixMode : public ModeHandler * is already set and not allowing it to be unset if it is already unset. * An example of a simple user mode is user mode +w. */ -class CoreExport SimpleUserMode : public ModeHandler +class CoreExport SimpleUserMode + : public ModeHandler { public: SimpleUserMode(Module* Creator, const std::string& Name, char modeletter, bool operonly = false) @@ -468,7 +471,8 @@ class CoreExport SimpleUserMode : public ModeHandler * is already set and not allowing it to be unset if it is already unset. * An example of a simple channel mode is channel mode +s. */ -class CoreExport SimpleChannelMode : public ModeHandler +class CoreExport SimpleChannelMode + : public ModeHandler { public: @@ -487,7 +491,8 @@ class CoreExport SimpleChannelMode : public ModeHandler * and attach it to the mode using Server::AddModeWatcher and Server::DelModeWatcher. * A ModeWatcher will be called both before and after the mode change. */ -class CoreExport ModeWatcher : public Cullable +class CoreExport ModeWatcher + : public Cullable { private: /** @@ -553,7 +558,7 @@ class CoreExport ModeWatcher : public Cullable * parses client to server MODE strings for user and channel modes, and performs * processing for the 004 mode list numeric, amongst other things. */ -class CoreExport ModeParser +class CoreExport ModeParser final { public: /** The maximum number of modes which can be created. */ diff --git a/include/modechange.h b/include/modechange.h index 4d21377c5..a5ef98e0a 100644 --- a/include/modechange.h +++ b/include/modechange.h @@ -28,7 +28,7 @@ namespace Modes /** A single mode to be changed */ -struct Modes::Change +struct Modes::Change final { bool adding; ModeHandler* mh; @@ -67,7 +67,7 @@ struct Modes::Change /** A list of mode changes that can be applied on a Channel or User */ -class Modes::ChangeList +class Modes::ChangeList final { public: typedef std::vector List; diff --git a/include/modules.h b/include/modules.h index af1a4d8f1..1293f69eb 100644 --- a/include/modules.h +++ b/include/modules.h @@ -68,7 +68,7 @@ enum ModuleFlags #define MOD_RES_DENY (ModResult(-1)) /** Represents the result of a module event. */ -class ModResult +class ModResult final { private: /** The underlying result value. */ @@ -190,7 +190,8 @@ do { \ WHILE_EACH_HOOK(n); \ } while (0) -class CoreExport DataProvider : public ServiceProvider +class CoreExport DataProvider + : public ServiceProvider { public: DataProvider(Module* Creator, const std::string& Name) @@ -283,7 +284,9 @@ enum Implementation * its methods will be called when irc server events occur. class inherited from module must be * instantiated by the ModuleFactory class (see relevant section) for the module to be initialised. */ -class CoreExport Module : public Cullable, public usecountbase +class CoreExport Module + : public Cullable + , public usecountbase { protected: /** Initializes a new instance of the Module class. @@ -1017,7 +1020,7 @@ class CoreExport Module : public Cullable, public usecountbase /** ModuleManager takes care of all things module-related * in the core. */ -class CoreExport ModuleManager +class CoreExport ModuleManager final { public: typedef std::multimap DataProviderMap; diff --git a/include/modules/account.h b/include/modules/account.h index eb478b948..6fedd889f 100644 --- a/include/modules/account.h +++ b/include/modules/account.h @@ -36,7 +36,8 @@ inline AccountExtItem* GetAccountExtItem() return static_cast(ServerInstance->Extensions.GetItem("accountname")); } -class AccountEventListener : public Events::ModuleEventListener +class AccountEventListener + : public Events::ModuleEventListener { public: AccountEventListener(Module* mod) diff --git a/include/modules/away.h b/include/modules/away.h index 563b599fe..c99ea18e5 100644 --- a/include/modules/away.h +++ b/include/modules/away.h @@ -71,7 +71,7 @@ class Away::EventListener virtual void OnUserBack(User* user) = 0; }; -class Away::EventProvider +class Away::EventProvider final : public Events::ModuleEventProvider { public: diff --git a/include/modules/callerid.h b/include/modules/callerid.h index 989a5918c..7b69d137f 100644 --- a/include/modules/callerid.h +++ b/include/modules/callerid.h @@ -25,7 +25,8 @@ namespace CallerID class API; } -class CallerID::APIBase : public DataProvider +class CallerID::APIBase + : public DataProvider { public: APIBase(Module* parent) @@ -41,7 +42,8 @@ class CallerID::APIBase : public DataProvider virtual bool IsOnAcceptList(User* source, User* target) = 0; }; -class CallerID::API : public dynamic_reference +class CallerID::API final + : public dynamic_reference { public: API(Module* parent) diff --git a/include/modules/ctctags.h b/include/modules/ctctags.h index fc8f952ce..bf7d373e4 100644 --- a/include/modules/ctctags.h +++ b/include/modules/ctctags.h @@ -30,7 +30,8 @@ namespace CTCTags class TagMessageDetails; } -class CTCTags::CapReference : public Cap::Reference +class CTCTags::CapReference final + : public Cap::Reference { public: CapReference(Module* mod) @@ -39,7 +40,8 @@ class CTCTags::CapReference : public Cap::Reference } }; -class CTCTags::TagMessage : public ClientProtocol::Message +class CTCTags::TagMessage final + : public ClientProtocol::Message { private: void PushTarget(const char* target, char status) @@ -87,7 +89,7 @@ private: } }; -class CTCTags::TagMessageDetails +class CTCTags::TagMessageDetails final { public: /** Whether to echo the tags at all. */ diff --git a/include/modules/exemption.h b/include/modules/exemption.h index a0e32e9e0..9fa059f7b 100644 --- a/include/modules/exemption.h +++ b/include/modules/exemption.h @@ -57,7 +57,7 @@ class CheckExemption::EventListener virtual ModResult OnCheckExemption(User* user, Channel* chan, const std::string& restriction) = 0; }; -class CheckExemption::EventProvider +class CheckExemption::EventProvider final : public Events::ModuleEventProvider { public: diff --git a/include/modules/extban.h b/include/modules/extban.h index 4f0031aef..5bf491d13 100644 --- a/include/modules/extban.h +++ b/include/modules/extban.h @@ -188,7 +188,7 @@ class ExtBan::Base }; /** Base class for acting extbans. */ -class ExtBan::Acting +class ExtBan::Acting final : public Base { public: diff --git a/include/modules/geolocation.h b/include/modules/geolocation.h index f6363ba40..b40ee8074 100644 --- a/include/modules/geolocation.h +++ b/include/modules/geolocation.h @@ -26,7 +26,8 @@ namespace Geolocation class Location; } -class Geolocation::APIBase : public DataProvider +class Geolocation::APIBase + : public DataProvider { public: APIBase(Module* parent) @@ -47,7 +48,8 @@ class Geolocation::APIBase : public DataProvider virtual Location* GetLocation(irc::sockets::sockaddrs& sa) = 0; }; -class Geolocation::API : public dynamic_reference +class Geolocation::API final + : public dynamic_reference { public: API(Module* parent) @@ -56,7 +58,8 @@ class Geolocation::API : public dynamic_reference } }; -class Geolocation::Location : public usecountbase +class Geolocation::Location final + : public usecountbase { private: /** The two character country code for this location. */ diff --git a/include/modules/hash.h b/include/modules/hash.h index 5799b9160..2c176868f 100644 --- a/include/modules/hash.h +++ b/include/modules/hash.h @@ -26,7 +26,8 @@ #include "modules.h" -class HashProvider : public DataProvider +class HashProvider + : public DataProvider { public: const unsigned int out_size; diff --git a/include/modules/httpd.h b/include/modules/httpd.h index 145dd70b3..92b2d855f 100644 --- a/include/modules/httpd.h +++ b/include/modules/httpd.h @@ -33,7 +33,8 @@ #include #include -class HTTPQueryParameters : public insp::flat_multimap +class HTTPQueryParameters final + : public insp::flat_multimap { public: bool get(const std::string& key, std::string& value) const @@ -80,7 +81,7 @@ class HTTPQueryParameters : public insp::flat_multimap } }; -struct HTTPRequestURI +struct HTTPRequestURI final { std::string path; HTTPQueryParameters query_params; @@ -89,7 +90,7 @@ struct HTTPRequestURI /** A modifiable list of HTTP header fields */ -class HTTPHeaders +class HTTPHeaders final { protected: std::map headers; @@ -163,7 +164,7 @@ class HttpServerSocket; /** This class represents a HTTP request. */ -class HTTPRequest +class HTTPRequest final { protected: std::string type; @@ -245,7 +246,7 @@ class HTTPRequest * form a valid HTTP response: the document data and a response code. * You can add additional HTTP headers, if you want. */ -class HTTPDocumentResponse +class HTTPDocumentResponse final { public: /** Module that generated this reply @@ -274,7 +275,8 @@ class HTTPDocumentResponse } }; -class HTTPdAPIBase : public DataProvider +class HTTPdAPIBase + : public DataProvider { public: HTTPdAPIBase(Module* parent) @@ -291,7 +293,8 @@ class HTTPdAPIBase : public DataProvider /** The API provided by the httpd module that allows other modules to respond to incoming * HTTP requests */ -class HTTPdAPI : public dynamic_reference +class HTTPdAPI final + : public dynamic_reference { public: HTTPdAPI(Module* parent) @@ -300,7 +303,8 @@ class HTTPdAPI : public dynamic_reference } }; -class HTTPACLEventListener : public Events::ModuleEventListener +class HTTPACLEventListener + : public Events::ModuleEventListener { public: HTTPACLEventListener(Module* mod) @@ -311,7 +315,8 @@ class HTTPACLEventListener : public Events::ModuleEventListener virtual ModResult OnHTTPACLCheck(HTTPRequest& req) = 0; }; -class HTTPRequestEventListener : public Events::ModuleEventListener +class HTTPRequestEventListener + : public Events::ModuleEventListener { public: HTTPRequestEventListener(Module* mod) diff --git a/include/modules/invite.h b/include/modules/invite.h index 5786f7dc3..1e8f417c4 100644 --- a/include/modules/invite.h +++ b/include/modules/invite.h @@ -29,7 +29,8 @@ namespace Invite typedef insp::intrusive_list List; } -class Invite::APIBase : public DataProvider +class Invite::APIBase + : public DataProvider { public: APIBase(Module* parent); @@ -72,7 +73,8 @@ class Invite::APIBase : public DataProvider virtual bool Remove(LocalUser* user, Channel* chan) = 0; }; -class Invite::API : public dynamic_reference +class Invite::API final + : public dynamic_reference { public: API(Module* parent) @@ -85,7 +87,8 @@ class Invite::API : public dynamic_reference * The Invite class contains all data about a pending invite. * Invite objects are referenced from the user and the channel they belong to. */ -class Invite::Invite : public insp::intrusive_list_node, public insp::intrusive_list_node +class Invite::Invite final + : public insp::intrusive_list_node, public insp::intrusive_list_node { public: /** User the invite is for diff --git a/include/modules/ircv3.h b/include/modules/ircv3.h index 06144835f..35be3a4ea 100644 --- a/include/modules/ircv3.h +++ b/include/modules/ircv3.h @@ -29,7 +29,8 @@ namespace IRCv3 class CapTag; } -class IRCv3::WriteNeighborsWithCap : public User::ForEachNeighborHandler +class IRCv3::WriteNeighborsWithCap final + : public User::ForEachNeighborHandler { private: const Cap::Capability& cap; @@ -70,7 +71,8 @@ class IRCv3::WriteNeighborsWithCap : public User::ForEachNeighborHandler * Template parameter T is the derived class. */ template -class IRCv3::CapTag : public ClientProtocol::MessageTagProvider +class IRCv3::CapTag + : public ClientProtocol::MessageTagProvider { protected: Cap::Capability cap; diff --git a/include/modules/ircv3_batch.h b/include/modules/ircv3_batch.h index 073fb535f..27cbe1d9b 100644 --- a/include/modules/ircv3_batch.h +++ b/include/modules/ircv3_batch.h @@ -43,7 +43,9 @@ namespace IRCv3 * Implements batch starting and stopping. When it becomes unavailable (due to e.g. module unload) * all running batches are stopped. */ -class IRCv3::Batch::Manager : public DataProvider, public ClientProtocol::MessageTagProvider +class IRCv3::Batch::Manager + : public DataProvider + , public ClientProtocol::MessageTagProvider { public: /** Constructor. @@ -81,7 +83,7 @@ class IRCv3::Batch::Manager : public DataProvider, public ClientProtocol::Messag * batch message for B. * A message may only be part of a single batch at any given time. */ -class IRCv3::Batch::Batch +class IRCv3::Batch::Batch final { Manager* manager = nullptr; const std::string type; @@ -171,7 +173,8 @@ class IRCv3::Batch::Batch /** Batch API. Use this to access the Manager. */ -class IRCv3::Batch::API : public dynamic_reference_nocheck +class IRCv3::Batch::API final + : public dynamic_reference_nocheck { public: API(Module* mod) @@ -183,7 +186,8 @@ class IRCv3::Batch::API : public dynamic_reference_nocheck /** Reference to the batch cap. * Can be used to check whether a user has the batch client cap enabled. */ -class IRCv3::Batch::CapReference : public Cap::Reference +class IRCv3::Batch::CapReference final + : public Cap::Reference { public: CapReference(Module* mod) diff --git a/include/modules/ircv3_replies.h b/include/modules/ircv3_replies.h index fc4c7f5dd..7bf594170 100644 --- a/include/modules/ircv3_replies.h +++ b/include/modules/ircv3_replies.h @@ -34,7 +34,7 @@ namespace IRCv3 } /** Reference to the inspircd.org/standard-replies cap. */ -class IRCv3::Replies::CapReference +class IRCv3::Replies::CapReference final : public Cap::Reference { public: @@ -128,7 +128,7 @@ class IRCv3::Replies::Reply }; /** Sends a FAIL standard reply. */ -class IRCv3::Replies::Fail +class IRCv3::Replies::Fail final : public IRCv3::Replies::Reply { public: @@ -142,7 +142,7 @@ public: }; /** Sends a NOTE standard reply. */ -class IRCv3::Replies::Note +class IRCv3::Replies::Note final : public IRCv3::Replies::Reply { public: @@ -156,7 +156,7 @@ public: }; /** Sends a WARN standard reply. */ -class IRCv3::Replies::Warn +class IRCv3::Replies::Warn final : public IRCv3::Replies::Reply { public: diff --git a/include/modules/ircv3_servertime.h b/include/modules/ircv3_servertime.h index 4befbaaba..7737b35d4 100644 --- a/include/modules/ircv3_servertime.h +++ b/include/modules/ircv3_servertime.h @@ -46,7 +46,8 @@ namespace IRCv3 * was generated by us. If a message has server time attached then recipient clients who have negotiated * the appropriate protocol extension will receive it. */ -class IRCv3::ServerTime::Manager : public DataProvider +class IRCv3::ServerTime::Manager + : public DataProvider { protected: ClientProtocol::MessageTagProvider* tagprov; @@ -82,7 +83,8 @@ class IRCv3::ServerTime::Manager : public DataProvider /** Server time API. Use this to access the Manager. */ -class IRCv3::ServerTime::API : public dynamic_reference_nocheck +class IRCv3::ServerTime::API final + : public dynamic_reference_nocheck { public: API(Module* mod) diff --git a/include/modules/isupport.h b/include/modules/isupport.h index 3b9d4b3c5..ad92a9a30 100644 --- a/include/modules/isupport.h +++ b/include/modules/isupport.h @@ -43,7 +43,7 @@ class ISupport::EventListener virtual void OnBuildISupport(TokenMap& tokens) = 0; }; -class ISupport::EventProvider +class ISupport::EventProvider final : public Events::ModuleEventProvider { public: diff --git a/include/modules/ldap.h b/include/modules/ldap.h index ce3f750a9..760cc4ec2 100644 --- a/include/modules/ldap.h +++ b/include/modules/ldap.h @@ -20,7 +20,8 @@ typedef int LDAPQuery; -class LDAPException : public ModuleException +class LDAPException final + : public ModuleException { public: LDAPException(const std::string& reason) : ModuleException(reason) { } @@ -28,7 +29,7 @@ class LDAPException : public ModuleException virtual ~LDAPException() noexcept = default; }; -struct LDAPModification +struct LDAPModification final { enum LDAPOperation { @@ -44,7 +45,8 @@ struct LDAPModification typedef std::vector LDAPMods; -struct LDAPAttributes : public std::map > +struct LDAPAttributes final + : public std::map > { size_t size(const std::string& attr) const { @@ -88,7 +90,7 @@ enum QueryType QUERY_COMPARE }; -struct LDAPResult +struct LDAPResult final { std::vector messages; std::string error; @@ -136,7 +138,8 @@ class LDAPInterface virtual void OnError(const LDAPResult& err) = 0; }; -class LDAPProvider : public DataProvider +class LDAPProvider + : public DataProvider { public: LDAPProvider(Module* Creator, const std::string& Name) diff --git a/include/modules/names.h b/include/modules/names.h index de21ffade..6f21221ac 100644 --- a/include/modules/names.h +++ b/include/modules/names.h @@ -26,7 +26,8 @@ namespace Names class EventListener; } -class Names::EventListener : public Events::ModuleEventListener +class Names::EventListener + : public Events::ModuleEventListener { public: EventListener(Module* mod) diff --git a/include/modules/shun.h b/include/modules/shun.h index f4f7b8010..d49c141da 100644 --- a/include/modules/shun.h +++ b/include/modules/shun.h @@ -24,7 +24,8 @@ /** Shun class */ -class Shun : public XLine +class Shun final + : public XLine { public: /** Create a Shun. diff --git a/include/modules/sql.h b/include/modules/sql.h index 46b074862..3447dc8e4 100644 --- a/include/modules/sql.h +++ b/include/modules/sql.h @@ -69,7 +69,8 @@ namespace SQL } /** Represents the result of an SQL query. */ -class SQL::Result : public Cullable +class SQL::Result + : public Cullable { public: /** @@ -108,7 +109,7 @@ class SQL::Result : public Cullable * The error string varies from database software to database software * and should be used to display informational error messages to users. */ -class SQL::Error +class SQL::Error final { private: /** The custom error message if one has been specified. */ @@ -166,7 +167,8 @@ class SQL::Error * You should store whatever information is needed to have the callbacks work in * this object (UID of user, channel name, etc). */ -class SQL::Query : public Cullable +class SQL::Query + : public Cullable { protected: /** Creates a new SQL query. */ @@ -195,7 +197,8 @@ class SQL::Query : public Cullable /** * Provider object for SQL servers */ -class SQL::Provider : public DataProvider +class SQL::Provider + : public DataProvider { private: /** The name of the database tag in the config. */ diff --git a/include/modules/ssl.h b/include/modules/ssl.h index 17d76d240..2b812700e 100644 --- a/include/modules/ssl.h +++ b/include/modules/ssl.h @@ -39,7 +39,8 @@ * in a unified manner. These classes are attached to ssl- * connected local users using SSLCertExt */ -class ssl_cert : public refcountbase +class ssl_cert final + : public refcountbase { public: std::string dn; @@ -141,7 +142,8 @@ class ssl_cert : public refcountbase }; /** I/O hook provider for TLS modules. */ -class SSLIOHookProvider : public IOHookProvider +class SSLIOHookProvider + : public IOHookProvider { public: SSLIOHookProvider(Module* mod, const std::string& Name) @@ -150,7 +152,8 @@ public: } }; -class SSLIOHook : public IOHook +class SSLIOHook + : public IOHook { protected: /** An enumeration of possible TLS socket states. */ @@ -254,7 +257,7 @@ class SSLIOHook : public IOHook /** Helper functions for obtaining TLS client certificates and key fingerprints * from StreamSockets */ -class SSLClientCert +class SSLClientCert final { public: /** @@ -287,7 +290,8 @@ class SSLClientCert } }; -class UserCertificateAPIBase : public DataProvider +class UserCertificateAPIBase + : public DataProvider { public: UserCertificateAPIBase(Module* parent) @@ -325,7 +329,8 @@ class UserCertificateAPIBase : public DataProvider * information of local and remote users. It can also be used to find out whether a * user is using TLS or not. */ -class UserCertificateAPI : public dynamic_reference +class UserCertificateAPI final + : public dynamic_reference { public: UserCertificateAPI(Module* parent) diff --git a/include/modules/stats.h b/include/modules/stats.h index 9a55012eb..e6a29a126 100644 --- a/include/modules/stats.h +++ b/include/modules/stats.h @@ -29,7 +29,8 @@ namespace Stats class Row; } -class Stats::EventListener : public Events::ModuleEventListener +class Stats::EventListener + : public Events::ModuleEventListener { public: EventListener(Module* mod) @@ -44,7 +45,8 @@ class Stats::EventListener : public Events::ModuleEventListener virtual ModResult OnStats(Stats::Context& stats) = 0; }; -class Stats::Row : public Numeric::Numeric +class Stats::Row final + : public Numeric::Numeric { public: Row(unsigned int num) @@ -53,7 +55,7 @@ class Stats::Row : public Numeric::Numeric } }; -class Stats::Context +class Stats::Context final { /** Source user of the STATS request */ diff --git a/include/modules/who.h b/include/modules/who.h index 1913aeaeb..e74d878be 100644 --- a/include/modules/who.h +++ b/include/modules/who.h @@ -28,7 +28,8 @@ namespace Who class Request; } -class Who::EventListener : public Events::ModuleEventListener +class Who::EventListener + : public Events::ModuleEventListener { public: EventListener(Module* mod) diff --git a/include/modules/whois.h b/include/modules/whois.h index 891ecd6de..7b066c53a 100644 --- a/include/modules/whois.h +++ b/include/modules/whois.h @@ -62,7 +62,8 @@ enum RPL_WHOISSECURE = 671 }; -class Whois::EventListener : public Events::ModuleEventListener +class Whois::EventListener + : public Events::ModuleEventListener { public: EventListener(Module* mod) @@ -76,7 +77,8 @@ class Whois::EventListener : public Events::ModuleEventListener virtual void OnWhois(Context& whois) = 0; }; -class Whois::LineEventListener : public Events::ModuleEventListener +class Whois::LineEventListener + : public Events::ModuleEventListener { public: LineEventListener(Module* mod) diff --git a/include/numericbuilder.h b/include/numericbuilder.h index 06176a3b6..788e385ac 100644 --- a/include/numericbuilder.h +++ b/include/numericbuilder.h @@ -38,7 +38,7 @@ namespace Numeric class ParamBuilder; } -class Numeric::WriteNumericSink +class Numeric::WriteNumericSink final { LocalUser* const user; @@ -54,7 +54,7 @@ class Numeric::WriteNumericSink } }; -class Numeric::WriteRemoteNumericSink +class Numeric::WriteRemoteNumericSink final { User* const user; @@ -129,7 +129,8 @@ class Numeric::GenericBuilder }; template -class Numeric::Builder : public GenericBuilder +class Numeric::Builder + : public GenericBuilder { public: Builder(LocalUser* user, unsigned int num, bool addparam = true, size_t additionalsize = 0) @@ -188,7 +189,8 @@ class Numeric::GenericParamBuilder }; template -class Numeric::ParamBuilder : public GenericParamBuilder +class Numeric::ParamBuilder + : public GenericParamBuilder { public: ParamBuilder(LocalUser* user, unsigned int num) @@ -206,7 +208,8 @@ namespace Numerics } /** Builder for the ERR_CANNOTSENDTOCHAN and ERR_CANNOTSENDTOUSER numerics. */ -class Numerics::CannotSendTo : public Numeric::Numeric +class Numerics::CannotSendTo final + : public Numeric::Numeric { public: CannotSendTo(Channel* chan, const std::string& message) @@ -249,7 +252,8 @@ class Numerics::CannotSendTo : public Numeric::Numeric }; /* Builder for the ERR_INVALIDMODEPARAM numeric. */ -class Numerics::InvalidModeParameter : public Numeric::Numeric +class Numerics::InvalidModeParameter final + : public Numeric::Numeric { private: void push_message(ModeHandler* mode, const std::string& message) @@ -295,7 +299,8 @@ class Numerics::InvalidModeParameter : public Numeric::Numeric }; /** Builder for the ERR_NOSUCHCHANNEL numeric. */ -class Numerics::NoSuchChannel : public Numeric::Numeric +class Numerics::NoSuchChannel final + : public Numeric::Numeric { public: NoSuchChannel(const std::string& chan) @@ -307,7 +312,8 @@ class Numerics::NoSuchChannel : public Numeric::Numeric }; /** Builder for the ERR_NOSUCHNICK numeric. */ -class Numerics::NoSuchNick : public Numeric::Numeric +class Numerics::NoSuchNick final + : public Numeric::Numeric { public: NoSuchNick(const std::string& nick) diff --git a/include/parammode.h b/include/parammode.h index 260f56cfd..ec32b1d7c 100644 --- a/include/parammode.h +++ b/include/parammode.h @@ -20,7 +20,8 @@ #pragma once -class CoreExport ParamModeBase : public ModeHandler +class CoreExport ParamModeBase + : public ModeHandler { private: virtual void OnUnsetInternal(User* source, Channel* chan) = 0; @@ -45,7 +46,8 @@ class CoreExport ParamModeBase : public ModeHandler * When unsetting the mode, the extension is automatically unset. */ template -class ParamMode : public ParamModeBase +class ParamMode + : public ParamModeBase { public: ExtItemT ext; diff --git a/include/server.h b/include/server.h index 917163723..fa5655d63 100644 --- a/include/server.h +++ b/include/server.h @@ -21,7 +21,8 @@ #pragma once -class CoreExport Server : public Cullable +class CoreExport Server + : public Cullable { protected: /** The unique identifier for this server. */ diff --git a/include/snomasks.h b/include/snomasks.h index be090c73d..03394494f 100644 --- a/include/snomasks.h +++ b/include/snomasks.h @@ -28,7 +28,7 @@ #pragma once class SnomaskManager; -class Snomask +class Snomask final { /** Description of this snomask, e.g.: OPER, ANNOUNCEMENT, XLINE */ @@ -73,7 +73,7 @@ class Snomask * Modules and the core can enable and disable snomask characters. If they do, * then sending snomasks using these characters becomes possible. */ -class CoreExport SnomaskManager +class CoreExport SnomaskManager final { Snomask masks[26]; diff --git a/include/socket.h b/include/socket.h index 0e9475f3e..f8929a0f6 100644 --- a/include/socket.h +++ b/include/socket.h @@ -141,7 +141,7 @@ namespace irc } /** Represents information about a failed port binding. */ -struct CoreExport FailedPort +struct CoreExport FailedPort final { /** The error which happened during binding. */ int error; @@ -169,7 +169,8 @@ typedef std::vector FailedPortList; * It will create a new User for every valid connection * and assign it a file descriptor. */ -class CoreExport ListenSocket : public EventHandler +class CoreExport ListenSocket final + : public EventHandler { public: std::shared_ptr bind_tag; diff --git a/include/socketengine.h b/include/socketengine.h index 1443f6071..cd2e0791c 100644 --- a/include/socketengine.h +++ b/include/socketengine.h @@ -150,7 +150,8 @@ enum EventMask * must have a file descriptor. What this file descriptor * is actually attached to is completely up to you. */ -class CoreExport EventHandler : public Cullable +class CoreExport EventHandler + : public Cullable { private: /** Private state maintained by socket engine */ @@ -215,7 +216,7 @@ class CoreExport EventHandler : public Cullable * from system to system and upon the config * settings chosen by the server admin. */ -class CoreExport SocketEngine +class CoreExport SocketEngine final { public: /** Socket engine statistics: count of various events, bandwidth usage diff --git a/include/threadsocket.h b/include/threadsocket.h index 13e004a80..95e73e2de 100644 --- a/include/threadsocket.h +++ b/include/threadsocket.h @@ -25,7 +25,8 @@ class ThreadSignalSocket; -class CoreExport SocketThread : public Thread +class CoreExport SocketThread + : public Thread { private: std::mutex mutex; diff --git a/include/timer.h b/include/timer.h index 368ca8282..ecea0556b 100644 --- a/include/timer.h +++ b/include/timer.h @@ -119,7 +119,7 @@ class CoreExport Timer * This will ensure timers are not missed, as well as removing timers that have * expired and allowing the addition of new ones. */ -class CoreExport TimerManager +class CoreExport TimerManager final { typedef std::multimap TimerMap; diff --git a/include/token_list.h b/include/token_list.h index 9c3fd0744..8c30869aa 100644 --- a/include/token_list.h +++ b/include/token_list.h @@ -21,7 +21,7 @@ #include "compat.h" -class CoreExport TokenList +class CoreExport TokenList final { private: /** Whether this list includes all tokens by default. */ diff --git a/include/uid.h b/include/uid.h index 9db48fde4..333e283a8 100644 --- a/include/uid.h +++ b/include/uid.h @@ -22,7 +22,7 @@ #pragma once -class CoreExport UIDGenerator +class CoreExport UIDGenerator final { private: /** Holds the current UID. Used to generate the next one. diff --git a/include/usermanager.h b/include/usermanager.h index 98f0dadbc..d2d0475b8 100644 --- a/include/usermanager.h +++ b/include/usermanager.h @@ -28,7 +28,7 @@ #include -class CoreExport UserManager +class CoreExport UserManager final { public: struct CloneCounts diff --git a/include/users.h b/include/users.h index 01e7e3de7..2953cb1bc 100644 --- a/include/users.h +++ b/include/users.h @@ -223,7 +223,8 @@ public: * connection is stored here primarily, from the user's socket ID (file descriptor) through to the * user's nickname and hostname. */ -class CoreExport User : public Extensible +class CoreExport User + : public Extensible { private: /** Cached nick!ident\@dhost value using the displayed hostname @@ -624,7 +625,8 @@ class CoreExport User : public Extensible bool Serialize(Serializable::Data& data) override; }; -class CoreExport UserIOHandler : public StreamSocket +class CoreExport UserIOHandler final + : public StreamSocket { private: size_t checked_until; @@ -649,7 +651,9 @@ class CoreExport UserIOHandler : public StreamSocket void AddWriteBuf(const std::string &data); }; -class CoreExport LocalUser : public User, public insp::intrusive_list_node +class CoreExport LocalUser final + : public User + , public insp::intrusive_list_node { private: /** The connect class this user is in. */ @@ -823,7 +827,8 @@ class CoreExport LocalUser : public User, public insp::intrusive_list_node