QtDesignPatterns/mementopattern/memento.h

21 lines
292 B
C
Raw Normal View History

2024-02-06 17:21:37 +08:00
#pragma once
#include <string>
#include <iostream>
using namespace std;
class Memento
{
public:
Memento(string state) : state(state)
{
cout << "init Memento " + state << endl;
}
string getState()
{
return this->state;
}
private:
string state;
};