Cadabra
Computer algebra system for field theory problems
Public Types | Public Member Functions | Private Attributes | List of all members
cadabra::ActionAddCell Class Reference

Description

Add a cell to the notebook.

#include <Actions.hh>

Inheritance diagram for cadabra::ActionAddCell:
cadabra::ActionBase

Public Types

enum class  Position { before , after , child }
 

Public Member Functions

 ActionAddCell (DataCell, DataCell::id_t ref_, Position pos_)
 
virtual ~ActionAddCell ()
 
virtual void execute (DocumentThread &, GUIBase &) override
 Perform the action. More...
 
virtual void revert (DocumentThread &, GUIBase &) override
 Revert the change to the DTree document and the GUI. More...
 
virtual bool undoable () const override
 Can this action be undone? More...
 
- Public Member Functions inherited from cadabra::ActionBase
 ActionBase (DataCell::id_t ref_id)
 

Private Attributes

DataCell newcell
 
DTree::iterator newref
 
Position pos
 
int child_num
 
bool is_replacement
 

Additional Inherited Members

- Public Attributes inherited from cadabra::ActionBase
DataCell::id_t ref_id
 
- Protected Attributes inherited from cadabra::ActionBase
DTree::iterator ref
 

Member Enumeration Documentation

◆ Position

Enumerator
before 
after 
child 

Constructor & Destructor Documentation

◆ ActionAddCell()

ActionAddCell::ActionAddCell ( DataCell  cell,
DataCell::id_t  ref_,
Position  pos_ 
)

◆ ~ActionAddCell()

virtual cadabra::ActionAddCell::~ActionAddCell ( )
inlinevirtual

Member Function Documentation

◆ execute()

void ActionAddCell::execute ( DocumentThread cl,
GUIBase  
)
overridevirtual

Perform the action.

This should update both the document tree data structure and the GUI. The latter is updated by calling relevant methods on the GUIBase object passed in.

Reimplemented from cadabra::ActionBase.

◆ revert()

void ActionAddCell::revert ( DocumentThread ,
GUIBase  
)
overridevirtual

Revert the change to the DTree document and the GUI.

Implements cadabra::ActionBase.

◆ undoable()

bool ActionAddCell::undoable ( ) const
overridevirtual

Can this action be undone?

Reimplemented from cadabra::ActionBase.

Member Data Documentation

◆ child_num

int cadabra::ActionAddCell::child_num
private

◆ is_replacement

bool cadabra::ActionAddCell::is_replacement
private

◆ newcell

DataCell cadabra::ActionAddCell::newcell
private

◆ newref

DTree::iterator cadabra::ActionAddCell::newref
private

◆ pos

Position cadabra::ActionAddCell::pos
private

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