Design Pattern Examples
Overview of object-oriented design patterns
facadesubsystem_interface.py
Go to the documentation of this file.
6
7from abc import ABC, abstractmethod
8from enum import Enum
9
10
12class DeviceTypes(Enum):
13
14 DEVICECONTROLLER = 0,
15
16 CORE = 1,
17
18 GTE = 2,
19
20 PCH = 3,
21
22 PMC = 4
23
24
25# <summary>
26# Represents a network of device chains and the low level access to that
27# network. In general, the caller should take a lock on a device chain
28# before accessing it then release the lock when done.
29# Part of the @ref facade_pattern "Facade pattern" example.
30# </summary>
31# <remarks>
32# This interface makes it easier to contrast with the IDeviceNetworkHighLevel
33# interface.
34# </remarks>
36
39 @abstractmethod
40 def GetNumChains(self) -> int:
41 pass
42
43
49 @abstractmethod
50 def LockDeviceChain(self, chainIndex : int) -> bool:
51 pass
52
53
59 @abstractmethod
60 def UnlockDeviceChain(self, chainIndex : int) -> bool:
61 pass
62
63
67 @abstractmethod
68 def ResetDeviceChain(self, chainIndex : int) -> None:
69 pass
70
71
79 @abstractmethod
80 def EnableDevicesInDeviceChain(self, chainIndex : int, devicesSelectMask : int) -> None:
81 pass
82
83
91 @abstractmethod
92 def DisableDevicesInDeviceChain(self, chainIndex : int, devicesSelectMask : int) -> None:
93 pass
94
95
102 @abstractmethod
103 def GetIdcodes(self, chainIndex : int) -> list:
104 pass
105
static int GetNumChains(void)
Retrieve the number of device chains.
Identifies the type of devices that can appear in a device chain.
bool UnlockDeviceChain(self, int chainIndex)
Unlock the specified device chain to release exclusive access.
None DisableDevicesInDeviceChain(self, int chainIndex, int devicesSelectMask)
Make invisible the specified devices on the specified device chain.
list GetIdcodes(self, int chainIndex)
Retrieve a list of idcodes of all visible devices in the given device chain.
None EnableDevicesInDeviceChain(self, int chainIndex, int devicesSelectMask)
Make visible the specified devices on the specified device chain.
None ResetDeviceChain(self, int chainIndex)
Reset the visibility of all devices on the specified device chain.
bool LockDeviceChain(self, int chainIndex)
Lock the specified device chain for exclusive access.