升龙物业 老版本 ocx IPO, 加密狗 转值班电话

StrategyLoop.cpp 731B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #include "StdAfx.h"
  2. #include "StrategyLoop.h"
  3. #include "Agent.h"
  4. #include "AgentGroup.h"
  5. CStrategyLoop::CStrategyLoop(void) : m_Index(0)
  6. {
  7. }
  8. CStrategyLoop::~CStrategyLoop(void)
  9. {
  10. }
  11. /*****************************************************************
  12. **【函数名称】 _locateAgent
  13. **【函数功能】 得到当前排队策略下可用座席
  14. **【参数】
  15. **【返回值】
  16. ****************************************************************/
  17. CAgent* CStrategyLoop::_locateAgent( CAgentGroup& AgentGroup )
  18. {
  19. CAgent* pAgent = NULL;
  20. for(int i=0; i<AgentGroup.GetCount(); ++i) // 保证遍历一轮
  21. {
  22. if(m_Index >= AgentGroup.GetCount())
  23. m_Index = 0;
  24. pAgent = AgentGroup[m_Index++];
  25. if(pAgent->isFree())
  26. return pAgent;
  27. } // end if
  28. return NULL;
  29. }