5.2.2 ResourceManager Class
The ResourceManager class' main role is to initialize the R4 resources. It handles the R4 mechanism and reflects the resource status. It contains the following data:
- all system channels
- configuration object for initialization
- maps R4 device handles to channels
- all detected R4 boards
The ResourceManager
class attributes are described in Table 7.
Table 7. ResourceManager Class Attributes
|
|
|
|
|
|
m_devicesQueue
|
private
|
R4DeviceQueue [MAX_DEVICE_TYPE]
|
Array of device pointer queues. The array index is defined as board type (IP, PSTN). It includes all the devices in the system.
|
|
m_channelsQueue
|
private
|
ChannelQueue
|
A queue of all the channels created in the system.
|
|
configuration
|
private
|
Configuration
|
An instance of the Configuration class used to determine the configuration of the system during initialization.
|
|
m_channelNum
|
private
|
int
|
The number of channels that the demo will work with (this number is the minimum of devices of each type and the user requested -n option).
|
|
m_printToMonitor
|
private
|
Int[MAX_PRINT_TO_MONITOR]
|
The channels that are printing to the monitor
|
|
m_numOfPSTNBoards
|
private
|
int
|
The number of PSTN boards detected in the system.
|
|
m_numOfIPBoards
|
private
|
int
|
The number of IP boards detected in the system.
|
|
m_initLog
|
private
|
static Log
|
A log instance used during initialization. All the printouts are sent to the monitor, after which it is destructed. This instance is necessary because during the initialization, there are no channel instances and therefore no log instances. In order to see logs during initialization, the application creates a global log instance for all the devices during initialization and kills it after creating the channel objects and attributing the devices to channels.
|