Wildmeshing Toolkit
|
This handle is a wrapper for the MeshManager scope funtions. More...
#include <AttributeScopeHandle.hpp>
Public Member Functions | |
AttributeScopeHandle (AttributeManager &manager) | |
Constructs an AttributeScopeHandle for the given AttributeManager . More... | |
AttributeScopeHandle (AttributeScopeHandle &&) | |
~AttributeScopeHandle () | |
Destructor of AttributeScopeHandle . More... | |
void | mark_failed () |
Mark scope as failed. More... | |
Private Attributes | |
AttributeManager & | m_manager |
bool | m_failed = false |
bool | m_was_moved = false |
This handle is a wrapper for the MeshManager scope funtions.
It's main task is to enable RAII for attribute scopes.
It is NOT a handle for AttributeScope
.
Remark: We should rename this. Maybe just call it ScopeHandle?
Definition at line 14 of file AttributeScopeHandle.hpp.
wmtk::attribute::AttributeScopeHandle::AttributeScopeHandle | ( | AttributeManager & | manager | ) |
Constructs an AttributeScopeHandle
for the given AttributeManager
.
The handle creates a new scope for all attributes of the manager.
Definition at line 4 of file AttributeScopeHandle.cpp.
References m_manager, and wmtk::attribute::AttributeManager::push_scope().
wmtk::attribute::AttributeScopeHandle::AttributeScopeHandle | ( | AttributeScopeHandle && | o | ) |
Definition at line 11 of file AttributeScopeHandle.cpp.
wmtk::attribute::AttributeScopeHandle::~AttributeScopeHandle | ( | ) |
Destructor of AttributeScopeHandle
.
Automatically pops the scope for all attributes of the manager. If mark_failed()
was called, all changes are discarded, otherwise they are applied to the parent scope.
Definition at line 28 of file AttributeScopeHandle.cpp.
References m_failed, m_manager, m_was_moved, and wmtk::attribute::AttributeManager::pop_scope().
void wmtk::attribute::AttributeScopeHandle::mark_failed | ( | ) |
Mark scope as failed.
All changes in the scope are discarded upon deletion, i.e. when the scope is popped from the stack.
Definition at line 19 of file AttributeScopeHandle.cpp.
References m_failed, m_manager, m_was_moved, and wmtk::attribute::AttributeManager::rollback_current_scope().
|
private |
Definition at line 43 of file AttributeScopeHandle.hpp.
Referenced by mark_failed(), and ~AttributeScopeHandle().
|
private |
Definition at line 42 of file AttributeScopeHandle.hpp.
Referenced by AttributeScopeHandle(), mark_failed(), and ~AttributeScopeHandle().
|
private |
Definition at line 44 of file AttributeScopeHandle.hpp.
Referenced by mark_failed(), and ~AttributeScopeHandle().