Declaration of the Flyweight_ImageList and Flyweight_Image structures, the latter which wraps the big resource handle and a Flyweight_Context as used in the Flyweight Pattern. More...
#include "Flyweight_Context.h"
Go to the source code of this file.
Classes | |
struct | Flyweight_Image |
Represents an image that associates a context with a big resource. More... | |
struct | Flyweight_ImageList |
Represents an expandable list of Flyweight_Image objects. This is managed by the Flyweight_ImageList_Clear() and Flyweight_ImageList_Add() functions. More... | |
Macros | |
#define | __FLYWEIGHT_IMAGE_H__ |
Functions | |
void | Flyweight_ImageList_Clear (Flyweight_ImageList *imageList) |
Clear the given Flyweight_ImageList object by freeing up all allocated Flyweight_image objects and resetting the list to a "new" state so it can be reused. | |
void | Flyweight_ImageList_Add (Flyweight_ImageList *imageList, Flyweight_Image *image) |
Add a Flyweight_Image object to the given Flyweight_ImageList object. The list takes ownership of the BigResource object and is responsible for releasing all memory associated with it. | |
Declaration of the Flyweight_ImageList and Flyweight_Image structures, the latter which wraps the big resource handle and a Flyweight_Context as used in the Flyweight Pattern.
Definition in file Flyweight_Image.h.
#define __FLYWEIGHT_IMAGE_H__ |
Definition at line 9 of file Flyweight_Image.h.
void Flyweight_ImageList_Add | ( | Flyweight_ImageList * | imageList, |
Flyweight_Image * | image | ||
) |
Add a Flyweight_Image object to the given Flyweight_ImageList object. The list takes ownership of the BigResource object and is responsible for releasing all memory associated with it.
imageList | The Flyweight_ImageList object to add to. |
image | The Flyweight_Image object to be copied to the Flyweight_ImageList. |
Definition at line 27 of file Flyweight_Image.c.
References Flyweight_ImageList::images, and Flyweight_ImageList::images_count.
Referenced by _Flyweight_GenerateFlyweightClasses().
void Flyweight_ImageList_Clear | ( | Flyweight_ImageList * | imageList | ) |
Clear the given Flyweight_ImageList object by freeing up all allocated Flyweight_image objects and resetting the list to a "new" state so it can be reused.
imageList | A pointer to the Flyweight_ImageList to be cleared. |
Definition at line 14 of file Flyweight_Image.c.
References Flyweight_ImageList::images, and Flyweight_ImageList::images_count.
Referenced by Flyweight_Exercise().