morph 0.1.0
Asynchronous bridge between GUI thread and business models
Loading...
Searching...
No Matches
morph::model::DuplicateRegistrationError Struct Reference

Thrown when a model id, or a model's action id, is registered for a type other than the one that already holds it. More...

#include <registry.hpp>

Inheritance diagram for morph::model::DuplicateRegistrationError:

Public Member Functions

 DuplicateRegistrationError (std::string_view what, std::string_view taken, std::type_index held, std::type_index incoming)
 Constructs the error naming the id and both types.

Detailed Description

Thrown when a model id, or a model's action id, is registered for a type other than the one that already holds it.

Two registrations of one id would otherwise leave whichever static initialiser ran last, an order the link decides: two applications linked into one process could each reach the other's model. Registering the same type again, as every translation unit including a BRIDGE_REGISTER_* header does, is not a conflict. The static-init helpers report it and abort, because there is no caller to catch it before main.

Definition at line 286 of file registry.hpp.

Constructor & Destructor Documentation

◆ DuplicateRegistrationError()

morph::model::DuplicateRegistrationError::DuplicateRegistrationError ( std::string_view what,
std::string_view taken,
std::type_index held,
std::type_index incoming )
inline

Constructs the error naming the id and both types.

Parameters
whatmodel or action.
takenThe id, model or model/action.
heldThe type that holds it.
incomingThe type registered again under it.

Definition at line 292 of file registry.hpp.


The documentation for this struct was generated from the following file: