Class adapt_registry
Defined in File adapt.hxx
Class Documentation
-
class adapt_registry
Registry pattern is used to register contexts, which provides access to the adapt callback and the mesh handle.
This globally accessible static class is required to get the handle and the callback in the forest callback, as the predefined header permits to give these as function arguments.
Public Static Functions
-
static inline void register_context(t8_forest_t forest, std::unique_ptr<mesh_adapt_context_base> context)
Static function to register context using forest as identifier.
This makes the context publicly available using the registry.
- Parameters:
forest – [in] The forest identifier. In our case, this is the forest from which we adapt the mesh because we do not change this forest during adaptation such that it is valid unique identifier.
context – [in] The context to register. Use unique pointer to ensure proper memory management and ownership.
-
static inline void unregister_context(t8_forest_t forest)
Static function to unregister a context using forest as identifier.
- Parameters:
forest – [in] The forest identifier. In our case, this is the forest from which we adapt.
-
static inline mesh_adapt_context_base *get(t8_forest_t forest)
Getter for a context using forest as identifier.
- Parameters:
forest – [in] The forest identifier. In our case, this is the forest from which we adapt.
- Returns:
Pointer to the context registered with the id forest if found, nullptr otherwise.
-
static inline void register_context(t8_forest_t forest, std::unique_ptr<mesh_adapt_context_base> context)