Implementation 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...

Go to the source code of this file.
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. | |
Implementation 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.c.
| 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().