当前位置: 首页>>代码示例>>C++>>正文


C++ JEvent::SetFromThrd方法代码示例

本文整理汇总了C++中JEvent::SetFromThrd方法的典型用法代码示例。如果您正苦于以下问题:C++ JEvent::SetFromThrd方法的具体用法?C++ JEvent::SetFromThrd怎么用?C++ JEvent::SetFromThrd使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在JEvent的用法示例。


在下文中一共展示了JEvent::SetFromThrd方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: DumpMemory

JUINT32 JPhoneAgent::DumpMemory()
{
    JEvent* pEvent = JNULL;
    JCommEngine* pComEngine = JNULL;
    JThread* pThread = JNULL;
    JAgentThread* pAgentThread = JNULL;

    JLogAutoPtr clsLogAutoPtr(JSingleton<JLog>::instance(), 
        JLOG_MOD_PHONE_AGENT, "JPhoneAgent::DumpMemory");

    pEvent = new JEvent(JEVT_MEMORY_DUMP_MEMORY);
    if (pEvent)
    {
	    pEvent->SetFromProc(JS_P_JMAINPROC);
	    pEvent->SetFromThrd(JS_T_JPHONEAGENT);
	    pEvent->SetFromMod(JNULL);
	    pEvent->SetToProc(JS_P_JMAINPROC);
	    pEvent->SetToThrd(JS_T_JMAINTHREAD);
	    pEvent->SetToMod(JS_M_JMEMORY);
	    pEvent->SetBody(JNULL);

        pThread = JSingleton<JThreadManager>::instance()->GetThread(JS_T_JPHONEAGENT);
        pAgentThread = dynamic_cast<JAgentThread*>(pThread);
        if (pAgentThread)
        {
    	    pComEngine = pAgentThread->GetNotifyCommEngine();
    	    if (pComEngine)
    	    {
    	        pComEngine->SendEvent(pEvent);
    	    }
	    }
    }

    return JSUCCESS;
}
开发者ID:gothame,项目名称:jphone,代码行数:35,代码来源:JPhoneAgent.cpp

示例2: PressKey

JUINT32 JPhoneAgent::PressKey(JSIPUA_KEY eKey)
{
    JEvent* pEvent = JNULL;
    JPjSipUaKey* pJPjSipUaKeyBody = JNULL;
    JCommEngine* pComEngine = JNULL;
    JThread* pThread = JNULL;
    JAgentThread* pAgentThread = JNULL;

    JLogAutoPtr clsLogAutoPtr(JSingleton<JLog>::instance(), 
        JLOG_MOD_PHONE_AGENT, "JPhoneAgent::PressKey");

    pEvent = new JEvent(JEVT_SIPUA_PRESS_KEY);
    pJPjSipUaKeyBody = new JPjSipUaKey;
	if (pEvent && pJPjSipUaKeyBody)
	{
    	JCHAR cKey[2] = {0};
		cKey[0] = JPjSipUa::KeyEnum2Char(eKey);
		JString strKey = cKey;
		//store the press key
		pJPjSipUaKeyBody->SetKey(strKey);

	    pEvent->SetFromProc(JS_P_JMAINPROC);
	    pEvent->SetFromThrd(JS_T_JPHONEAGENT);
	    pEvent->SetFromMod(JNULL);
	    pEvent->SetToProc(JS_P_JMAINPROC);
	    pEvent->SetToThrd(JS_T_JMAINTHREAD);
	    pEvent->SetToMod(JS_M_JSIPUA);
	    pEvent->SetBody(pJPjSipUaKeyBody);

        pThread = JSingleton<JThreadManager>::instance()->GetThread(JS_T_JPHONEAGENT);
        pAgentThread = dynamic_cast<JAgentThread*>(pThread);
        if (pAgentThread)
        {
        	//get the communication engine to send the event
    	    pComEngine = pAgentThread->GetNotifyCommEngine();
    	    if (pComEngine)
    	    {
    	        pComEngine->SendEvent(pEvent);
    	    }
	    }
    }

    return JSUCCESS;
}
开发者ID:weiganyi,项目名称:jphone,代码行数:44,代码来源:JPhoneAgent.cpp

示例3: SetLogCfg

JUINT32 JPhoneAgent::SetLogCfg(JLogCfg* pLogCfg)
{
    JEvent* pEvent = JNULL;
    JLogCfg* pLogCfgBody = JNULL;
    JCommEngine* pComEngine = JNULL;
    JThread* pThread = JNULL;
    JAgentThread* pAgentThread = JNULL;

    JLogAutoPtr clsLogAutoPtr(JSingleton<JLog>::instance(), 
        JLOG_MOD_PHONE_AGENT, "JPhoneAgent::SetLogCfg");

    pEvent = new JEvent(JEVT_LOG_SET_CFG);
    pLogCfgBody = new JLogCfg;
	if (pEvent && pLogCfgBody)
	{
		//set log config into the body
		pLogCfgBody->SetLogAddress(pLogCfg->GetLogAddress());
		pLogCfgBody->SetLogPort(pLogCfg->GetLogPort());
		pLogCfgBody->SetOutputFile(pLogCfg->GetOutputFile());
		pLogCfgBody->SetOutputRemote(pLogCfg->GetOutputRemote());

	    pEvent->SetFromProc(JS_P_JMAINPROC);
	    pEvent->SetFromThrd(JS_T_JPHONEAGENT);
	    pEvent->SetFromMod(JNULL);
	    pEvent->SetToProc(JS_P_JMAINPROC);
	    pEvent->SetToThrd(JS_T_JMAINTHREAD);
	    pEvent->SetToMod(JS_M_JLOG);
	    pEvent->SetBody(pLogCfgBody);

        pThread = JSingleton<JThreadManager>::instance()->GetThread(JS_T_JPHONEAGENT);
        pAgentThread = dynamic_cast<JAgentThread*>(pThread);
        if (pAgentThread)
        {
        	//get the communication engine to send the event
    	    pComEngine = pAgentThread->GetNotifyCommEngine();
    	    if (pComEngine)
    	    {
    	        pComEngine->SendEvent(pEvent);
    	    }
	    }
    }

    return JSUCCESS;
}
开发者ID:weiganyi,项目名称:jphone,代码行数:44,代码来源:JPhoneAgent.cpp

示例4: SetSipUaCfg

JUINT32 JPhoneAgent::SetSipUaCfg(JPjSipUaCfg* pPjSipUaCfg)
{
    JEvent* pEvent = JNULL;
    JPjSipUaCfg* pPjSipUaCfgBody = JNULL;
    JCommEngine* pComEngine = JNULL;
    JThread* pThread = JNULL;
    JAgentThread* pAgentThread = JNULL;

    JLogAutoPtr clsLogAutoPtr(JSingleton<JLog>::instance(), 
        JLOG_MOD_PHONE_AGENT, "JPhoneAgent::SetSipUaCfg");

    pEvent = new JEvent(JEVT_SIPUA_SET_CFG);
    pPjSipUaCfgBody = new JPjSipUaCfg;
	if (pEvent && pPjSipUaCfgBody)
	{
		//set account info into the body
		pPjSipUaCfgBody->SetNumber(pPjSipUaCfg->GetNumber());
		pPjSipUaCfgBody->SetAuthName(pPjSipUaCfg->GetAuthName());
		pPjSipUaCfgBody->SetAuthPasswd(pPjSipUaCfg->GetAuthPasswd());
		pPjSipUaCfgBody->SetProxyAddr(pPjSipUaCfg->GetProxyAddr());

	    pEvent->SetFromProc(JS_P_JMAINPROC);
	    pEvent->SetFromThrd(JS_T_JPHONEAGENT);
	    pEvent->SetFromMod(JNULL);
	    pEvent->SetToProc(JS_P_JMAINPROC);
	    pEvent->SetToThrd(JS_T_JMAINTHREAD);
	    pEvent->SetToMod(JS_M_JSIPUA);
	    pEvent->SetBody(pPjSipUaCfgBody);

        pThread = JSingleton<JThreadManager>::instance()->GetThread(JS_T_JPHONEAGENT);
        pAgentThread = dynamic_cast<JAgentThread*>(pThread);
        if (pAgentThread)
        {
        	//get the communication engine to send the event
    	    pComEngine = pAgentThread->GetNotifyCommEngine();
    	    if (pComEngine)
    	    {
    	        pComEngine->SendEvent(pEvent);
    	    }
	    }
    }

    return JSUCCESS;
}
开发者ID:weiganyi,项目名称:jphone,代码行数:44,代码来源:JPhoneAgent.cpp

示例5: SetDaemonCfg

