Design Pattern Examples
Overview of object-oriented design patterns
MoveCommandNone Class Reference

Represents the Do Nothing command. This is the Null Object for this exercise. More...

#include <Null_Object.h>

Inheritance diagram for MoveCommandNone:
Inheritance graph
Collaboration diagram for MoveCommandNone:
Collaboration graph

Public Member Functions

 MoveCommandNone (std::string command)
 Constructor.
 
void Execute () override
 Does nothing when executed (this is the Null Object, after all).
 
- Public Member Functions inherited from MoveCommand
virtual ~MoveCommand ()
 Virtual destructor required for interfaces/base classes.
 
std::string Name ()
 Name of the command (assigned in the class constructor).
 
std::string Command ()
 The command character from the original list of commands. Used when displaying the commands as opposed to when executing the commands (assigned in the class constructor).
 
 MoveCommand (std::string command, std::string commandName)
 Constructor.
 
virtual void Show ()
 Display the move command and its name followed by a newline.
 
virtual void Execute ()=0
 Execute the command. Derived classes must implement this.
 

Additional Inherited Members

- Public Types inherited from MoveCommand
using shared_ptr_t = std::shared_ptr< MoveCommand >
 Alias to make it easier to work with a shared pointer.
 

Detailed Description

Represents the Do Nothing command. This is the Null Object for this exercise.

Definition at line 234 of file Null_Object.h.

Constructor & Destructor Documentation

◆ MoveCommandNone()

MoveCommandNone ( std::string  command)
inline

Constructor.

Parameters
commandThe character representing the move in the original move list.

Definition at line 242 of file Null_Object.h.

Member Function Documentation

◆ Execute()

void Execute ( )
inlineoverridevirtual

Does nothing when executed (this is the Null Object, after all).

Implements MoveCommand.

Definition at line 250 of file Null_Object.h.


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