Design Pattern Examples
Overview of object-oriented design patterns
NumberProducer Struct Reference

Represents the Subject in this example. In this case, a structure that contains a list of observers and a single number that is updated. When the NumberProducer_UpdateNumber() function is called, the number is incremented and all observers are notified. The observers are passed the changed number. More...

#include <Observer_NumberProducer.h>

Collaboration diagram for NumberProducer:
Collaboration graph

Public Attributes

uint32_t number
 The number being maintained.
 
NumberChangedFunctionList observerList
 The list of observers subscribed to this class instance.
 

Detailed Description

Represents the Subject in this example. In this case, a structure that contains a list of observers and a single number that is updated. When the NumberProducer_UpdateNumber() function is called, the number is incremented and all observers are notified. The observers are passed the changed number.

Definition at line 22 of file Observer_NumberProducer.h.

Member Data Documentation

◆ number

uint32_t number

The number being maintained.

Definition at line 27 of file Observer_NumberProducer.h.

Referenced by _NumberProducer_NotifyNumberChanged(), NumberProducer_Create(), and NumberProducer_UpdateNumber().

◆ observerList


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