Design Pattern Examples
Overview of object-oriented design patterns
IMemento Struct Referenceabstract

Represents a single memento, a single snapshot of the state of the Memento_TextObject class as represented by the private class Memento_TextObject.Memento. More...

#include <Memento.h>

Inheritance diagram for IMemento:
Inheritance graph
Collaboration diagram for IMemento:
Collaboration graph

Public Types

using shared_ptr_t = std::shared_ptr< IMemento >
 Alias to make working with a shared pointer easier to type.
 

Public Member Functions

virtual ~IMemento ()
 Virtual destructor.
 
virtual std::string Name ()=0
 The name of the memento (snapshot). Useful for displaying a list of mementos in an undo list. In this case, the name of each memento is the operation that triggered the creation of the memento.
 

Detailed Description

Represents a single memento, a single snapshot of the state of the Memento_TextObject class as represented by the private class Memento_TextObject.Memento.

Definition at line 20 of file Memento.h.

Member Typedef Documentation

◆ shared_ptr_t

using shared_ptr_t = std::shared_ptr<IMemento>

Alias to make working with a shared pointer easier to type.

Definition at line 25 of file Memento.h.

Constructor & Destructor Documentation

◆ ~IMemento()

virtual ~IMemento ( )
inlinevirtual

Virtual destructor.

Definition at line 30 of file Memento.h.

Member Function Documentation

◆ Name()

virtual std::string Name ( )
pure virtual

The name of the memento (snapshot). Useful for displaying a list of mementos in an undo list. In this case, the name of each memento is the operation that triggered the creation of the memento.

Implemented in Memento_TextObject::Memento.

Referenced by Visitor_Shop::PickupOrder(), Visitor_Shop::PlaceOrder(), and EntryInformation::ToString().


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