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

Represents a high level view of a complex network of device chains. A device chain can be thought of as a list of devices that can be made visible or hidden in the list but maintain the same relationship to each other regardless of visibility. More...

#include <Facade_Interface.h>

Collaboration diagram for IDeviceNetworkHighLevel:
Collaboration graph

Public Attributes

int(* NumChains )(void)
 The number of device chains available from the sub-system.
 
void(* GetIdcodes )(int chainIndex, UIntArray *idcodes)
 Returns a list of all idcodes from all selected devices in the given device chain.
 
void(* EnableDevicesInDeviceChain )(int chainIndex, uint32_t selectMask)
 Make visible certain devices in the given device chain. The selectMask value has a bit set for each device to make visible.
 
void(* DisableDevicesInDeviceChain )(int chainIndex)
 Resets the given device chain so that all devices except the first are no longer visible.
 

Detailed Description

Represents a high level view of a complex network of device chains. A device chain can be thought of as a list of devices that can be made visible or hidden in the list but maintain the same relationship to each other regardless of visibility.

The methods on this high level interface may seem the same as on the IDeviceNetworkLowLevel interface. However, most of the methods on this high level interface hide the need for taking a lock on a chain before accessing the chain.

This high level interface is a simplification and thus a facade for the low level interface and the system underneath.

Part of the Facade Pattern example.

Definition at line 28 of file c/Facade_Interface.h.

Member Data Documentation

◆ DisableDevicesInDeviceChain

void(* DisableDevicesInDeviceChain) (int chainIndex)

Resets the given device chain so that all devices except the first are no longer visible.

Parameters
chainIndexIndex of the device chain to access (0..NumChains-1).

Definition at line 61 of file c/Facade_Interface.h.

Referenced by Facade_Exercise().

◆ EnableDevicesInDeviceChain

void(* EnableDevicesInDeviceChain) (int chainIndex, uint32_t selectMask)

Make visible certain devices in the given device chain. The selectMask value has a bit set for each device to make visible.

Parameters
chainIndexIndex of the device chain to access (0..NumChains-1).
selectMaskA bit mask where each bit corresponds to a device, up to the number of devices in the given device chain. Bit 0 is ignored as the first device is always visible.

Definition at line 54 of file c/Facade_Interface.h.

Referenced by Facade_Exercise().

◆ GetIdcodes

void(* GetIdcodes) (int chainIndex, UIntArray *idcodes)

Returns a list of all idcodes from all selected devices in the given device chain.

Parameters
chainIndexIndex of the device chain to access (0..NumChains-1).
idcodesA UIntArray that is filled in with the idcodes of the selected devices. This UIntArray object needs to be initialized before use with UIntArray_Initialize() and freed after use with UIntArray_Clear().

Definition at line 44 of file c/Facade_Interface.h.

Referenced by Facade_Exercise().

◆ NumChains

int(* NumChains) (void)

The number of device chains available from the sub-system.

Definition at line 33 of file c/Facade_Interface.h.

Referenced by Facade_Exercise().


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