Encapsulates interprocess communications messages. The structure is:
{
public:
CAMIPBase();
~CAMIPBase();
enum Error
{
errorNo=0, // no error
errorIpcRegister, // IPC Regisration Failure
errorMemAlocateFailed, // Mem Alloc failed
errorReserveEventFlags, // event flag could not be reserved
errorInit, // Error in initialization
errorStart, // Error in Starting the process
errorReadPort, // Error in Reading port
errorIPC, // IPC Error
errorRouterDied, // router died
errorParnterDied, // partner process died
errorDGUnload, // error in datagram unload
};
BOOL Start(BOOL bAsync=FALSE);
BOOL Stop();
BOOL IsRunning();
int GetLastError();
// virtual functions
virtual void OnAlarmInfo(CAlarmUpdateInfo *pAlarmInfo)=0;
virtual void OnShutdown()=0;
virtual void OnStatus(COR_STATUS *pStatus)=0;
virtual void NotifyStopOnError();
};
This is the abstract base class from which you drive an AMIP object. An AMIP object provides member functions for informing Alarm update to the application.
The constructor of CAMIPBase takes care of connecting to CIMPLICITY project.
Start() starts the process of informing alarm update. This process can be synchronous or asynchronous.
The synchronous Start() waits until the process is shutdown.
The asynchronous Start() can be stopped by Stop().
Stop()stops the process of informing alarm update.
GetLastError() return the last error value. The error values are :
Error Code |
Description |
errorNo |
No error |
errorIpcRegister |
IPC Registration Failure |
errorMemAlocateFailed |
Memory allocation failed |
errorReserveEventFlags |
Event flag could not be reserved |
errorInit |
Error in initialization |
errorStart |
Error in starting the process |
errorReadPort |
Error in Reading port |
errorIPC |
IPC Error |
errorRouterDied |
Router terminated |
errorParnterDied |
Partner process terminated |
errorDGUnload |
Error in datagram unload |
Classes. |