| 1234567891011121314151617181920212223242526272829303132333435363738 |
- #include "StdAfx.h"
- #include "StrategyLoop.h"
- #include "Agent.h"
- #include "AgentGroup.h"
- CStrategyLoop::CStrategyLoop(void) : m_Index(0)
- {
- }
- CStrategyLoop::~CStrategyLoop(void)
- {
- }
- /*****************************************************************
- **【函数名称】 _locateAgent
- **【函数功能】 得到当前排队策略下可用座席
- **【参数】
- **【返回值】
- ****************************************************************/
- CAgent* CStrategyLoop::_locateAgent( CAgentGroup& AgentGroup )
- {
- CAgent* pAgent = NULL;
- for(int i=0; i<AgentGroup.GetCount(); ++i) // 保证遍历一轮
- {
- if(m_Index >= AgentGroup.GetCount())
- m_Index = 0;
- pAgent = AgentGroup[m_Index++];
- if(pAgent->isFree())
- return pAgent;
- } // end if
- return NULL;
- }
|