本文整理汇总了C++中CUser::GetCurCustomer方法的典型用法代码示例。如果您正苦于以下问题:C++ CUser::GetCurCustomer方法的具体用法?C++ CUser::GetCurCustomer怎么用?C++ CUser::GetCurCustomer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CUser
的用法示例。
在下文中一共展示了CUser::GetCurCustomer方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetServiceID
char* CPublicManage::GetServiceID(int nPublicID, char* szUserID, int tpid /* = 0 */)
{
CLock m_csLock;
CAutoLock autolock(&m_csLock);
m_iCurPublic = nPublicID;
COPYSTRARRAY(m_szCurUser,szUserID);
m_iCurTp = tpid > 0?tpid:-1;
BOOL bRet = FALSE;
TpRelation tprelation;
COPYSTRARRAY(m_pstrActiveID,"");
for (int i = 0;i<m_vTpRelation.size();i++){//遍历公众号对应路由关系表{
tprelation = m_vTpRelation[i];
if (nPublicID == tprelation.publicid){
if (tpid == -1) m_iCurTp = tprelation.tpid;
std::vector<TpRule>::iterator it_tprule =
find_if(m_vTpRule.begin(),m_vTpRule.end(),find_id<TpRule>(m_iCurTp));
if (it_tprule != m_vTpRule.end()){
switch(it_tprule->typtype){
case TP_TIME:
bRet = TimeTP(&(*it_tprule));
break;
case TP_PROBLEM:
bRet = ProblemTP(m_iCurTp);
break;
case TP_INTERFACE:
bRet = InterfaceTP(&(*it_tprule));
break;
case TP_CUSTOMERSERVICE:
bRet = DirectCustomerService(&(*it_tprule));
break;
case TP_OTHER:
default:
bRet = FALSE;
break;
}
}
}
if(bRet) break;
}
if (bRet)
{
if(m_listUser.size()){
CUser *pCurUser = m_listUser.back();
if(!strcmp(pCurUser->GetName(),szUserID))
return pCurUser->GetCurCustomer()->GetName();
}
CUser *pUser = new CUser(szUserID);
pUser->Attach(m_pCurCustomer);
pUser->SetCurPublic(nPublicID);
pUser->SetCurTp(m_iCurTp);
m_listUser.push_back(pUser);
COPYSTRARRAY(m_pstrActiveID,m_pCurCustomer->GetName());
}
return m_pstrActiveID;
}
示例2: GetCurMaxDispatchCustomer
CCustomer* CPublicManage::GetCurMaxDispatchCustomer(int id,int disPatchType)
{
if (m_listUser.size())
{
CUser* pCurUser = m_listUser.back();
CCustomer* pCurCustomer = pCurUser->GetCurCustomer();
if (pCurUser && pCurUser->GetState() &&
m_iCurPublic == pCurUser->GetCurPublic() &&
!strcmp(m_szCurUser,pCurUser->GetName()) &&
m_iCurTp == pCurUser->GetCurTp() &&
pCurCustomer->GetCurIncode() == id &&
pCurCustomer->GetDisType() == disPatchType
){
pCurCustomer->SetSessionState(FALSE);
pCurCustomer->SetClientNum(pCurCustomer->GetClientNum()-1);
return pCurCustomer;
}
}
std::vector<char*> vCustName;
for (int i = 0;i<m_vDispatchRelation.size();i++){
if (m_vDispatchRelation[i].incodeid == id){
vCustName.push_back(m_vDispatchRelation[i].customerservice);
}
}
std::list<CCustomer*> list_tempCust;
std::vector<char*>::iterator itCustName = vCustName.begin();
while (itCustName!=vCustName.end()){
MYSTATE myState = (MYSTATE)0;
std::list<CCustomer*>::iterator it_CustObj = m_listCustomer.begin();
for (;it_CustObj!=m_listCustomer.end();it_CustObj++)
{
if(!strcmp((*it_CustObj)->GetName(),*itCustName))
break;
}
GetCustomerState((*it_CustObj)->GetName(),myState);
if (MYSTATE_NORMAL == myState &&
(*it_CustObj)->GetDisType() == disPatchType &&
(*it_CustObj)->GetClientNum() < MAX_CLIENTNUM){
list_tempCust.push_back(*it_CustObj);
}
itCustName++;
}
std::list<CCustomer*>::iterator itmax_index = list_tempCust.begin();
if (itmax_index== list_tempCust.end()) return NULL;
std::list<CCustomer*>::iterator itmax_temp = list_tempCust.begin();
if (list_tempCust.size() > 1) ++itmax_temp;
for (;itmax_index != list_tempCust.end();itmax_index++){
if((*itmax_index)->CmpByDisType(*itmax_temp,disPatchType) > 0 ){
itmax_temp = itmax_index;
}
}
return *itmax_temp;
}