design_pattern_for_c  V 1.00
flyweight_methods_t Struct Reference

Flyweight methods interface definition, to set flyweight_factory_new. More...

#include <flyweight.h>

Data Fields

void(* constructor )(void *this, size_t size, void *input_parameter)
 constructor of class More...
 
int(* equall_operand )(void *this, size_t size, void *input_parameter)
 operand == More...
 
int(* setter )(void *this, size_t size, void *input_parameter)
 setter More...
 
void(* destructor )(void *this)
 destructor More...
 

Detailed Description

Flyweight methods interface definition, to set flyweight_factory_new.

This interface is used for generating instance into FlyweightFactory.

Definition at line 14 of file flyweight.h.

Field Documentation

◆ constructor

void(* constructor) (void *this, size_t size, void *input_parameter)

constructor of class

Parameters
[in]thisclass instance
[in]sizesize of this instance
[in]input_parameterinput parameter related to flyweight_get
Note
default: memcpy size

Definition at line 22 of file flyweight.h.

◆ destructor

void(* destructor) (void *this)

destructor

Parameters
[in]thisclass instance
Note
allocated memory will free into library, please free members in class
default: none

Definition at line 48 of file flyweight.h.

◆ equall_operand

int(* equall_operand) (void *this, size_t size, void *input_parameter)

operand ==

Parameters
[in]thisclass instance
[in]sizesize of this instance
[in]input_parameterinput parameter related to flyweight_get
Returns
defined value
Note
if you set function which return always 1, this class is same as Singleton.
if you set function which return always 0, this class always allocate new instance
default: memcmp size

Definition at line 33 of file flyweight.h.

◆ setter

int(* setter) (void *this, size_t size, void *input_parameter)

setter

Parameters
[in]thisclass instance
[in]sizesize of this instance
[in]input_parameter
Note
default: memcpy size

Definition at line 41 of file flyweight.h.


The documentation for this struct was generated from the following file: