Design Pattern Examples
Overview of object-oriented design patterns
Facade_ComplexSystem.h
Go to the documentation of this file.
1
5
6#pragma once
7#ifndef __FACADE_COMPLEXSYSTEM_H__
8#define __FACADE_COMPLEXSYSTEM_H__
9
10#include <stdbool.h>
11
12#include "helpers/uintarray.h"
13
18typedef enum
19{
41
42
43//-----------------------------------------------------------------------------
44//-----------------------------------------------------------------------------
45
46
57typedef struct
58{
63 int (*GetNumChains)(void);
64
70 bool (*LockDeviceChain)(int chainIndex);
71
77 bool (*UnlockDeviceChain)(int chainIndex);
78
83 void (*ResetDeviceChain)(int chainIndex);
84
93 void (*EnableDevicesInDeviceChain)(int chainIndex, uint32_t devicesSelectMask);
94
103 void (*DisableDevicesInDeviceChain)(int chainIndex, uint32_t devicesSelectMask);
104
113 void (*GetIdcodes)(int chainIndex, UIntArray* idcodes);
114
116
117
120
121
129
130#endif // __FACADE_COMPLEXSYSTEM_H__
static void DisableDevicesInDeviceChain(int chainIndex, uint32_t deviceselectMask)
Deselect one or more devices in the given device chain so those devices are no longer visible.
static bool LockDeviceChain(int chainIndex)
Lock the specified device chain to indicate exclusive access is desired.
static void ResetDeviceChain(int chainIndex)
Reset the visibility of all devices on the given device chain so that all devices except the first ar...
static void GetIdcodes(int chainIndex, UIntArray *idcodes)
Retrieve a list of idcodes of all visible devices in the given device chain.
static bool UnlockDeviceChain(int chainIndex)
Unlock the specified device chain to indicate exclusive access is no longer desired.
static int GetNumChains(void)
Retrieve the number of device chains.
static void EnableDevicesInDeviceChain(int chainIndex, uint32_t deviceselectMask)
Select one or more devices in the given device chain so those devices are visible.
DeviceTypes
Identifies the type of devices that can appear in a device chain. Part of the Facade Pattern example.
@ DEVICECONTROLLER
device controller. This is always visible.
@ CORE
Core device.
@ GTE
GTE device.
@ PMC
PMC device.
@ PCH
PCH device.
IDeviceNetworkLowLevel * Facade_GetLowLevelDeviceService(void)
Retrieve a set of function pointers to the low-level device service used in the Facade Pattern exampl...
Represents a network of device chains and the low level access to that network. In general,...
Represents an array of 32-bit unsigned integers. The data field points to a block of memory allocated...
Definition: uintarray.h:24
Declaration of the UIntArray structure and the supporting functions that represents an array of 32-bi...