Terminal.cpp 1.15 KB
// Terminal class source file.

 

#include "Terminal.hpp"

#include "Msg.hpp"

void Terminal::SendMessage(Msg *pMsg)

{

   //...

}

 

Terminal::Terminal()

{  

    terminalId = UNKNOWN;

    terminalType = UNKNOWN;

    terminalStatus = UNKNOWN;

}

 

Terminal::~Terminal()

{

    //...

}

 

int Terminal::HandleRunDiagnostics(const RunDiagnosticsMsg *pMsg)

{

    int status = 1;

    //...

   return status;

}

 

int Terminal::HandleOutOfService()

{

    int status = 1;

    terminalStatus = OUT_OF_SERVICE;

    //...

    return status;

}

 

int Terminal::HandleInService()

{

   int status = 1;

   terminalStatus = INSERVICE;

   //...

   return status;

}

 

void Terminal::Activate(const TerminalCreateMsg *pMsg)

{

    terminalId = pMsg->GetTerminalId();

    terminalType = pMsg->GetTerminalType();

    terminalStatus = pMsg->GetTerminalStatus();

    //...

 

    TerminalCreateAck *pAck = new TerminalCreateAck(terminalId, terminalStatus);

    SendMessage(pAck);

}

 

void Terminal::Deactivate(const TerminalDeleteMsg *pMsg)

{

    //...

    terminalId = UNKNOWN;

    terminalType = UNKNOWN;

    terminalStatus = UNKNOWN;

    //...

}