Web Analytics Made Easy - Statcounter
Skip to content

Class SBCUndoCommandGroup#

ClassList > SBCUndoCommandGroup

This class describes a group of undo commands. More...

  • #include <SBCUndoCommandGroup.hpp>

Inherits the following classes: SBCUndoCommand

Public Functions#

Type Name
virtual std::string getName () override const
Returns the undo command group's name.
virtual bool isCommand () override const
Returns whether it is an undo command - returns false __
virtual bool isCommandGroup () override const
Returns whether it is an undo command group - returns true __
virtual void print (unsigned int offset=0) override const
Prints debugging information.

Public Functions inherited from SBCUndoCommand#

See SBCUndoCommand

Type Name
virtual std::string getName () const
Returns the undo command's name.
SBCUndoCommand * getParent () const
Returns the undo command's parent.
virtual bool isCommand () const
Returns whether it is an undo command - returns true __
virtual bool isCommandGroup () const
Returns whether it is an undo command group - returns false __
bool isDone () const
Returns whether the undo command is done.
virtual void print (unsigned int offset=0) const
Prints debugging information.
virtual ~SBCUndoCommand ()
Destructs the undo command.

Protected Attributes inherited from SBCUndoCommand#

See SBCUndoCommand

Type Name
SBCUndoCommandData * dataPointer
A pointer to the private data.

Protected Functions#

Type Name
SBCUndoCommandGroup (const std::string & n)
Protected constructor.
virtual void addChild (SBCUndoCommand * undoCommand) override
Adds a child undo command to the undo command group.
virtual unsigned int getNumberOfCommands () override const
Returns the number of commands in the undo command group.
virtual void redo () override
Redo the operation.
virtual void undo () override
Undo the operation.
virtual ~SBCUndoCommandGroup ()
Destructor.

Protected Functions inherited from SBCUndoCommand#

See SBCUndoCommand

Type Name
SBCUndoCommand ()
Protected constructor.
SBCUndoCommand (SBCUndoCommandData * dataPointer)
Protected constructor.
virtual void addChild (SBCUndoCommand * undoCommand)
Adds a child undo command to an undo command group, does nothing for an undo command.
virtual unsigned int getNumberOfCommands () const
Returns the number of undo commands in an undo command group or 1 for an undo command.
virtual void redo ()
Redo the operation.
virtual void undo ()
Undo the operation.

Detailed Description#

Short name: SBUndoCommandGroup

Public Functions Documentation#

function getName#

Returns the undo command group's name.

virtual std::string SBCUndoCommandGroup::getName () override const

Retrieves the name of the command group.

Returns the identifier that was assigned to this group at construction.

Returns:

The name of the command group.

Implements SBCUndoCommand::getName


function isCommand#

Returns whether it is an undo command - returns false __

virtual bool SBCUndoCommandGroup::isCommand () override const

Indicates whether this object represents a single undo command.

Always returns false for command groups.

Returns:

false, indicating this is not a single command.

Implements SBCUndoCommand::isCommand


function isCommandGroup#

Returns whether it is an undo command group - returns true __

virtual bool SBCUndoCommandGroup::isCommandGroup () override const

Indicates whether this object represents a command group.

Always returns true for command groups.

Returns:

true, indicating this is a command group.

Implements SBCUndoCommand::isCommandGroup


function print#

Prints debugging information.

virtual void SBCUndoCommandGroup::print (
    unsigned int offset=0
) override const

Prints debugging information for the command group.

Outputs the group's name with indentation based on the offset, then recursively prints its children.

Parameters:

  • offset Number of indentation levels to apply before printing.

Implements SBCUndoCommand::print


Protected Functions Documentation#

function SBCUndoCommandGroup#

Protected constructor.

explicit SBCUndoCommandGroup::SBCUndoCommandGroup (
    const std::string & n
) 

Constructs a command group with the given name.

Creates a new undo command group identified by the supplied name.

Parameters:

  • n The name of the command group.

function addChild#

Adds a child undo command to the undo command group.

virtual void SBCUndoCommandGroup::addChild (
    SBCUndoCommand * undoCommand
) override

Adds a child undo command to this group.

The specified command becomes a member of the group and will be processed together with other commands.

Parameters:

  • undoCommand Pointer to the command to be added. Must not be null.

Implements SBCUndoCommand::addChild


function getNumberOfCommands#

Returns the number of commands in the undo command group.

virtual unsigned int SBCUndoCommandGroup::getNumberOfCommands () override const

Returns the total number of commands contained in the group.

The count includes all nested commands within child groups.

Returns:

The number of commands in the group.

Implements SBCUndoCommand::getNumberOfCommands


function redo#

Redo the operation.

virtual void SBCUndoCommandGroup::redo () override

Redoes all commands in the group in order.

Executes the redo operation of each child command from the first to the last.

Implements SBCUndoCommand::redo


function undo#

Undo the operation.

virtual void SBCUndoCommandGroup::undo () override

Undoes all commands in the group in reverse order.

Executes the undo operation of each child command from the last to the first.

Implements SBCUndoCommand::undo


function ~SBCUndoCommandGroup#

Destructor.

virtual SBCUndoCommandGroup::~SBCUndoCommandGroup () 

Destroys the command group.

Releases any resources held by the SBCUndoCommandGroup instance.