Envision
A visual programming IDE for object-oriented languages
List of all members | Public Member Functions | Private Attributes
Model::ListPut Class Reference

This command is used to put a list element at a specific position in a list. More...

Inheritance diagram for Model::ListPut:
Model::NodeOwningCommand Model::UndoCommand

Public Member Functions

 ListPut (Node *target, QVector< Node * > &nodes, Node *newNode, int position)
 
virtual void redo ()
 
virtual void undo ()
 
- Public Member Functions inherited from Model::NodeOwningCommand
 NodeOwningCommand (Node *target, const QString &text, Node *ownedIfDone, Node *ownedIfUndone)
 
virtual ~NodeOwningCommand ()
 
virtual NodeinsertedNode () const override
 Returns the node that this command inserted into the tree, or nullptr if no node was inserted. More...
 
virtual Nodeowned () const override
 Returns the node owned by this command or nullptr if no node is owned. More...
 
virtual NoderemovedNode () const override
 Returns the node that this command removed from the tree, or nullptr if no node was removed. More...
 
- Public Member Functions inherited from Model::UndoCommand
 UndoCommand (Node *target, const QString &text)
 
virtual ~UndoCommand ()
 
bool isUndone () const
 Returns whether the command has been undone since it was applied. More...
 
Nodetarget () const
 

Private Attributes

NodenewNode
 
QVector< Node * > & nodes
 
int oldSize
 
int putPosition
 

Detailed Description

This command is used to put a list element at a specific position in a list.

The position must not already contain an element and if it exist should be nullptr.

Constructor & Destructor Documentation

◆ ListPut()

Model::ListPut::ListPut ( Node target,
QVector< Node * > &  nodes,
Node newNode,
int  position 
)

Member Function Documentation

◆ redo()

void Model::ListPut::redo ( )
virtual

Reimplemented from Model::NodeOwningCommand.

◆ undo()

void Model::ListPut::undo ( )
virtual

Reimplemented from Model::NodeOwningCommand.

Member Data Documentation

◆ newNode

Node* Model::ListPut::newNode
private

◆ nodes

QVector<Node*>& Model::ListPut::nodes
private

◆ oldSize

int Model::ListPut::oldSize
private

◆ putPosition

int Model::ListPut::putPosition
private