# fourdst::libcomposition: src/composition/include/fourdst/composition/exceptions/exceptions_composition.h Source File

Loading...
Searching...
No Matches
exceptions_composition.h
Go to the documentation of this file.
#pragma once
#include <exception>
#include <string>
namespace fourdst::composition::exceptions {
class CompositionError : public std::exception {
protected:
std::string m_message;
public:
explicit CompositionError(const std::string& message)
: m_message(std::move(message)) {}
const char* what() const noexcept override{
return m_message.c_str();
}
};
class CompositionEntryError : public std::exception {
protected:
std::string m_message;
public:
explicit CompositionEntryError(const std::string& message)
: m_message(std::move(message)) {}
const char* what() const noexcept override {
return m_message.c_str();
}
};
class CompositionNotFinalizedError final : public CompositionError {
using CompositionError::CompositionError;
};
class InvalidCompositionError final : public CompositionError {
using CompositionError::CompositionError;
};
class InvalidMixingMode final : public CompositionError {
using CompositionError::CompositionError;
};
class InvalidSymbolError final : public CompositionError {
using CompositionError::CompositionError;
};
class UnregisteredSymbolError final : public CompositionError {
using CompositionError::CompositionError;
};
class FailedToFinalizeCompositionError final : public CompositionError {
using CompositionError::CompositionError;
};
class InvalidSpeciesSymbolError final : public CompositionEntryError {
using CompositionEntryError::CompositionEntryError;
};
class EntryAlreadyInitializedError final : public CompositionEntryError {
using CompositionEntryError::CompositionEntryError;
};
class CompositionModeError final : public CompositionEntryError {
using CompositionEntryError::CompositionEntryError;
};
}
fourdst::composition::exceptions::CompositionEntryError::m_message
std::string m_message
The error message.
Definition exceptions_composition.h:49
fourdst::composition::exceptions::CompositionEntryError::what
const char * what() const noexcept override
Returns the error message.
Definition exceptions_composition.h:62
fourdst::composition::exceptions::CompositionEntryError::CompositionEntryError
CompositionEntryError(const std::string &message)
Constructs a CompositionEntryError with an error message.
Definition exceptions_composition.h:55
fourdst::composition::exceptions::CompositionError::m_message
std::string m_message
The error message.
Definition exceptions_composition.h:19
fourdst::composition::exceptions::CompositionError::what
const char * what() const noexcept override
Returns the error message.
Definition exceptions_composition.h:32
fourdst::composition::exceptions::CompositionError::CompositionError
CompositionError(const std::string &message)
Constructs a CompositionError with an error message.
Definition exceptions_composition.h:25
fourdst::composition::exceptions::CompositionModeError
Exception thrown due to a conflict in composition modes at the entry level.
Definition exceptions_composition.h:145
fourdst::composition::exceptions::CompositionModeError::CompositionEntryError
CompositionEntryError(const std::string &message)
Constructs a CompositionEntryError with an error message.
Definition exceptions_composition.h:55
fourdst::composition::exceptions::CompositionNotFinalizedError
Exception thrown when an operation is attempted on a composition that has not been finalized.
Definition exceptions_composition.h:74
fourdst::composition::exceptions::CompositionNotFinalizedError::CompositionError
CompositionError(const std::string &message)
Constructs a CompositionError with an error message.
Definition exceptions_composition.h:25
fourdst::composition::exceptions::EntryAlreadyInitializedError
Exception thrown when attempting to initialize a composition entry that has already been initialized.
Definition exceptions_composition.h:135
fourdst::composition::exceptions::EntryAlreadyInitializedError::CompositionEntryError
CompositionEntryError(const std::string &message)
Constructs a CompositionEntryError with an error message.
Definition exceptions_composition.h:55
fourdst::composition::exceptions::FailedToFinalizeCompositionError
Exception thrown when the finalization process of a composition fails.
Definition exceptions_composition.h:119
fourdst::composition::exceptions::FailedToFinalizeCompositionError::CompositionError
CompositionError(const std::string &message)
Constructs a CompositionError with an error message.
Definition exceptions_composition.h:25
fourdst::composition::exceptions::InvalidCompositionError
Exception thrown when a composition is in an invalid or inconsistent state.
Definition exceptions_composition.h:82
fourdst::composition::exceptions::InvalidCompositionError::CompositionError
CompositionError(const std::string &message)
Constructs a CompositionError with an error message.
Definition exceptions_composition.h:25
fourdst::composition::exceptions::InvalidMixingMode
Exception thrown for an invalid or unsupported mixing mode.
Definition exceptions_composition.h:93
fourdst::composition::exceptions::InvalidMixingMode::CompositionError
CompositionError(const std::string &message)
Constructs a CompositionError with an error message.
Definition exceptions_composition.h:25
fourdst::composition::exceptions::InvalidSpeciesSymbolError
Exception thrown for an invalid chemical species symbol in a composition entry.
Definition exceptions_composition.h:127
fourdst::composition::exceptions::InvalidSpeciesSymbolError::CompositionEntryError
CompositionEntryError(const std::string &message)
Constructs a CompositionEntryError with an error message.
Definition exceptions_composition.h:55
fourdst::composition::exceptions::InvalidSymbolError
Exception thrown when a symbol used in a composition is invalid.
Definition exceptions_composition.h:101
fourdst::composition::exceptions::InvalidSymbolError::CompositionError
CompositionError(const std::string &message)
Constructs a CompositionError with an error message.
Definition exceptions_composition.h:25
fourdst::composition::exceptions::UnregisteredSymbolError
Exception thrown when a symbol is used that has not been registered.
Definition exceptions_composition.h:111
fourdst::composition::exceptions::UnregisteredSymbolError::CompositionError
CompositionError(const std::string &message)
Constructs a CompositionError with an error message.
Definition exceptions_composition.h:25
fourdst::composition::exceptions
Definition exceptions_composition.h:6