Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
chainbase::undo_index< T, Allocator, Indices >::session Class Reference

#include <undo_index.hpp>

Public Member Functions

 session (undo_index &idx, bool enabled)
 
 session (session &&other)
 
sessionoperator= (session &&other)
 
 ~session ()
 
void push ()
 
void squash ()
 
void undo ()
 

Detailed Description

template<typename T, typename Allocator, typename... Indices>
class chainbase::undo_index< T, Allocator, Indices >::session

Definition at line 478 of file undo_index.hpp.

Constructor & Destructor Documentation

◆ session() [1/2]

template<typename T , typename Allocator , typename... Indices>
chainbase::undo_index< T, Allocator, Indices >::session::session ( undo_index & idx,
bool enabled )
inline

Definition at line 480 of file undo_index.hpp.

481 : _index(idx),
482 _apply(enabled) {
483 if(enabled) idx.add_session();
484 }

◆ session() [2/2]

template<typename T , typename Allocator , typename... Indices>
chainbase::undo_index< T, Allocator, Indices >::session::session ( session && other)
inline

Definition at line 485 of file undo_index.hpp.

486 : _index(other._index),
487 _apply(other._apply)
488 {
489 other._apply = false;
490 }

◆ ~session()

template<typename T , typename Allocator , typename... Indices>
chainbase::undo_index< T, Allocator, Indices >::session::~session ( )
inline

Definition at line 499 of file undo_index.hpp.

499{ if(_apply) _index.undo(); }
void undo() noexcept
Here is the call graph for this function:

Member Function Documentation

◆ operator=()

template<typename T , typename Allocator , typename... Indices>
session & chainbase::undo_index< T, Allocator, Indices >::session::operator= ( session && other)
inline

Definition at line 491 of file undo_index.hpp.

491 {
492 if(this != &other) {
493 undo();
494 _apply = other._apply;
495 other._apply = false;
496 }
497 return *this;
498 }
Here is the call graph for this function:

◆ push()

template<typename T , typename Allocator , typename... Indices>
void chainbase::undo_index< T, Allocator, Indices >::session::push ( )
inline

Definition at line 500 of file undo_index.hpp.

500{ _apply = false; }

◆ squash()

template<typename T , typename Allocator , typename... Indices>
void chainbase::undo_index< T, Allocator, Indices >::session::squash ( )
inline

Definition at line 501 of file undo_index.hpp.

501 {
502 if ( _apply ) _index.squash();
503 _apply = false;
504 }
void squash() noexcept
Here is the call graph for this function:

◆ undo()

template<typename T , typename Allocator , typename... Indices>
void chainbase::undo_index< T, Allocator, Indices >::session::undo ( )
inline

Definition at line 505 of file undo_index.hpp.

505 {
506 if ( _apply ) _index.undo();
507 _apply = false;
508 }
Here is the call graph for this function:
Here is the caller graph for this function:

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