JUINT32 JPhoneAgent::SetDaemonCfg(JDaemonCfg* pDaemonCfg)
{
    JEvent* pEvent = JNULL;
    JDaemonCfg* pDaemonCfgBody = JNULL;
    JCommEngine* pComEngine = JNULL;
    JThread* pThread = JNULL;
    JAgentThread* pAgentThread = JNULL;

    JLogAutoPtr clsLogAutoPtr(JSingleton<JLog>::instance(), 
        JLOG_MOD_PHONE_AGENT, "JPhoneAgent::SetDaemonCfg");

    pEvent = new JEvent(JEVT_DAEMON_SET_CFG);
    pDaemonCfgBody = new JDaemonCfg;
	if (pEvent && pDaemonCfg)
	{
		//set save methon into the body
		pDaemonCfgBody->SetSaveMethod(pDaemonCfg->GetSaveMethod());

	    pEvent->SetFromProc(JS_P_JMAINPROC);
	    pEvent->SetFromThrd(JS_T_JPHONEAGENT);
	    pEvent->SetFromMod(JNULL);
	    pEvent->SetToProc(JS_P_JMAINPROC);
	    pEvent->SetToThrd(JS_T_JMAINTHREAD);
	    pEvent->SetToMod(JS_M_JDAEMON);
	    pEvent->SetBody(pDaemonCfgBody);

        pThread = JSingleton<JThreadManager>::instance()->GetThread(JS_T_JPHONEAGENT);
        pAgentThread = dynamic_cast<JAgentThread*>(pThread);
        if (pAgentThread)
        {
        	//get the communication engine to send the event
    	    pComEngine = pAgentThread->GetNotifyCommEngine();
    	    if (pComEngine)
    	    {
    	        pComEngine->SendEvent(pEvent);
    	    }
	    }
    }

    return JSUCCESS;
}
开发者ID:weiganyi,项目名称:jphone,代码行数:41,代码来源:JPhoneAgent.cpp

示例6: ClickContact

JUINT32 JPhoneAgent::ClickContact(JPjSipUaClickContact* pPjSipUaClickContact)
{
    JEvent* pEvent = JNULL;
    JPjSipUaClickContact* pPjSipUaClickContactBody = JNULL;
    JCommEngine* pComEngine = JNULL;
    JThread* pThread = JNULL;
    JAgentThread* pAgentThread = JNULL;

    JLogAutoPtr clsLogAutoPtr(JSingleton<JLog>::instance(), 
        JLOG_MOD_PHONE_AGENT, "JPhoneAgent::ClickContact");

    pEvent = new JEvent(JEVT_SIPUA_CLICK_CONTACT);
    pPjSipUaClickContactBody = new JPjSipUaClickContact;
	if (pEvent && pPjSipUaClickContactBody)
	{
		//store the number selected into the contact list
		pPjSipUaClickContactBody->SetContactNumber(pPjSipUaClickContact->GetContactNumber());

	    pEvent->SetFromProc(JS_P_JMAINPROC);
	    pEvent->SetFromThrd(JS_T_JPHONEAGENT);
	    pEvent->SetFromMod(JNULL);
	    pEvent->SetToProc(JS_P_JMAINPROC);
	    pEvent->SetToThrd(JS_T_JMAINTHREAD);
	    pEvent->SetToMod(JS_M_JSIPUA);
	    pEvent->SetBody(pPjSipUaClickContactBody);

        pThread = JSingleton<JThreadManager>::instance()->GetThread(JS_T_JPHONEAGENT);
        pAgentThread = dynamic_cast<JAgentThread*>(pThread);
        if (pAgentThread)
        {
        	//get the communication engine to send the event
    	    pComEngine = pAgentThread->GetNotifyCommEngine();
    	    if (pComEngine)
    	    {
    	        pComEngine->SendEvent(pEvent);
    	    }
	    }
    }

    return JSUCCESS;
}
开发者ID:weiganyi,项目名称:jphone,代码行数:41,代码来源:JPhoneAgent.cpp

示例7: GetContact

JUINT32 JPhoneAgent::GetContact()
{
    JEvent* pEvent = JNULL;
    JCommEngine* pComEngine = JNULL;
    JThread* pThread = JNULL;
    JAgentThread* pAgentThread = JNULL;

    JLogAutoPtr clsLogAutoPtr(JSingleton<JLog>::instance(), 
        JLOG_MOD_PHONE_AGENT, "JPhoneAgent::GetContact");

    pEvent = new JEvent(JEVT_SIPUA_GET_CONTACT_LIST);
    if (pEvent)
    {
	    pEvent->SetFromProc(JS_P_JMAINPROC);
	    pEvent->SetFromThrd(JS_T_JPHONEAGENT);
	    pEvent->SetFromMod(JNULL);
	    pEvent->SetToProc(JS_P_JMAINPROC);
	    pEvent->SetToThrd(JS_T_JMAINTHREAD);
	    pEvent->SetToMod(JS_M_JSIPUA);
	    pEvent->SetBody(JNULL);

        pThread = JSingleton<JThreadManager>::instance()->GetThread(JS_T_JPHONEAGENT);
        pAgentThread = dynamic_cast<JAgentThread*>(pThread);
        if (pAgentThread)
        {
        	//get the communication engine to send the event
    	    pComEngine = pAgentThread->GetNotifyCommEngine();
    	    if (pComEngine)
    	    {
    	        pComEngine->SendEvent(pEvent);
    	    }
	    }
    }

    return JSUCCESS;
}
开发者ID:weiganyi,项目名称:jphone,代码行数:36,代码来源:JPhoneAgent.cpp


注:本文中的JEvent::SetFromThrd方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。