Barst  2.0
A server that controls lab hardware.
Public Member Functions | List of all members
CMainManager Class Reference

#include <base classses.h>

Inheritance diagram for CMainManager:
CDevice

Public Member Functions

int Run (int argc, TCHAR *argv[])
 
void ProcessData (const void *pHead, DWORD dwSize, __int64 llId)
 
void Result (void *pHead, bool bPass)
 
DWORD GetInfo (void *pHead, DWORD dwSize)
 
- Public Member Functions inherited from CDevice
 CDevice (const TCHAR szName[])
 

Additional Inherited Members

- Public Attributes inherited from CDevice
const std::tstring m_csName
 
- Protected Attributes inherited from CDevice
CCommm_pcComm
 
CLogBufferm_pcLogBuffer
 
CMemPoolm_pcMemPool
 
bool m_bError
 

Detailed Description

This is the main program manager. When the program starts this is created once and subsequent calls to managers go through this manager. Every call to create a new manager (e.g. FTDI, RTV...) or to create a new channel in a manager go through this manager. This manager controlls access to the pipe that is created when the the program is launched with the name passed into the exe. The communicator held by this manager has only one thread ever and only one user can connect to the manager at any time. This ensures that multiple users cannot create or delete managers/channels simultaneuosly. So if someone is connected to the manager already, another user has to wait until this user is done. See the API for how data is passed between managers.

Definition at line 119 of file base classses.h.

Member Function Documentation

◆ GetInfo()

DWORD CMainManager::GetInfo ( void *  pHead,
DWORD  dwSize 
)
inlinevirtual

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.

Definition at line 130 of file base classses.h.

◆ ProcessData()

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

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

Implements CDevice.

Definition at line 40 of file Barst.cpp.

◆ Result()

void CMainManager::Result ( void *  pHead,
bool  bPass 
)
inlinevirtual

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.

Definition at line 129 of file base classses.h.

◆ Run()

int CMainManager::Run ( int  argc,
TCHAR *  argv[] 
)

This function is called by the main exe method and this function waits in here until the exe exits. argc and argv are the parameters passed into the main method. See the API for how they are parsed.

Definition at line 232 of file Barst.cpp.