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

C++ UtlHashMap类代码示例

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

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



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

示例1: take

UtlContainable* UtlHashMapIterator::key() const
{
   UtlContainable* currentKey = NULL;
   
   UtlContainer::acquireIteratorConnectionLock();
   OsLock take(const_cast<OsBSem&>(mContainerRefLock));
   UtlHashMap* myHashMap = dynamic_cast<UtlHashMap*>(mpMyContainer);
   if (myHashMap)
   {
      OsLock container(myHashMap->mContainerLock);
      UtlContainer::releaseIteratorConnectionLock();

      if (   (mPosition < myHashMap->numberOfBuckets())
          && (mpCurrentPair)
          && (mPairIsValid)
          )
      {
         currentKey = mpCurrentPair->data;
      }
   }
   else
   {
      UtlContainer::releaseIteratorConnectionLock();
   }   

   return currentKey;
}
开发者ID:Jaroslav23,项目名称:sipxtapi,代码行数:27,代码来源:UtlHashMapIterator.cpp


示例2: iterator

void XmlRpcResponse::cleanUp(UtlContainable* value)
{
   if (value)
   {
      if (value->isInstanceOf(UtlHashMap::TYPE))
      {
         UtlHashMap* map = dynamic_cast<UtlHashMap*>(value);
         UtlHashMapIterator iterator(*map);
         UtlString* key;
         while ((key = dynamic_cast<UtlString*>(iterator())))
         {
            UtlContainable *pName;
            UtlContainable *member;
            pName = map->removeKeyAndValue(key, member);
            delete pName;
            cleanUp(member);
         }
      }
      else if (value->isInstanceOf(UtlSList::TYPE))
      {
         UtlSList* array = dynamic_cast<UtlSList*>(value);
         UtlContainable *element;
         while ((element = array->get()/* pop */))
         {
            cleanUp(element);
         }
      }

      delete value;
   }
}
开发者ID:John-Chan,项目名称:sipXtapi,代码行数:31,代码来源:XmlRpcResponse.cpp


示例3: UtlString

void
DialByNameDB::getContacts (
    const UtlString& digitString,
    ResultSet& rResultSet ) const
{
    // This should erase the contents of the existing resultset
    rResultSet.destroyAll();

    if ( !digitString.isNull() && (m_pFastDB != NULL) )
    {
        // Check the TableInfo table to see whether we need to reload
        // the Tables from the Credential/Permission tables
        SIPDBManager* pSIPDBManager = SIPDBManager::getInstance();
        if ( pSIPDBManager->getDatabaseChangedFlag( "credential" ) || 
             pSIPDBManager->getDatabaseChangedFlag( "permission" )  )
        {
            // Reload this IMDB and rese the changed flags 
            // in the credential and permission tables
            this->load();
        }

        // Thread Local Storage
        m_pFastDB->attach();

        // Search to see if we have a Credential Row
        dbCursor< DialByNameRow > cursor;

        dbQuery query;
        UtlString queryString = "np_digits like '" + digitString + "%'";
        query = queryString;
        if ( cursor.select(query) > 0 ) {
            do {
                UtlHashMap record;
                UtlString* np_identityValue = 
                    new UtlString ( cursor->np_identity );
                UtlString* np_contactValue = 
                    new UtlString ( cursor->np_contact );
                UtlString* np_digitsValue = 
                    new UtlString ( cursor->np_digits );

                // Memory Leak fixes, make shallow copies of static keys
                UtlString* np_identityKey = new UtlString( gNp_identityKey );
                UtlString* np_contactKey = new UtlString( gNp_contactKey );
                UtlString* np_digitsKey = new UtlString( gNp_digitsKey );

                record.insertKeyAndValue ( 
                    np_identityKey, np_identityValue );
                record.insertKeyAndValue ( 
                    np_contactKey, np_contactValue );
                record.insertKeyAndValue ( 
                    np_digitsKey, np_digitsValue );

                rResultSet.addValue(record);
            } while ( cursor.next() );
        }
        // Commit the rows to memory - multiprocess workaround
        m_pFastDB->detach(0);
    }
}
开发者ID:mranga,项目名称:sipxecs,代码行数:59,代码来源:DialByNameDB.cpp


示例4: addPermission

 void addPermission(ResultSet& permissions, const char* permissionValue)
    {
       UtlHashMap record;
       record.insertKeyAndValue(new UtlString("identity"),
                                new UtlString("dummy identity"));
       record.insertKeyAndValue(new UtlString("permission"),
                                new UtlString(permissionValue));
       permissions.addValue(record);
    }
开发者ID:ciuc,项目名称:sipxecs,代码行数:9,代码来源:EnforceAuthRulesTest.cpp


示例5: insertRow

UtlBoolean
ExtensionDB::insertRow (const UtlHashMap& nvPairs) 
{
    // Note we do not need the identity object here
    // as it is inferred from the uri
    return insertRow (
        Url( *((UtlString*)nvPairs.findValue(&gUriKey)) ),
        *((UtlString*)nvPairs.findValue(&gExtensionKey)) );
}
开发者ID:mranga,项目名称:sipxecs,代码行数:9,代码来源:ExtensionDB.cpp


示例6: insertRow

UtlBoolean
AliasDB::insertRow (const UtlHashMap& nvPairs)
{
    // Note we do not need the identity object here
    // as it is inferred from the uri
    UtlString identity, contact;
    identity = *((UtlString*)nvPairs.findValue(&gIdentityKey));
    contact = *((UtlString*)nvPairs.findValue(&gContactKey));
    return insertRow ( Url( identity ), Url( contact ) );
}
开发者ID:mranga,项目名称:sipxecs,代码行数:10,代码来源:AliasDB.cpp


示例7: while

void
ResultSet::destroyAll()
{
    // the pRecord is actually a UtlHashMap
    UtlHashMap* pRecord;
    while ((pRecord = dynamic_cast<UtlHashMap*>(get())))
    {
        pRecord->destroyAll();
        delete pRecord;
    }
}
开发者ID:mranga,项目名称:sipxecs,代码行数:11,代码来源:ResultSet.cpp


示例8: getResult

 void getResult( ResultSet& resultSet
                ,int         index
                ,const char* key
                ,UtlString&  result
                )
 {
    UtlHashMap hash;
    resultSet.getIndex( index, hash );
    UtlString theKey(key);
    result = *((UtlString*)hash.findValue(&theKey));
 }
开发者ID:LordGaav,项目名称:sipxecs,代码行数:11,代码来源:AuthRulesUrlMappingTest.cpp


示例9: insertRow

UtlBoolean
CredentialDB::insertRow (const UtlHashMap& nvPairs)
{
    // Note: identity inferred from the uri
    return insertRow (
        Url (*((UtlString*)nvPairs.findValue(&gUriKey))),
        *((UtlString*)nvPairs.findValue(&gRealmKey)),
        *((UtlString*)nvPairs.findValue(&gUseridKey)),
        *((UtlString*)nvPairs.findValue(&gPasstokenKey)),
        *((UtlString*)nvPairs.findValue(&gPintokenKey)),
        *((UtlString*)nvPairs.findValue(&gAuthtypeKey)));
}
开发者ID:mranga,项目名称:sipxecs,代码行数:12,代码来源:CredentialDB.cpp


示例10: UtlString

void
AliasDB::getAliases (
    const Url& contactIdentity,
    ResultSet& rResultSet ) const
{
    UtlString contactIdentityStr;
    contactIdentity.getIdentity(contactIdentityStr);

    // This should erase the contents of the existing resultset
    rResultSet.clear();

    if ( !contactIdentityStr.isNull() && (m_pFastDB != NULL) )
    {
        // Thread Local Storage
        m_pFastDB->attach();

        // Match a all rows where the contact identity matches
        UtlString queryString = "contact like '%" + contactIdentityStr + "%'";

        dbQuery query;
        query=queryString;

        // Search to see if we have a Credential Row
        dbCursor< AliasRow > cursor;

        if ( cursor.select(query) > 0 )
        {
            do {
                UtlHashMap record;
                UtlString* identityValue =
                    new UtlString ( cursor->identity );
                UtlString* contactValue =
                    new UtlString ( cursor->contact );

                // Memory Leak fixes, make shallow copies of static keys
                UtlString* identityKey = new UtlString( gIdentityKey );
                UtlString* contactKey = new UtlString( gContactKey );

                record.insertKeyAndValue (
                    identityKey, identityValue );
                record.insertKeyAndValue (
                    contactKey, contactValue );

                rResultSet.addValue(record);
            } while ( cursor.next() );
        }
        // Commit the rows to memory - multiprocess workaround
        m_pFastDB->detach(0);
    }
}
开发者ID:mranga,项目名称:sipxecs,代码行数:50,代码来源:AliasDB.cpp


示例11: UtlHashMap

void
ResultSet::addValue( const UtlHashMap& record )
{
    UtlHashMap*     pNewRecord = new UtlHashMap() ;
    UtlContainable* pObj ;

    // Proceed with shallow copy
    UtlHashMapIterator itor(const_cast<UtlHashMap&>(record)) ;
    while ((pObj = (UtlContainable*) itor()) != NULL)
    {
        pNewRecord->insertKeyAndValue(itor.key(), itor.value()) ;
    }
    append(pNewRecord) ;
}
开发者ID:mranga,项目名称:sipxecs,代码行数:14,代码来源:ResultSet.cpp


示例12: requestGet

void requestGet(Url& url, UtlSList& names)
{
    XmlRpcRequest* request;
    XmlRpcResponse response;
    
    request = new XmlRpcRequest(url, "configurationParameter.get");
    request->addParam(&DataSet);        

    if (!names.isEmpty())
    {
        request->addParam(&names);
    }
      
    if (!request->execute(response/*, &pSocket*/))
    {
        exitFault(response);
    }
    else
    {
        UtlContainable* value;
        if (response.getResponse(value))
        {
            UtlHashMap* paramList = dynamic_cast<UtlHashMap*>(value);
            if (paramList)
            {
                UtlHashMapIterator params(*paramList);
                UtlString* name;
                while ((name = dynamic_cast<UtlString*>(params())))
                {
                    UtlString* value = dynamic_cast<UtlString*>(paramList->findValue(name));
                    printf("%s : %s\n", name->data(), value->data());
                }
            }
            else
            {
                fprintf(stderr, "Incorrect type returned.\n");
                exit(1);
            }
        }
        else
        {
            fprintf(stderr, "No value returned.\n");
            exit(1);
        }
    }    
    delete request;
    request = NULL;
}
开发者ID:mranga,项目名称:sipxecs,代码行数:48,代码来源:configrpc.cpp


示例13: insertRow

UtlBoolean
DialByNameDB::insertRow ( const UtlHashMap& nvPairs ) const
{
    // Note we do not need the identity object here
    // as it is inferred from the uri
    return insertRow (
        Url( *((UtlString*)nvPairs.findValue(&gNp_contactKey)) ) );
}
开发者ID:mranga,项目名称:sipxecs,代码行数:8,代码来源:DialByNameDB.cpp


示例14: assert

OsStatus 
ResultSet::getIndex(
    const int& index, 
    UtlHashMap& rRecord) const
{
    // The record must be empty.  We can't clear the content because we don't own it.
    assert(rRecord.isEmpty());

    OsStatus result = OS_FAILED;
    UtlHashMap *m;
    if ((m = dynamic_cast<UtlHashMap*>(at(index))))
    {
        m->copyInto(rRecord);
        result = OS_SUCCESS;
    }
    return result;
}
开发者ID:mranga,项目名称:sipxecs,代码行数:17,代码来源:ResultSet.cpp


示例15: UtlString

void 
PermissionDB::getIdentities (
    const UtlString& permission,
    ResultSet& rResultSet ) const
{
    // This should erase the contents of the existing resultset
    rResultSet.destroyAll();

    if ( !permission.isNull() && (m_pFastDB != NULL) )
    {
        // Thread Local Storage
        m_pFastDB->attach();

        dbQuery query;

        // Primary Key is the uriPermission's identity
        query="permission=", permission;

        // Search to see if we have a Credential Row
        dbCursor< PermissionRow > cursor;

        if ( cursor.select(query) > 0 )
        {
            do {
                UtlHashMap record;
                UtlString* identityValue = 
                    new UtlString ( cursor->identity );
                UtlString* permissionValue = 
                    new UtlString ( cursor->permission );

                // Memory Leak fixes, make shallow copies of static keys
                UtlString* identityKey = new UtlString( gIdentityKey );
                UtlString* permissionKey = new UtlString( gPermissionKey );

                record.insertKeyAndValue ( 
                    identityKey, identityValue );
                record.insertKeyAndValue ( 
                    permissionKey, permissionValue );

                rResultSet.addValue(record);
            } while ( cursor.next() );
        }
        // Commit the rows to memory - multiprocess workaround
        m_pFastDB->detach(0);
    }
}
开发者ID:mranga,项目名称:sipxecs,代码行数:46,代码来源:PermissionDB.cpp


示例16: i

void UtlHashMap::copyInto(UtlHashMap& into) const
{
    UtlHashMapIterator i(*this);
    while (i() != NULL)
    {
       into.insertKeyAndValue(i.key(), i.value());
    }
}
开发者ID:mranga,项目名称:sipxecs,代码行数:8,代码来源:UtlHashMap.cpp


示例17: strtoll

void
RegistrationDB::insertRow(const UtlHashMap& nvPairs)
{
    // For integer values, default to 0 if the datum is missing in the input.

    UtlString* expStr = (UtlString*) nvPairs.findValue(&gExpiresKey);
    UtlString* cseqStr = (UtlString*) nvPairs.findValue(&gCseqKey);

    // If the IMDB does not specify a Q-Value, "%" will be found here
    // (representing a null IMDB column).
    UtlString* qvalue = (UtlString*) nvPairs.findValue(&gQvalueKey);

    UtlString* updateNumberStr = (UtlString*) nvPairs.findValue(&gUpdateNumberKey);
    // Note that updateNumberStr is likely to start with 0x, so we
    // need the full functionality of strtoll here, not just a
    // decimal-to-binary conversion.  But strtoll is in C99, so it
    // should be OK.
    Int64 updateNumber = 
       updateNumberStr ? strtoll(updateNumberStr->data(), NULL, 0) : 0;

    // Get the remaining fields so that we can substitute the null string
    // if the fetched value is 0 (the null pointer) because the field
    // is not present in the disk file.
    UtlString* contact = (UtlString*) nvPairs.findValue(&gContactKey);
    UtlString* callId = (UtlString*) nvPairs.findValue(&gCallidKey);
    UtlString* instanceId = (UtlString*) nvPairs.findValue(&gInstanceIdKey);
    UtlString* gruu = (UtlString*) nvPairs.findValue(&gGruuKey);
    UtlString* path = (UtlString*) nvPairs.findValue(&gPathKey);
    UtlString* primary = (UtlString*) nvPairs.findValue(&gPrimaryKey);

    // Note: identity inferred from the uri
    updateBinding(
       Url(*((UtlString*)nvPairs.findValue(&gUriKey))),
       contact ? *contact : nullString,
       qvalue ? *qvalue : percent,
       callId ? *callId : nullString,
       cseqStr ? atoi(cseqStr->data()) : 0,
       expStr ? atoi(expStr->data()) : 0,
       instanceId ? *instanceId : nullString,
       gruu ? *gruu : nullString,
       path ? *path : nullString,
       primary ? *primary : nullString,
       updateNumber
       );
}
开发者ID:mranga,项目名称:sipxecs,代码行数:45,代码来源:RegistrationDB.cpp


示例18: getProcessStateAll

// Fill in a map of process names and states (as UtlStrings)
void SipxProcessManager::getProcessStateAll(UtlHashMap& processStates //< key->name, value->state string
                         )
{
   processStates.destroyAll();
   SipxProcess* process;

   // the lock is not required with the Iterator
   UtlHashBagIterator processes(mProcesses);
   while ((process = dynamic_cast<SipxProcess*>(processes())))
   {
      if ( 0 != process->compareTo(SUPERVISOR_PROCESS_NAME) )
      {
         processStates.insertKeyAndValue(new UtlString(process->data()),
                                      new UtlString(process->GetCurrentState()->name())
                                      );
      }
   }
}
开发者ID:ATHLSolutions,项目名称:sipxecs,代码行数:19,代码来源:SipxProcessManager.cpp


示例19: lock

void SipPublishContentMgr::publishDefault(const char* eventTypeKey,
                                          const char* eventType,
                                          SipPublishContentMgrDefaultConstructor*
                                          defaultConstructor,
                                          UtlBoolean fullState)
{
    Os::Logger::instance().log(FAC_SIP, PRI_DEBUG,
                  "SipPublishContentMgr::publishDefault eventTypeKey '%s', eventType '%s', fullState %d, defaultConstructor %p",
                  eventTypeKey, eventType, fullState, defaultConstructor);

    // Construct the key to look up.
    UtlString key;
    key.append(CONTENT_KEY_SEPARATOR);
    key.append(eventTypeKey);

    lock();

    // Determine the storage we will be using.
    UtlHashMap* pContent;

    if (fullState)
    {
       pContent = &mDefaultContentConstructors;
    }
    else
    {
       pContent = &mDefaultPartialContentConstructors;
    }

    // Remove any old value first.
    pContent->destroy(&key);

    // Add the default constructor.
    if (defaultConstructor)
    {
       UtlString* key_heap = new UtlString(key);
       pContent->insertKeyAndValue(key_heap, defaultConstructor);
    }

    // Do not call the observer for the content change since this is default
    // content.

    unlock();
}
开发者ID:ATHLSolutions,项目名称:sipxecs,代码行数:44,代码来源:SipPublishContentMgr.cpp


示例20: insertRow

UtlBoolean
UserForwardDB::insertRow (const UtlHashMap& nvPairs) 
{
    // Note we do not need the identity object here
    // as it is inferred from the uri
    UtlString identity, cfwdtime;
    identity = *(dynamic_cast <UtlString*> (nvPairs.findValue(&gIdentityKey)));
    cfwdtime = *(dynamic_cast <UtlString*> (nvPairs.findValue(&gCfwdtimeKey)));
    return insertRow ( Url( identity ), cfwdtime );
}
开发者ID:LordGaav,项目名称:sipxecs,代码行数:10,代码来源:UserForwardDB.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ WeakPtr类代码示例发布时间:2022-06-01
下一篇:
C++ Singleton类代码示例发布时间:2022-06-01
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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