Cuberite
A lightweight, fast and extensible game server for Minecraft
Public Member Functions | Private Types | Static Private Member Functions | Private Attributes | List of all members
BlockTypeRegistry::AlreadyRegisteredException Class Reference

The exception thrown from BlockTypeRegistry::registerBlockType() if the same block type is being registered from a different plugin. More...

#include <BlockTypeRegistry.h>

Inheritance diagram for BlockTypeRegistry::AlreadyRegisteredException:
Inheritance graph
[legend]
Collaboration diagram for BlockTypeRegistry::AlreadyRegisteredException:
Collaboration graph
[legend]

Public Member Functions

 AlreadyRegisteredException (const std::shared_ptr< BlockInfo > &aPreviousRegistration, const std::shared_ptr< BlockInfo > &aNewRegistration)
 Creates a new instance of the exception that provides info on both the original registration and the newly attempted registration that caused the failure. More...
 
std::shared_ptr< BlockInfonewRegistration () const
 
std::shared_ptr< BlockInfopreviousRegistration () const
 

Private Types

using Super = std::runtime_error
 

Static Private Member Functions

static AString message (const std::shared_ptr< BlockInfo > &aPreviousRegistration, const std::shared_ptr< BlockInfo > &aNewRegistration)
 Returns the general exception message formatted by the two registrations. More...
 

Private Attributes

std::shared_ptr< BlockInfom_NewRegistration
 
std::shared_ptr< BlockInfom_PreviousRegistration
 

Detailed Description

The exception thrown from BlockTypeRegistry::registerBlockType() if the same block type is being registered from a different plugin.

Definition at line 158 of file BlockTypeRegistry.h.

Member Typedef Documentation

◆ Super

using BlockTypeRegistry::AlreadyRegisteredException::Super = std::runtime_error
private

Definition at line 160 of file BlockTypeRegistry.h.

Constructor & Destructor Documentation

◆ AlreadyRegisteredException()

BlockTypeRegistry::AlreadyRegisteredException::AlreadyRegisteredException ( const std::shared_ptr< BlockInfo > &  aPreviousRegistration,
const std::shared_ptr< BlockInfo > &  aNewRegistration 
)

Creates a new instance of the exception that provides info on both the original registration and the newly attempted registration that caused the failure.

Definition at line 195 of file BlockTypeRegistry.cpp.

Member Function Documentation

◆ message()

AString BlockTypeRegistry::AlreadyRegisteredException::message ( const std::shared_ptr< BlockInfo > &  aPreviousRegistration,
const std::shared_ptr< BlockInfo > &  aNewRegistration 
)
staticprivate

Returns the general exception message formatted by the two registrations.

The output is used when logging.

Definition at line 209 of file BlockTypeRegistry.cpp.

◆ newRegistration()

std::shared_ptr<BlockInfo> BlockTypeRegistry::AlreadyRegisteredException::newRegistration ( ) const
inline

Definition at line 173 of file BlockTypeRegistry.h.

◆ previousRegistration()

std::shared_ptr<BlockInfo> BlockTypeRegistry::AlreadyRegisteredException::previousRegistration ( ) const
inline

Definition at line 172 of file BlockTypeRegistry.h.

Member Data Documentation

◆ m_NewRegistration

std::shared_ptr<BlockInfo> BlockTypeRegistry::AlreadyRegisteredException::m_NewRegistration
private

Definition at line 179 of file BlockTypeRegistry.h.

◆ m_PreviousRegistration

std::shared_ptr<BlockInfo> BlockTypeRegistry::AlreadyRegisteredException::m_PreviousRegistration
private

Definition at line 178 of file BlockTypeRegistry.h.


The documentation for this class was generated from the following files: