linux版本中间件

VirtualChan.cpp 1.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #include "VirtualChan.h"
  2. #include "Log.h"
  3. #include "FsProxy.h"
  4. #include "Operation.h"
  5. VirtualChan::VirtualChan(CFsProxy* pParent, uint32_t ChanNo) : m_pParent(pParent), m_No(ChanNo), m_State(CHAN_LOGIC_STATE_FREE), m_IsInMeeting(false), m_pOperation(nullptr)
  6. {
  7. }
  8. VirtualChan::~VirtualChan()
  9. {
  10. }
  11. void VirtualChan::_setSession(string SessionId, string ChanId)
  12. {
  13. m_SessionId = SessionId;
  14. if (!ChanId.empty())
  15. {
  16. m_ChanId = ChanId;
  17. m_pParent->regBusyChan(this);
  18. }
  19. else
  20. {
  21. m_pParent->unregBusyChan(this);
  22. m_ChanId.clear();
  23. }
  24. }
  25. void VirtualChan::_reset(void)
  26. {
  27. LOG_INFO("{CVirtualChan}: 执行线路[%lu]重置", m_No);
  28. m_State = CHAN_LOGIC_STATE_FREE;
  29. m_IsInMeeting = false;
  30. m_CalleeNum.clear();
  31. m_CalleeNum.clear();
  32. m_ChanId.clear();
  33. m_SessionId.clear();
  34. m_OpNumber.clear();
  35. }
  36. bool VirtualChan::bindOp(COperation * pOp)
  37. {
  38. if(pOp==nullptr || m_pOperation !=nullptr)
  39. return false;
  40. m_pOperation = pOp;
  41. return true;
  42. }
  43. bool VirtualChan::releaseOp(COperation * pOp)
  44. {
  45. if(m_pOperation != pOp)
  46. return false;
  47. m_pOperation = nullptr;
  48. return true;
  49. }