中间件标准版5.1git,去除基础模块

Line.cpp 1.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #include "StdAfx.h"
  2. #include "Line.h"
  3. CLine::CLine(int LineId) : m_IPOLineID(0), m_LineID(LineId), m_State(S_CALL_STANDBY), m_pCmdEntity(NULL)
  4. {
  5. }
  6. CLine::~CLine(void)
  7. {
  8. freeCmd();
  9. }
  10. /*****************************************************************
  11. **【函数名称】 setCmd
  12. **【函数功能】 实例化命令指针,并备份PDU消息。
  13. **【参数】 CPduEntity* pCmdEntity PDU消息指针
  14. **【返回值】
  15. ****************************************************************/
  16. void CLine::setCmd( CPduEntity* pCmdEntity )
  17. {
  18. if (NULL != m_pCmdEntity )
  19. delete m_pCmdEntity;
  20. m_pCmdEntity = new CPduEntity(*pCmdEntity);
  21. ASSERT(m_pCmdEntity != NULL);
  22. }
  23. /*****************************************************************
  24. **【函数名称】 FreePduEntity
  25. **【函数功能】 释放存储命令指针
  26. **【参数】
  27. **【返回值】
  28. ****************************************************************/
  29. void CLine::freeCmd( void )
  30. {
  31. if (NULL != m_pCmdEntity)
  32. {
  33. delete m_pCmdEntity;
  34. m_pCmdEntity = NULL;
  35. }
  36. }
  37. /*****************************************************************
  38. **【函数名称】 show
  39. **【函数功能】 显示当前线路状态
  40. **【参数】
  41. **【返回值】
  42. ****************************************************************/
  43. void CLine::show( void )
  44. {
  45. // 推送状态变化消息
  46. CMsgCenter::GetInstance().pushMsg(VS_MSG_LINE_STATE_UPDATE, reinterpret_cast<const PARAM>(m_LineID));
  47. }