• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ UtlVoidPtr类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中UtlVoidPtr的典型用法代码示例。如果您正苦于以下问题:C++ UtlVoidPtr类的具体用法?C++ UtlVoidPtr怎么用?C++ UtlVoidPtr使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: localIpKey

UtlBoolean SipUdpServer::getStunAddress(UtlString* pIpAddress, int* pPort,
                                        const char* szLocalIp) 
{
    UtlBoolean bRet = false;
    OsStunDatagramSocket* pSocket = NULL;
    UtlVoidPtr* pSocketContainer = NULL;

    if (szLocalIp)
    {
        UtlString localIpKey(szLocalIp);
       
        pSocketContainer = (UtlVoidPtr*)this->mServerSocketMap.findValue(&localIpKey);
        if (pSocketContainer)
        {
            pSocket = (OsStunDatagramSocket*)pSocketContainer->getValue();
        }
    }
    else
    {
        // just use the default Socket in our collection
        UtlString defaultIpKey(mDefaultIp);
       
        pSocketContainer = (UtlVoidPtr*)mServerSocketMap.findValue(&defaultIpKey);
        if (pSocketContainer != NULL )
        {
            pSocket = (OsStunDatagramSocket*)pSocketContainer->getValue();
        }
    }
    
    if (pSocket)
    {
        bRet =  pSocket->getExternalIp(pIpAddress, pPort) ;
    }
    return bRet;
}
开发者ID:Konnekt,项目名称:lib-sipx,代码行数:35,代码来源:SipUdpServer.cpp


示例2: sipxIsCallInFocus

UtlBoolean sipxIsCallInFocus()
{
    UtlBoolean inFocus = false ;
    if (gpCallHandleMap->lock())
    {
        UtlHashMapIterator iter(*gpCallHandleMap);

        UtlInt* pIndex = NULL;
        UtlVoidPtr* pObj = NULL;
        SIPX_CALL hCall = 0 ;

        while (pIndex = dynamic_cast<UtlInt*>( iter() ) )
        {
            pObj = dynamic_cast<UtlVoidPtr*>(gpCallHandleMap->findValue(pIndex));
            SIPX_CALL_DATA* pData = NULL ;
            if (pObj)
            {
                pData = (SIPX_CALL_DATA*) pObj->getValue() ;
                if (pData->bInFocus)
                {
                    inFocus = true ;
                    break ;
                }
            }
        }

        gpCallHandleMap->unlock() ;
    }

    return inFocus ;
}
开发者ID:LordGaav,项目名称:sipxecs,代码行数:31,代码来源:sipXtapiInternal.cpp


示例3: releaseHandleRef

const void* SipXHandleMap::removeHandle(SIPXHANDLE handle) 
{
    const void* pRC = NULL ;
    
    if (lock())
    {
        releaseHandleRef(handle);
        
        UtlInt* pCount = static_cast<UtlInt*>(mLockCountHash.findValue(&UtlInt(handle))) ;
        
        if (pCount == NULL || pCount->getValue() < 1)
        {
            UtlInt key(handle) ;
            UtlVoidPtr* pValue ;
            
            pValue = (UtlVoidPtr*) findValue(&key) ;
            if (pValue != NULL)
            {
                pRC = pValue->getValue() ;                
                destroy(&key) ;
            }

            if (pCount)
            {
                mLockCountHash.destroy(&UtlInt(handle));
            }
        }
    
        unlock() ;
    }

    return pRC ;
}
开发者ID:mranga,项目名称:sipxecs,代码行数:33,代码来源:SipXHandleMap.cpp


示例4: contactUrl

// Report to all the notifiers in mStateChangeNotifiers a new event
// 'dialogEvent' for AOR 'contact'.
void SipDialogMonitor::notifyStateChange(UtlString& contact,
                                         StateChangeNotifier::Status status)
{
   OsSysLog::add(FAC_SIP, PRI_DEBUG, "SipDialogMonitor::notifyStateChange "
                 "AOR = '%s', status = %s",
                 contact.data(),
                 (status == StateChangeNotifier::ON_HOOK ? "ON_HOOK" :
                  status == StateChangeNotifier::OFF_HOOK ? "OFF_HOOK" :
                  "UNKNOWN"));
   Url contactUrl(contact);

   // Loop through the notifier list, reporting the status to the notifiers.
   UtlHashMapIterator iterator(mStateChangeNotifiers);
   UtlString* listUri;
   UtlVoidPtr* container;
   StateChangeNotifier* notifier;
   while ((listUri = dynamic_cast <UtlString *> (iterator())))
   {
      container = dynamic_cast <UtlVoidPtr *> (mStateChangeNotifiers.findValue(listUri));
      notifier = (StateChangeNotifier *) container->getValue();
      // Report the status to the notifier.
      notifier->setStatus(contactUrl, status);
      OsSysLog::add(FAC_SIP, PRI_DEBUG,
                    "SipDialogMonitor::notifyStateChange setting state to %d",
                    status);
   }
}
开发者ID:chemeris,项目名称:sipxecs,代码行数:29,代码来源:SipDialogMonitor.cpp


示例5: waitUntilShutDown

// Destructor
SipUdpServer::~SipUdpServer()
{
    waitUntilShutDown();
    
    SipClient* pServer = NULL;
    UtlHashMapIterator iterator(mServers);
    UtlVoidPtr* pServerContainer = NULL;
    UtlString* pKey = NULL;
    
    while (pKey = (UtlString*)iterator())
    {
        pServerContainer = (UtlVoidPtr*)iterator.value();
        if (pServerContainer)
        {
            pServer = (SipClient*)pServerContainer->getValue();
            pServer->requestShutdown();
            delete pServer;
        }
    }
    mServers.destroyAll();

    mServerPortMap.destroyAll();    

    mServerSocketMap.destroyAll();
    
}
开发者ID:Konnekt,项目名称:lib-sipx,代码行数:27,代码来源:SipUdpServer.cpp


示例6: bRet

UtlBoolean SipTlsServer::startListener()
{
    UtlBoolean bRet(FALSE);
#       ifdef TEST_PRINT
        osPrintf("SIP Server binding to port %d\n", serverPort);
#       endif

    // iterate over the SipServerBroker map and call start
    UtlHashMapIterator iterator(mServerBrokers);
    UtlVoidPtr* pBrokerContainer = NULL;
    SipServerBroker* pBroker = NULL;
    UtlString* pKey = NULL;
    
    while(pKey = (UtlString*)iterator())
    {
        pBrokerContainer = (UtlVoidPtr*) iterator.value();
        if (pBrokerContainer)
        {
            pBroker = (SipServerBroker*)pBrokerContainer->getValue();
            if (pBroker)
            {
                pBroker->start();
                bRet = TRUE;
            }
        }
    }
    return bRet;
}
开发者ID:John-Chan,项目名称:sipXtapi,代码行数:28,代码来源:SipTlsServer.cpp


示例7: iterator

void SipUdpServer::printStatus()
{
    SipClient* pServer = NULL;
    UtlHashMapIterator iterator(mServers);
    UtlVoidPtr* pServerContainer = NULL;
    UtlString* pKey = NULL;
    
    while (pKey = (UtlString*)iterator())
    {
        pServerContainer = (UtlVoidPtr*) iterator.value();
        if (pServerContainer)
        {
            pServer = (SipClient*)pServerContainer->getValue();
        }
        if (pServer)
        {
            UtlString clientNames;
            long clientTouchedTime = pServer->getLastTouchedTime();
            UtlBoolean clientOk = pServer->isOk();
            pServer->getClientNames(clientNames);
            osPrintf("UDP server %p last used: %ld ok: %d names: \n%s \n",
                this, clientTouchedTime, clientOk, clientNames.data());

            SipProtocolServerBase::printStatus();
        }
    }
}
开发者ID:Konnekt,项目名称:lib-sipx,代码行数:27,代码来源:SipUdpServer.cpp


示例8: waitUntilShutDown

// Destructor
SipTlsServer::~SipTlsServer()
{
    waitUntilShutDown();
    if (mpServerBrokerListener)
    {
        mpServerBrokerListener->requestShutdown();
        delete mpServerBrokerListener;
    }
    {
        SipServerBroker* pBroker = NULL;
        UtlHashMapIterator iterator(this->mServerBrokers);
        UtlVoidPtr* pBrokerContainer = NULL;
        UtlString* pKey = NULL;
        
        while (pKey = (UtlString*)iterator())
        {
            pBrokerContainer = (UtlVoidPtr*)iterator.value();
            if (pBrokerContainer)
            {
                pBroker = (SipServerBroker*)pBrokerContainer->getValue();
                if (pBroker)
                {
                    pBroker->requestShutdown();
                    delete pBroker;
                }
            }
        }
        mServerBrokers.destroyAll();
    }

/*
    {
        OsSocket* pSocket = NULL;
        UtlHashMapIterator iterator(mServerSocketMap);
        UtlVoidPtr* pSocketContainer = NULL;
        UtlString* pKey = NULL;
        
        while (pKey = (UtlString*)iterator())
        {
            pSocketContainer = (UtlVoidPtr*)iterator.value();
            if (pSocketContainer)
            {
                pSocket = (OsSocket*)pSocketContainer->getValue();
                if (pSocket)
                {
                    delete pSocket;
                }
            }
        }
        mServerSocketMap.destroyAll();
    }
*/
    mServerSocketMap.destroyAll();
    mServerPortMap.destroyAll();


}
开发者ID:John-Chan,项目名称:sipXtapi,代码行数:58,代码来源:SipTlsServer.cpp


示例9: osPrintf

UtlBoolean SipProtocolServerBase::startListener()
{
#       ifdef TEST_PRINT
        osPrintf("SIP Server binding to port %d\n", serverPort);
#       endif

    UtlHashMapIterator iter(mServerSocketMap);
    UtlVoidPtr* pSocketContainer = NULL;
    UtlString* pKey;
    while ((pKey =(UtlString*)iter()))
    {
        OsSocket* pSocket = NULL;
        SipClient* pServer = NULL;
        UtlVoidPtr* pServerContainer = NULL;

        UtlString localIp = *pKey;
        pSocketContainer = (UtlVoidPtr*)iter.value();
         
        if (pSocketContainer)
        {    
            pSocket = (OsSocket*)pSocketContainer->getValue();
        }
        
        pServerContainer = (UtlVoidPtr*)mServers.findValue(&localIp);
        if (!pServerContainer)
        {
            pServer = new SipClient(pSocket);

            // This used to be done at the end of this else statement
            // however there is a race and the userAgent must be set before
            // starting this client.  I think the race occurs if there is
            // immediately an incoming message on the socket.
            if(mSipUserAgent)
            {
                if (pServer)
                {
                    pServer->setUserAgent(mSipUserAgent);
                }
            }
            this->mServers.insertKeyAndValue(new UtlString(localIp), new UtlVoidPtr((void*)pServer));
            pServer->start();
        }
        else
        {
            pServer = (SipClient*) pServerContainer->getValue();
            if(mSipUserAgent)
            {
                if (pServer)
                {
                    pServer->setUserAgent(mSipUserAgent);
                }
            }
        }
    }
    return(TRUE);
}
开发者ID:John-Chan,项目名称:sipXtapi,代码行数:56,代码来源:SipProtocolServerBase.cpp


示例10: iterator

void SipDialogMonitor::notifyStateChange(UtlString& contact, SipDialogEvent* dialogEvent)
{
   OsSysLog::add(FAC_SIP, PRI_DEBUG, "SipDialogMonitor::notifyStateChange contact = %s",
                 contact.data());

   // Loop through the notifier list
   UtlHashMapIterator iterator(mStateChangeNotifiers);
   UtlString* listUri;
   UtlVoidPtr* container;
   StateChangeNotifier* notifier;
   Url contactUrl(contact);
   mLock.acquire();
   while (listUri = dynamic_cast <UtlString *> (iterator()))
   {
      container = dynamic_cast <UtlVoidPtr *> (mStateChangeNotifiers.findValue(listUri));
      notifier = (StateChangeNotifier *) container->getValue();

      if (dialogEvent->isEmpty())
      {
         notifier->setStatus(contactUrl, StateChangeNotifier::ON_HOOK);
         OsSysLog::add(FAC_SIP, PRI_DEBUG, "SipDialogMonitor::notifyStateChange dialog is empty, setting state to on hook");
      }
      else
      {
         Dialog* dialog = dialogEvent->getFirstDialog();
            
         UtlString state, event, code;
         dialog->getState(state, event, code);
            
         OsSysLog::add(FAC_SIP, PRI_DEBUG, "SipDialogMonitor::notifyStateChange dialog state = %s",
                       state.data());
         if (state.compareTo(STATE_CONFIRMED) == 0)
         {
            notifier->setStatus(contactUrl, StateChangeNotifier::OFF_HOOK);
            OsSysLog::add(FAC_SIP, PRI_DEBUG, "SipDialogMonitor::notifyStateChange setting state to off hook");
         }
         else
         {     
            if (state.compareTo(STATE_TERMINATED) == 0)
            {
               notifier->setStatus(contactUrl, StateChangeNotifier::ON_HOOK);
               OsSysLog::add(FAC_SIP, PRI_DEBUG, "SipDialogMonitor::notifyStateChange setting state to on hook");
            }
            else
            {
               notifier->setStatus(contactUrl, StateChangeNotifier::RINGING);
               OsSysLog::add(FAC_SIP, PRI_DEBUG, "SipDialogMonitor::notifyStateChange setting state to ringing");
            }
         }
      }
   }
   mLock.release();
}
开发者ID:Konnekt,项目名称:lib-sipx,代码行数:53,代码来源:SipDialogMonitor.cpp


示例11: itor

void SipXHandleMap::dump() 
{
    UtlHashMapIterator itor(*this) ;
    UtlInt* pKey ;
    UtlVoidPtr* pValue ;
        
    while ((pKey = (UtlInt*) itor()))
    {
        pValue = (UtlVoidPtr*) findValue(pKey) ;
        printf("\tkey=%08X, value=%p\n", pKey->getValue(), 
                pValue ? pValue->getValue() : 0) ;                        
    }       
}
开发者ID:John-Chan,项目名称:sipXtapi,代码行数:13,代码来源:SipXHandleMap.cpp


示例12: localLock

void* OsLockingList::pop()
{
        void* element = NULL;

        // Lock before accessing the list
        OsLock localLock(listMutex);

        if (list.entries())
        {
            UtlVoidPtr* elementContainer = dynamic_cast<UtlVoidPtr*>(list.last());
            list.removeReference(elementContainer);
            element = (void*) elementContainer->getValue();
            delete elementContainer;
        }

        return(element);
}
开发者ID:ATHLSolutions,项目名称:sipxecs,代码行数:17,代码来源:OsLockingList.cpp


示例13: assertIterator

void* OsLockingList::remove(int iteratorHandle)
{
        void* element = NULL;

        assertIterator(iteratorHandle);
   if (currentElement)
   {
      UtlVoidPtr* elementContainer = (UtlVoidPtr*)list.removeReference(currentElement);
      if(elementContainer)
      {
         element = (void*) elementContainer->getValue();
         delete elementContainer;
         currentElement=NULL;
      }
        }
        return(element);
}
开发者ID:ATHLSolutions,项目名称:sipxecs,代码行数:17,代码来源:OsLockingList.cpp


示例14: sipxLineObjectFree

void sipxLineObjectFree(const SIPX_LINE hLine)
{
    // First remove it from the HandleMap so no one else an find it
    SIPX_LINE_DATA* pData =
       (SIPX_LINE_DATA *)gpLineHandleMap->removeHandle(hLine) ;

    if (pData)
    {
        // Then lock it so anyone who was previously using it is known
        // to have released it
        if (pData->pMutex->acquireWrite() == OS_SUCCESS)
        {
            // Now it is safe to delete
            pData->pInst->pLock->acquire() ;
            pData->pInst->nLines-- ;
            assert(pData->pInst->nLines >= 0) ;
            pData->pInst->pLock->release() ;

            if (pData->lineURI)
            {
                delete pData->lineURI ;
            }

            if (pData->pMutex)
            {
                delete pData->pMutex ;
            }

            if (pData->pLineAliases)
            {
                UtlVoidPtr* pValue ;
                while (pValue = (UtlVoidPtr*) pData->pLineAliases->get())
                {
                    Url* pUri = (Url*) pValue->getValue() ;
                    if (pUri)
                    {
                        delete pUri ;
                    }
                    delete pValue ;
                }
            }

            delete pData ;
        }
    }
}
开发者ID:LordGaav,项目名称:sipxecs,代码行数:46,代码来源:sipXtapiInternal.cpp


示例15: uriCollectable

UtlBoolean HttpServer::findRequestProcessor(const char* fileUri,
                                            RequestProcessor* &requestProcessor
                                            )
{
    UtlString uriCollectable(fileUri);
    UtlVoidPtr* processorCollectable;

    requestProcessor = NULL;
    processorCollectable =
        (UtlVoidPtr*) mRequestProcessorMethods.findValue(&uriCollectable);
    if(processorCollectable)
    {
        requestProcessor = (RequestProcessor*)processorCollectable->getValue();
    }

    return(requestProcessor != NULL);
}
开发者ID:LordGaav,项目名称:sipxecs,代码行数:17,代码来源:HttpServer.cpp


示例16: lock

const void* SipXHandleMap::findHandle(SIPXHANDLE handle) 
{
    lock() ;

    const void* pRC = NULL ;
    UtlInt key(handle) ;
    UtlVoidPtr* pValue ;

    pValue = (UtlVoidPtr*) findValue(&key) ;
    if (pValue != NULL)
    {
        pRC = pValue->getValue() ;
    }

    unlock() ;

    return pRC ;
}
开发者ID:John-Chan,项目名称:sipXtapi,代码行数:18,代码来源:SipXHandleMap.cpp


示例17: sipxCallLookupHandle

SIPX_CALL sipxCallLookupHandle(const UtlString& callID, const void* pSrc)
{
    SIPX_CALL hCall = 0 ;

    if (gpCallHandleMap->lock())
    {
        UtlHashMapIterator iter(*gpCallHandleMap);

        UtlInt* pIndex = NULL;
        UtlVoidPtr* pObj = NULL;

        while ((pIndex = dynamic_cast<UtlInt*>( iter() )) )
        {
            pObj = dynamic_cast<UtlVoidPtr*>(gpCallHandleMap->findValue(pIndex));
            SIPX_CALL_DATA* pData = NULL ;
            if (pObj)
            {
                pData = (SIPX_CALL_DATA*) pObj->getValue() ;
            }

            if (pData &&
                    (pData->callId->compareTo(callID) == 0 ||
                    (pData->sessionCallId && (pData->sessionCallId->compareTo(callID) == 0)) ||
                    (pData->transferCallId && (pData->transferCallId->compareTo(callID) == 0))) &&
                    pData->pInst->pCallManager == pSrc)
            {
                hCall = pIndex->getValue() ;
#ifdef DUMP_CALLS
                OsSysLog::add(FAC_SIPXTAPI, PRI_DEBUG, "***************** LookupHandle ***\nhCall %d\n****callId %s\n***sessionCallId %s\n",
                hCall,
                pData->callId ? pData->callId->data() : NULL,
                pData->sessionCallId ? pData->sessionCallId->data() : NULL);
#endif
                break ;
            }
        }

        gpCallHandleMap->unlock() ;
    }

    return hCall;
}
开发者ID:LordGaav,项目名称:sipxecs,代码行数:42,代码来源:sipXtapiInternal.cpp


示例18: findSessionByCallManager

SIPX_INSTANCE_DATA* findSessionByCallManager(const void* pCallManager)
{
    SIPX_INSTANCE_DATA *pInst = NULL ;

    UtlDListIterator iter(*gpSessionList);

    UtlVoidPtr* pObj = NULL;

    while ((pObj = dynamic_cast<UtlVoidPtr*>(iter())))
    {
        SIPX_INSTANCE_DATA* pTest = (SIPX_INSTANCE_DATA*) pObj->getValue() ;
        if ((pTest) && (pTest->pCallManager == pCallManager))
        {
            pInst = pTest ;
            break ;
        }
    }

    return pInst ;
}
开发者ID:LordGaav,项目名称:sipxecs,代码行数:20,代码来源:sipXtapiInternal.cpp


示例19: lock

// Retrieve the value associated with the specified key.
// If pValue is non-NULL, the value is returned via pValue.
// Return OS_SUCCESS if the lookup is successful, return OS_NOT_FOUND if
// there is no match for the specified key.
OsStatus OsNameDb::lookup(const UtlString& rKey,
                          void** pValue)
{
    OsReadLock  lock(mRWLock);
    OsStatus    result = OS_NOT_FOUND;
    UtlVoidPtr* pDictValue;

    pDictValue = (UtlVoidPtr*)
                 mDict.findValue(&rKey); // perform the lookup

    if (pDictValue != NULL)
    {
        if (pValue != NULL)       // if we have a valid pointer,
        {   //  return the corresponding value
            *pValue = pDictValue->getValue();
        }
        result = OS_SUCCESS;
    }

    return result;
}
开发者ID:mranga,项目名称:sipxecs,代码行数:25,代码来源:OsNameDb.cpp


示例20: sipxDumpCalls

void sipxDumpCalls()
{
    if (gpCallHandleMap->lock())
    {
        UtlHashMapIterator iter(*gpCallHandleMap);

        UtlInt* pIndex = NULL;
        UtlVoidPtr* pObj = NULL;
        SIPX_CALL hCall = 0 ;

        while (pIndex = dynamic_cast<UtlInt*>( iter() ) )
        {
            pObj = dynamic_cast<UtlVoidPtr*>(gpCallHandleMap->findValue(pIndex));
            SIPX_CALL_DATA* pData = NULL ;
            if (pObj)
            {
                pData = (SIPX_CALL_DATA*) pObj->getValue() ;
            }

            if (pData)
            {
                hCall = pIndex->getValue() ;
                OsSysLog::add(FAC_SIPXTAPI, PRI_DEBUG,
                              "***************** CallDump***\n"
                              "hCall %d\n"
                              "****callId %s\n"
                              "****ghostCallId %s\n"
                              "***bRemoveInsteadOfDrop %d\n"
                              "****lineUri %s\n",
                    hCall,
                    pData->callId ? pData->callId->data() : NULL,
                    pData->ghostCallId ? pData->ghostCallId->data() : NULL,
                    pData->bRemoveInsteadOfDrop,
                    pData->lineURI ? pData->lineURI->data() : NULL);

            }
        }
        gpCallHandleMap->unlock() ;
    }
}
开发者ID:LordGaav,项目名称:sipxecs,代码行数:40,代码来源:sipXtapiInternal.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ Uuid类代码示例发布时间:2022-05-31
下一篇:
C++ UtlString类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap