Skip to content
Snippets Groups Projects
Commit 71dcb2e4 authored by Christoph Lehmann's avatar Christoph Lehmann
Browse files

[PL] added docu. struct->class

parent 23de5761
No related branches found
No related tags found
No related merge requests found
...@@ -23,10 +23,20 @@ namespace ProcessLib ...@@ -23,10 +23,20 @@ namespace ProcessLib
* \todo Later on this struct shall be moved, e.g., be merged with the process * \todo Later on this struct shall be moved, e.g., be merged with the process
* output class. * output class.
*/ */
struct ExtrapolatorData class ExtrapolatorData
{ {
public:
ExtrapolatorData() = default; ExtrapolatorData() = default;
/*! Constructs a new instance.
*
* \param extrapolator the extrapolator managed by the instance being
* created
* \param dof_table_single_component the d.o.f. table used by the \c
* extrapolator
* \param manage_storage If true the memory of \c dof_table_single_component
* will be freed by the destructor of this class.
*/
ExtrapolatorData( ExtrapolatorData(
std::unique_ptr<NumLib::Extrapolator>&& extrapolator, std::unique_ptr<NumLib::Extrapolator>&& extrapolator,
NumLib::LocalToGlobalIndexMap const* const dof_table_single_component, NumLib::LocalToGlobalIndexMap const* const dof_table_single_component,
...@@ -66,15 +76,23 @@ struct ExtrapolatorData ...@@ -66,15 +76,23 @@ struct ExtrapolatorData
~ExtrapolatorData() { cleanup(); } ~ExtrapolatorData() { cleanup(); }
private: private:
//! Deletes the d.o.f table if it is allowed to do so.
void cleanup() void cleanup()
{ {
if (_manage_storage) { if (_manage_storage) {
delete _dof_table_single_component; delete _dof_table_single_component;
_dof_table_single_component = nullptr;
} }
} }
//! Extrapolator managed by the ExtrapolatorData instance.
std::unique_ptr<NumLib::Extrapolator> _extrapolator; std::unique_ptr<NumLib::Extrapolator> _extrapolator;
//! D.o.f. table used by the extrapolator.
NumLib::LocalToGlobalIndexMap const* _dof_table_single_component = nullptr; NumLib::LocalToGlobalIndexMap const* _dof_table_single_component = nullptr;
//! If true, free storage of the d.o.f. table in the ExtrapolatorData
//! destructor.
bool _manage_storage = false; bool _manage_storage = false;
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment