Design Pattern Examples
Overview of object-oriented design patterns
Memento_Memento.h
Go to the documentation of this file.
1
6
7#pragma once
8#ifndef __MEMENTO_MEMENTO_H__
9#define __MEMENTO_MEMENTO_H__
10
16typedef struct
17{
18 char* text;
19 const char* name;
20} Memento;
21
22//-----------------------------------------------------------------------------
23
34Memento* Memento_Create(const char* text, const char* name);
35
41void Memento_Destroy(Memento* memento);
42
43
44#endif // __MEMENTO_MEMENTO_H__
45
void Memento_Destroy(Memento *memento)
Destroy an existing instance of the Memento structure. After this function returns,...
Memento * Memento_Create(const char *text, const char *name)
Create a new instance of the Memento structure, initialized to the given text and name.
Represents a single memento (snapshot) of the text state before an operation is applied....
char * text
The snapshot to be remembered by the Memento.
const char * name
The operation name that triggered the need for this Memento.