Infinity Engine v0.6.20
C++ API Documentation
Loading...
Searching...
No Matches
Infinity::Procedural::ComponentException Class Reference

Exception type for errors that occur within ProceduralComponent operations. More...

#include <ComponentException.hpp>

Inheritance diagram for Infinity::Procedural::ComponentException:
[legend]
Collaboration diagram for Infinity::Procedural::ComponentException:
[legend]

Public Member Functions

 ComponentException (const std::string &message, const ProceduralComponent *component)
 Constructs a ComponentException with a message and component reference.
 
const ProceduralComponentgetComponent () const noexcept
 Retrieves the component that caused the exception.
 
- Public Member Functions inherited from Infinity::Engine::BaseException
 BaseException (const char *message)
 Constructs a BaseException with a C-string message.
 
 BaseException (const std::string &message)
 Constructs a BaseException with a std::string message.
 
virtual const char * what () const noexcept override
 Returns the exception message.
 

Protected Attributes

const ProceduralComponent_component
 The component that caused the exception.
 
- Protected Attributes inherited from Infinity::Engine::BaseException
std::string _message
 The stored error message.
 

Detailed Description

Exception type for errors that occur within ProceduralComponent operations.

ComponentException extends BaseException to provide context-specific error handling for procedural generation components. It stores a reference to the component that caused the exception, allowing developers to identify which component in a procedural system encountered an error during execution.

Constructor & Destructor Documentation

◆ ComponentException()

Infinity::Procedural::ComponentException::ComponentException ( const std::string &  message,
const ProceduralComponent component 
)

Constructs a ComponentException with a message and component reference.

Parameters
messageThe error message describing what went wrong.
componentPointer to the ProceduralComponent that caused the exception.

Member Function Documentation

◆ getComponent()

const ProceduralComponent * Infinity::Procedural::ComponentException::getComponent ( ) const
noexcept

Retrieves the component that caused the exception.

Returns
A pointer to the ProceduralComponent associated with this exception.

Member Data Documentation

◆ _component

const ProceduralComponent* Infinity::Procedural::ComponentException::_component
protected

The component that caused the exception.