StepCommand Class Reference

Back to the index.

Public Member Functions | Static Public Member Functions | List of all members
StepCommand Class Reference

A Command which sets the RunState to SingleStepping. More...

#include <StepCommand.h>

Inheritance diagram for StepCommand:
Command ReferenceCountable UnitTestable

Public Member Functions

 StepCommand ()
 Constructs a StepCommand. More...
 
virtual ~StepCommand ()
 
virtual bool Execute (GXemul &gxemul, const vector< string > &arguments)
 Executes the command on a given GXemul instance. More...
 
virtual bool MayBeReexecutedWithoutArgs () const
 Returns whether the command can be quickly re-executed using an empty command line. More...
 
virtual string GetShortDescription () const
 Returns a short (one-line) description of the command. More...
 
virtual string GetLongDescription () const
 Returns a long description/help message for the command. More...
 
- Public Member Functions inherited from Command
 Command (const string &name, const string &argumentFormat)
 Constructs a Command. More...
 
virtual ~Command ()=0
 
const string & GetCommandName () const
 Gets the name of the command. More...
 
const string & GetArgumentFormat () const
 Gets the argument format for the command. More...
 
- Public Member Functions inherited from ReferenceCountable
 ReferenceCountable ()
 Default constructor, which initializes the reference count to zero. More...
 
 ~ReferenceCountable ()
 

Static Public Member Functions

static void RunUnitTests (int &nSucceeded, int &nFailures)
 
- Static Public Member Functions inherited from Command
static void RunUnitTests (int &nSucceeded, int &nFailures)
 
- Static Public Member Functions inherited from UnitTestable
static void RunUnitTests (int &nSucceeded, int &nFailures)
 Runs unit test cases. More...
 

Detailed Description

A Command which sets the RunState to SingleStepping.

Definition at line 40 of file StepCommand.h.

Constructor & Destructor Documentation

◆ StepCommand()

StepCommand::StepCommand ( )

Constructs a StepCommand.

Definition at line 32 of file StepCommand.cc.

Referenced by GetLongDescription().

◆ ~StepCommand()

StepCommand::~StepCommand ( )
virtual

Definition at line 38 of file StepCommand.cc.

Member Function Documentation

◆ Execute()

bool StepCommand::Execute ( GXemul gxemul,
const vector< string > &  arguments 
)
virtual

Executes the command on a given GXemul instance.

Parameters
gxemulA reference to the GXemul instance.
argumentsA vector of zero or more string arguments.
Returns
true if the command succeeded, false if it failed.

Implements Command.

Definition at line 43 of file StepCommand.cc.

References GXemul::GetUI(), GXemul::SetNrOfSingleStepsInARow(), GXemul::SetRunState(), UI::ShowDebugMessage(), and GXemul::SingleStepping.

◆ GetLongDescription()

string StepCommand::GetLongDescription ( ) const
virtual

Returns a long description/help message for the command.

Returns
A long description/help message for the command.

Implements Command.

Definition at line 76 of file StepCommand.cc.

References UnitTest::Assert(), Command::Execute(), GXemul::GetRunState(), GXemul::Paused, GXemul::SingleStepping, StepCommand(), UNITTEST, and UNITTESTS.

Referenced by MayBeReexecutedWithoutArgs().

◆ GetShortDescription()

string StepCommand::GetShortDescription ( ) const
virtual

Returns a short (one-line) description of the command.

Returns
A short description of the command.

Implements Command.

Definition at line 70 of file StepCommand.cc.

Referenced by MayBeReexecutedWithoutArgs().

◆ MayBeReexecutedWithoutArgs()

virtual bool StepCommand::MayBeReexecutedWithoutArgs ( ) const
inlinevirtual

Returns whether the command can be quickly re-executed using an empty command line.

Typical examples are: step, cpu disassembly, and memory dump, where re-executing the command without arguments is very natural.

Returns
true if the command may be re-executed without arguments, false otherwise.

Reimplemented from Command.

Definition at line 53 of file StepCommand.h.

References GetLongDescription(), GetShortDescription(), and RunUnitTests().

◆ RunUnitTests()

static void StepCommand::RunUnitTests ( int &  nSucceeded,
int &  nFailures 
)
static

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

Generated on Sun Sep 30 2018 16:05:18 for GXemul by doxygen 1.8.13