Design Pattern Examples
Overview of object-oriented design patterns
Flyweight_Image.h
Go to the documentation of this file.
1
6
7
#pragma once
8
#ifndef __FLYWEIGHT_IMAGE_H__
9
#define __FLYWEIGHT_IMAGE_H__
10
11
#include "
Flyweight_Context.h
"
12
16
typedef
struct
17
{
22
int
BigResourceId
;
23
28
Flyweight_Context
Context
;
29
30
}
Flyweight_Image
;
31
32
40
typedef
struct
41
{
42
Flyweight_Image
*
images
;
43
size_t
images_count
;
44
45
}
Flyweight_ImageList
;
46
47
54
void
Flyweight_ImageList_Clear
(
Flyweight_ImageList
* imageList);
55
64
void
Flyweight_ImageList_Add
(
Flyweight_ImageList
* imageList,
Flyweight_Image
* image);
65
66
#endif
// __FLYWEIGHT_IMAGE_H__
Flyweight_Context.h
Declaration of the Flyweight_Context structure that is associated with a Flyweight_Image as used in t...
Flyweight_ImageList_Clear
void Flyweight_ImageList_Clear(Flyweight_ImageList *imageList)
Clear the given Flyweight_ImageList object by freeing up all allocated Flyweight_image objects and re...
Definition:
Flyweight_Image.c:14
Flyweight_ImageList_Add
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...
Definition:
Flyweight_Image.c:27
Flyweight_Context
Represents the context for an instance of the Flyweight_Image structure. In this case,...
Definition:
Flyweight_Context.h:20
Flyweight_Image
Represents an image that associates a context with a big resource.
Definition:
Flyweight_Image.h:17
Flyweight_Image::Context
Flyweight_Context Context
The context associated with this image. The calling entity uses this context to manipulate the positi...
Definition:
Flyweight_Image.h:28
Flyweight_Image::BigResourceId
int BigResourceId
The big resource being referenced by this flyweight image. This is represented by a handle to the big...
Definition:
Flyweight_Image.h:22
Flyweight_ImageList
Represents an expandable list of Flyweight_Image objects. This is managed by the Flyweight_ImageList_...
Definition:
Flyweight_Image.h:41
Flyweight_ImageList::images_count
size_t images_count
Number of Flyweight_image objects in the list.
Definition:
Flyweight_Image.h:43
Flyweight_ImageList::images
Flyweight_Image * images
Dynamic list of Flyweight_Image objects.
Definition:
Flyweight_Image.h:42
c
Flyweight_Image.h
Generated on Tue Aug 29 2023 19:47:44 for Design Pattern Examples by
1.9.6