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

Represents a network of device chains and the low level access to that network. In general, the caller should take a lock on a device chain before accessing it then release the lock when done. Part of the Facade Pattern example. More...

#include <Facade_ComplexSystem.h>

Collaboration diagram for IDeviceNetworkLowLevel:
Collaboration graph

Public Attributes

int(* GetNumChains )(void)
 Retrieve the number of device chains available in the network.
 
bool(* LockDeviceChain )(int chainIndex)
 Lock the specified device chain for exclusive access.
 
bool(* UnlockDeviceChain )(int chainIndex)
 Unlock the specified device chain to release exclusive access.
 
void(* ResetDeviceChain )(int chainIndex)
 Reset the visibility of all devices on the specified device chain.
 
void(* EnableDevicesInDeviceChain )(int chainIndex, uint32_t devicesSelectMask)
 Make visible the specified devices on the specified device chain.
 
void(* DisableDevicesInDeviceChain )(int chainIndex, uint32_t devicesSelectMask)
 Make invisible the specified devices on the specified device chain.
 
void(* GetIdcodes )(int chainIndex, UIntArray *idcodes)
 Retrieve a list of idcodes of all visible devices in the given device chain.
 

Detailed Description

Represents a network of device chains and the low level access to that network. In general, the caller should take a lock on a device chain before accessing it then release the lock when done. Part of the Facade Pattern example.

This interface makes it easier to contrast with the IDeviceNetworkHighLevel interface.

Definition at line 57 of file Facade_ComplexSystem.h.

Member Data Documentation

◆ DisableDevicesInDeviceChain

void(* DisableDevicesInDeviceChain) (int chainIndex, uint32_t devicesSelectMask)

Make invisible the specified devices on the specified device chain.

Parameters
chainIndexIndex of the device chain (0..n-1).
devicesSelectMaskBit mask where each bit set indicates the corresponding device should be made invisible. Bit 0 corresponds to the first device, bit 1 to the second device, etc. Bit 0 is ignored as the first device is always visible.

Definition at line 103 of file Facade_ComplexSystem.h.

◆ EnableDevicesInDeviceChain

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

Make visible the specified devices on the specified device chain.

Parameters
chainIndexIndex of the device chain (0..n-1).
devicesSelectMaskBit mask where each bit set indicates the corresponding device should be made visible. Bit 0 corresponds to the first device, bit 1 to the second device, etc. Bit 0 is ignored as the first device is always visible.

Definition at line 93 of file Facade_ComplexSystem.h.

Referenced by EnableDevicesInDeviceChain().

◆ GetIdcodes

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

Retrieve a list of idcodes of all visible devices in the given device chain.

Parameters
chainIndexIndex of the device chain (0..n-1).
idcodesReturns an array of idcodes for each visible TAP, with the first TAP being at index 0. This UIntArray object needs to be initialized before use with UIntArray_Initialize() and freed after use with UIntArray_Clear().

Definition at line 113 of file Facade_ComplexSystem.h.

Referenced by GetIdcodes().

◆ GetNumChains

int(* GetNumChains) (void)

Retrieve the number of device chains available in the network.

Returns
Returns the number of device chains available.

Definition at line 63 of file Facade_ComplexSystem.h.

Referenced by NumChains().

◆ LockDeviceChain

bool(* LockDeviceChain) (int chainIndex)

Lock the specified device chain for exclusive access.

Parameters
chainIndexIndex of the device chain (0..n-1).
Returns
Returns true if the device chain was successfully locked.

Definition at line 70 of file Facade_ComplexSystem.h.

Referenced by DisableDevicesInDeviceChain(), EnableDevicesInDeviceChain(), and GetIdcodes().

◆ ResetDeviceChain

void(* ResetDeviceChain) (int chainIndex)

Reset the visibility of all devices on the specified device chain.

Parameters
chainIndexIndex of the device chain (0..n-1).

Definition at line 83 of file Facade_ComplexSystem.h.

Referenced by DisableDevicesInDeviceChain().

◆ UnlockDeviceChain

bool(* UnlockDeviceChain) (int chainIndex)

Unlock the specified device chain to release exclusive access.

Parameters
chainIndexIndex of the device chain (0..n-1).
Returns
Returns true if the device chain was successfully unlocked.

Definition at line 77 of file Facade_ComplexSystem.h.

Referenced by DisableDevicesInDeviceChain(), EnableDevicesInDeviceChain(), and GetIdcodes().


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