Wildmeshing Toolkit
wmtk::attribute::AttributeScopeHandle Class Reference

This handle is a wrapper for the MeshManager scope funtions. More...

#include <AttributeScopeHandle.hpp>

Collaboration diagram for wmtk::attribute::AttributeScopeHandle:
[legend]

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

AttributeManagerm_manager
 
bool m_failed = false
 
bool m_was_moved = false
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ AttributeScopeHandle() [1/2]

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().

Here is the call graph for this function:

◆ AttributeScopeHandle() [2/2]

wmtk::attribute::AttributeScopeHandle::AttributeScopeHandle ( AttributeScopeHandle &&  o)

Definition at line 11 of file AttributeScopeHandle.cpp.

◆ ~AttributeScopeHandle()

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().

Here is the call graph for this function:

Member Function Documentation

◆ mark_failed()

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().

Here is the call graph for this function:

Member Data Documentation

◆ m_failed

bool wmtk::attribute::AttributeScopeHandle::m_failed = false
private

Definition at line 43 of file AttributeScopeHandle.hpp.

Referenced by mark_failed(), and ~AttributeScopeHandle().

◆ m_manager

AttributeManager& wmtk::attribute::AttributeScopeHandle::m_manager
private

◆ m_was_moved

bool wmtk::attribute::AttributeScopeHandle::m_was_moved = false
private

Definition at line 44 of file AttributeScopeHandle.hpp.

Referenced by mark_failed(), and ~AttributeScopeHandle().


The documentation for this class was generated from the following files: