Wildmeshing Toolkit
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
wmtk::AttributeCollection< T > Struct Template Reference
Inheritance diagram for wmtk::AttributeCollection< T >:
wmtk::AbstractAttributeContainer

Public Member Functions

void move (size_t from, size_t to) override
 
void resize (size_t s) override
 
void reset_from (size_t first) override
 
void clear () override
 
void rollback () override
 retrieve the protected attribute data on operation-fail
 
void begin_protect () override
 clean local buffers for attribute, and start recording
 
void end_protect () override
 clear local buffers and finish recording
 
void append_recorded (std::vector< size_t > &out) override
 
const T & at (size_t i) const
 
const T & operator[] (size_t i) const
 
T & operator[] (size_t i)
 
size_t size () const
 

Public Attributes

wmtk::threading::enumerable_thread_specific< std::unordered_map< size_t, T > > m_rollback_list
 
std::vector< T > m_attributes
 
wmtk::threading::enumerable_thread_specific< bool > recording {false}
 

Member Function Documentation

◆ append_recorded()

template<typename T >
void wmtk::AttributeCollection< T >::append_recorded ( std::vector< size_t > &  out)
inlineoverridevirtual

Appends to out the index of every entry this thread has recorded since begin_protect(): every entry the operation reached through non-const access, which rollback() would write back. Lets a caller check that an operation stayed within the simplices it owns.

Reimplemented from wmtk::AbstractAttributeContainer.

◆ begin_protect()

template<typename T >
void wmtk::AttributeCollection< T >::begin_protect ( )
inlineoverridevirtual

clean local buffers for attribute, and start recording

Implements wmtk::AbstractAttributeContainer.

◆ clear()

template<typename T >
void wmtk::AttributeCollection< T >::clear ( )
inlineoverridevirtual

◆ end_protect()

template<typename T >
void wmtk::AttributeCollection< T >::end_protect ( )
inlineoverridevirtual

clear local buffers and finish recording

Implements wmtk::AbstractAttributeContainer.

◆ move()

template<typename T >
void wmtk::AttributeCollection< T >::move ( size_t  from,
size_t  to 
)
inlineoverridevirtual

Reimplemented from wmtk::AbstractAttributeContainer.

◆ reset_from()

template<typename T >
void wmtk::AttributeCollection< T >::reset_from ( size_t  first)
inlineoverridevirtual

Resets every entry from first to the end of the storage to a default-constructed value. consolidate_mesh() calls it on the spare region past the compacted live range: move() leaves its source intact, so without this those slots would still hold the records compacted out of them, and the next operation handed one would inherit a dead simplex's attributes.

Implements wmtk::AbstractAttributeContainer.

◆ resize()

template<typename T >
void wmtk::AttributeCollection< T >::resize ( size_t  s)
inlineoverridevirtual

◆ rollback()

template<typename T >
void wmtk::AttributeCollection< T >::rollback ( )
inlineoverridevirtual

retrieve the protected attribute data on operation-fail

Implements wmtk::AbstractAttributeContainer.


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