Barst  2.0
A server that controls lab hardware.
Public Member Functions | Public Attributes | Protected Attributes | List of all members
CManager Class Referenceabstract

#include <base classses.h>

Inheritance diagram for CManager:
CDevice CManagerFTDI CManagerMCDAQ CManagerRTV CManagerSerial

Public Member Functions

 CManager (const TCHAR szName[], const std::tstring csPipeName, int nChan)
 
virtual void ProcessData (const void *pHead, DWORD dwSize, __int64 llId)=0
 
virtual void Result (void *pHead, bool bPass)=0
 
virtual DWORD GetInfo (void *pHead, DWORD dwSize)=0
 
- Public Member Functions inherited from CDevice
 CDevice (const TCHAR szName[])
 

Public Attributes

const std::tstring m_csPipeName
 
const int m_nChan
 
- Public Attributes inherited from CDevice
const std::tstring m_csName
 

Protected Attributes

HINSTANCE m_hLib
 
- Protected Attributes inherited from CDevice
CCommm_pcComm
 
CLogBufferm_pcLogBuffer
 
CMemPoolm_pcMemPool
 
bool m_bError
 

Detailed Description

This defines a manager. The main manager creates these managers and directs communication from users to one of these managers which deals with the requests such as queries or creating channels. Communication with these managers happen only though the main manager. However, managers create channels with their own pipes so communication with a channel doesn't have to go through a manager but happens directly with the channel. Nonetheless, creation and deletion of channels do go through the managers. The pipe name of each channels in a manager contains both the manager (channel) number and channel number (see API for comm names) details.

Definition at line 146 of file base classses.h.

Constructor & Destructor Documentation

◆ CManager()

CManager::CManager ( const TCHAR  szName[],
const std::tstring  csPipeName,
int  nChan 
)
inline

Create the manager. szName is the unique name of this manager. csPipeName is the name of the main manager pipe. nChan is the channel number of this manager in the main manager's channel list.

Definition at line 152 of file base classses.h.

Member Function Documentation

◆ GetInfo()

virtual DWORD CManager::GetInfo ( void *  pHead,
DWORD  dwSize 
)
pure virtual

This function copies chennel specific info into pHead which could then be sent to the user in response to a query request. If phead is NULL, the function returns the required size of pHead. If non NULL, dwSize if the sise of pHead and the function returns the total size of the data copied into pHead. This funcion followes the rules where every sub-struct is proceeded by an SBase. Typically, it returns an SBaseOut sturct which holds the name of the device followed by channels specific structs.

Implements CDevice.

Implemented in CManagerFTDI, CManagerMCDAQ, CManagerRTV, and CManagerSerial.

◆ ProcessData()

virtual void CManager::ProcessData ( const void *  pHead,
DWORD  dwSize,
__int64  llId 
)
pure virtual

Comm calls this function when a user sent data to the device.

Implements CDevice.

Implemented in CManagerFTDI, CManagerMCDAQ, CManagerRTV, and CManagerSerial.

◆ Result()

virtual void CManager::Result ( void *  pHead,
bool  bPass 
)
pure virtual

Comm calls this function when it finished writing data to user sent by this device. phead is the pHead parameter in the SData struct that was sent with SendData() bPass is true if successfull and false otherwise.

Implements CDevice.

Implemented in CManagerFTDI, CManagerMCDAQ, CManagerRTV, and CManagerSerial.