28 using BaseType::BaseType;
60 template <
int D = Eigen::Dynamic>
64 template <
int D = Eigen::Dynamic>
72 template <
int D = Eigen::Dynamic>
90 template <
typename Derived>
91 void cache(int64_t index,
const Eigen::MatrixBase<Derived>& value);
93 void cache(int64_t index,
const T& value);
98#if defined(WMTK_ENABLED_DEV_MODE)
99 void print_state(std::string_view prefix)
const;
119 void pop(
bool preserve_changes);
123 size_t scope_index)
const;
127 size_t scope_index)
const;
133 std::vector<std::pair<size_t, size_t>>
m_indices = std::vector<std::pair<size_t, size_t>>(32);
147#if !defined(WMTK_ENABLED_DEV_MODE)
This class stores data of type T in a vector.
std::vector< T > m_buffer
size_t buffer_end() const
CachingAttribute(CachingAttribute &&)=default
ConstMapResult< D > const_vector_attribute(int64_t index) const
default immutable vector access
const T & const_scalar_attribute(int64_t index) const
default immutable scalar access
void rollback_current_scope()
std::vector< std::pair< size_t, size_t > >::const_iterator final_transaction_end() const
const std::vector< std::pair< size_t, size_t > > & indices() const
const std::vector< size_t > & transaction_starts() const
void pop(bool preserve_changes)
MapResult< D > vector_attribute(int64_t index)
default mutable vector access
bool at_current_scope() const
checks that we are viewing the active state of the attribute
CachingAttribute & operator=(CachingAttribute &&)=default
size_t m_current_transaction_index
std::vector< std::pair< size_t, size_t > > m_indices
const T * get_value(int64_t index) const
void change_to_current_scope()
typename BaseType::template MapResult< D > MapResult
std::vector< std::pair< size_t, size_t > >::const_reverse_iterator transaction_start_rend(size_t scope_index) const
CachingAttribute(const CachingAttribute &)=delete
void change_to_previous_scope()
int64_t transaction_depth() const
std::vector< std::pair< size_t, size_t > >::const_reverse_iterator final_transaction_rbegin() const
void pop_scope(bool preserve_changes)
CachingAttribute & operator=(const CachingAttribute &)=delete
void cache(int64_t index, const Eigen::MatrixBase< Derived > &value)
void change_to_next_scope()
const std::vector< T > & buffer() const
std::vector< std::pair< size_t, size_t > >::const_iterator transaction_start_begin(size_t scope_index) const
bool has_transactions() const
std::vector< size_t > m_transaction_starts
typename BaseType::template ConstMapResult< D > ConstMapResult
size_t current_transaction_index() const
size_t indices_end() const
T & scalar_attribute(int64_t index)
default mutable scalar access
const T & const_vector_single_value(int64_t index, int8_t vector_index) const
specialized immutable scalar access useful for topological operations
void update_buffer_sizes_for_add(size_t data_size)