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

C++ UtlSList类代码示例

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

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



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

示例1: takeContainer

UtlContainable* UtlSListIterator::peekAtNext(void)
{
   UtlContainable* match = NULL;

   UtlContainer::acquireIteratorConnectionLock();
   OsLock takeContainer(mContainerRefLock);
   UtlSList* myList = dynamic_cast<UtlSList*>(mpMyContainer);

   if (myList != NULL) // list still valid?
   {
      OsLock take(myList->mContainerLock);
      UtlContainer::releaseIteratorConnectionLock();

      // advance the iterator
      UtlLink* nextLink = (mpCurrentNode == NULL
                           ? myList->head()
                           : mpCurrentNode->next()
                           );
      if( nextLink )
      {
         match = (UtlContainable*)nextLink->data;
      }
   }
   else
   {
      UtlContainer::releaseIteratorConnectionLock();
   }

   return match;
}
开发者ID:ATHLSolutions,项目名称:sipxecs,代码行数:30,代码来源:UtlSListIterator.cpp


示例2: testNoRouteLocal

   void testNoRouteLocal()
      {
         const char* message =
            "INVITE sip:[email protected] SIP/2.0\r\n"
            "Via: SIP/2.0/TCP 10.1.1.3:33855\r\n"
            "To: sip:[email protected]\r\n"
            "From: Caller <sip:[email protected]>; tag=30543f3483e1cb11ecb40866edd3295b\r\n"
            "Call-Id: f88dfabce84b6a2787ef024a7dbe8749\r\n"
            "Cseq: 1 INVITE\r\n"
            "Max-Forwards: 20\r\n"
            "Contact: [email protected]\r\n"
            "Content-Length: 0\r\n"
            "\r\n";

         SipMessage testMsg(message, strlen(message));
         Url requestUri;
         UtlSList removedRoutes;
         
         testMsg.normalizeProxyRoutes(UserAgent, requestUri, &removedRoutes);

         UtlString normalizedMsg;
         int msgLen;
         testMsg.getBytes(&normalizedMsg, &msgLen);

         ASSERT_STR_EQUAL(message, normalizedMsg.data());

         UtlString requestUriResult;
         requestUri.toString(requestUriResult);
         
         ASSERT_STR_EQUAL("sip:[email protected]", requestUriResult.data());

         CPPUNIT_ASSERT(removedRoutes.isEmpty());
      }
开发者ID:John-Chan,项目名称:sipXtapi,代码行数:33,代码来源:SipProxyMessageTest.cpp


示例3: key

OsStatus CpNotificationRegister::unsubscribe(CP_NOTIFICATION_TYPE notificationType,
                                             const SipDialog& callbackSipDialog)
{
   OsStatus result = OS_FAILED;

   UtlInt key((int)notificationType);
   UtlSList* pDialogList = dynamic_cast<UtlSList*>(m_register.findValue(&key));
   if (!pDialogList)
   {
      return OS_SUCCESS;
   }

   if (pDialogList)
   {
      UtlSListIterator itor(*pDialogList);

      while (itor())
      {
         SipDialog* pSipDialog = dynamic_cast<SipDialog*>(itor.item());
         if (pSipDialog && pSipDialog->compareDialogs(callbackSipDialog) != SipDialog::DIALOG_MISMATCH)
         {
            pDialogList->destroy(pSipDialog);
         }
      }

      result = OS_SUCCESS;
   }

   return result;
}
开发者ID:Jaroslav23,项目名称:sipxtapi,代码行数:30,代码来源:CpNotificationRegister.cpp


示例4: testUpdateExistingBinding

   void testUpdateExistingBinding()
      {
         UtlSList bindings;
         RegistrationBinding* binding;

         RegistrationDbTestContext testDbContext(TEST_DATA_DIR "/regdbdata",
                                                 TEST_WORK_DIR "/regdbdata"
                                                 );

         testDbContext.inputFile("updateBindings.xml");

         RegistrationDB* regDb = RegistrationDB::getInstance();

         // Get an existing binding
         Int64 seqOneUpdates = regDb->getNewUpdatesForRegistrar("seqOne", 2, bindings);
         CPPUNIT_ASSERT_EQUAL(1LL, seqOneUpdates);

         binding = (RegistrationBinding*)bindings.first();

         // Increment the CSeq number
         int newCseq = binding->getCseq() + 1;
         binding->setCseq(newCseq);
         regDb->updateBinding(*binding);
         binding->setCseq(0);

         // Get the same binding
         bindings.destroyAll();
         seqOneUpdates = regDb->getNewUpdatesForRegistrar("seqOne", 2, bindings);
         CPPUNIT_ASSERT_EQUAL(1LL, seqOneUpdates);

         // Test if the new CSeq number got updated
         binding = (RegistrationBinding*)bindings.first();
         CPPUNIT_ASSERT_EQUAL(newCseq, binding->getCseq());
      }
开发者ID:LordGaav,项目名称:sipxecs,代码行数:34,代码来源:RegistryDbTest.cpp


示例5: UtlString

void
RegistrationDB::getUnexpiredContactsFieldsContaining (
   UtlString& substringToMatch,
   const int& timeNow,   
   UtlSList& matchingContactFields ) const
{
   // Clear the results
   matchingContactFields.destroyAll();
   if( m_pFastDB != NULL )
   {
       SMART_DB_ACCESS;
       dbCursor< RegistrationRow > cursor;
       UtlString queryString = "contact like '%" + substringToMatch + "%' and expires>";
       queryString.appendNumber( timeNow );
       dbQuery query;
       query = queryString;

       if ( cursor.select(query) > 0 )
       {
           // Copy all the unexpired contacts into the result list
           do
           {
               UtlString* contactValue = new UtlString(cursor->contact);
               matchingContactFields.append( contactValue );
           } while ( cursor.next() );
       }
   }
   else
   {
      OsSysLog::add(FAC_DB, PRI_CRIT, "RegistrationDB::getUnexpiredContactsFieldsContaining failed - no DB");
   }
}
开发者ID:mranga,项目名称:sipxecs,代码行数:32,代码来源:RegistrationDB.cpp


示例6: takeContainer

// Find the next like-instance of the designated object .
UtlContainable* UtlSListIterator::findNext(const UtlContainable* containableToMatch) 
{
   UtlContainable* match = NULL;

   UtlContainer::acquireIteratorConnectionLock();
   OsLock takeContainer(mContainerRefLock);
   UtlSList* myList = static_cast<UtlSList*>(mpMyContainer);
   
   OsLock take(myList->mContainerLock);
   UtlContainer::releaseIteratorConnectionLock();

   // advance the iterator
   UtlLink* nextLink = (mpCurrentNode == NULL
                        ? myList->head()
                        : mpCurrentNode->next()
                        );

   // search for the next match forward
   while (nextLink && !match)
   {
      UtlContainable *candidate = (UtlContainable*)nextLink->data;
      if (candidate && candidate->compareTo(containableToMatch) == 0)
      {
         mpCurrentNode = nextLink;
         match = candidate;
      }
      else
      {
         nextLink = nextLink->next();
      }
   }
   
   return match;
}
开发者ID:John-Chan,项目名称:sipXtapi,代码行数:35,代码来源:UtlSListIterator.cpp


示例7: testUpdateExistingUriNewContact

   void testUpdateExistingUriNewContact()
      {
         UtlSList bindings;
         RegistrationBinding* binding;

         RegistrationDbTestContext testDbContext(TEST_DATA_DIR "/regdbdata",
                                                 TEST_WORK_DIR "/regdbdata"
                                                 );

         testDbContext.inputFile("updateBindings.xml");

         RegistrationDB* regDb = RegistrationDB::getInstance();

         // Get an existing binding
         Int64 seqOneUpdates = regDb->getNewUpdatesForRegistrar("seqOne", 2, bindings);
         CPPUNIT_ASSERT_EQUAL(1LL, seqOneUpdates);

         binding = (RegistrationBinding*)bindings.first();

         // Change the contact address
         const UtlString* oldContact = binding->getContact();
         UtlString newContact(*oldContact);
         newContact.replace('2', '3');
         binding->setContact(newContact);
         regDb->updateBinding(*binding);

         // We should have 2 bindings now
         bindings.destroyAll();
         seqOneUpdates = regDb->getNewUpdatesForRegistrar("seqOne", 2, bindings);
         CPPUNIT_ASSERT_EQUAL(2LL, seqOneUpdates);
      }
开发者ID:LordGaav,项目名称:sipxecs,代码行数:31,代码来源:RegistryDbTest.cpp


示例8: testUpdateSameBinding

   void testUpdateSameBinding()
      {
         UtlSList bindings;
         RegistrationBinding* binding;

         RegistrationDbTestContext testDbContext(TEST_DATA_DIR "/regdbdata",
                                                 TEST_WORK_DIR "/regdbdata"
                                                 );

         testDbContext.inputFile("updateBindings.xml");

         RegistrationDB* regDb = RegistrationDB::getInstance();

         // Get an existing binding
         Int64 seqOneUpdates = regDb->getNewUpdatesForRegistrar("seqOne", 2, bindings);
         CPPUNIT_ASSERT_EQUAL(1LL, seqOneUpdates);

         binding = (RegistrationBinding*)bindings.first();

         // Call updateBinding with the same binding
         regDb->updateBinding(*binding);

         // Get it back and make sure we still only have one
         bindings.destroyAll();
         seqOneUpdates = regDb->getNewUpdatesForRegistrar("seqOne", 2, bindings);
         CPPUNIT_ASSERT_EQUAL(1LL, seqOneUpdates);
      }
开发者ID:LordGaav,项目名称:sipxecs,代码行数:27,代码来源:RegistryDbTest.cpp


示例9: 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


示例10: testFindNext

    /*!a Test case for the findNext() method
    *
    *    The test data for this test case are :-
    *      a) When the match is the first element.
    *      b) When the match is the last element.
    *      c) When the match is a mid element(unique).
    *      d) When the match has two value matches (but a single ref match)
    *      e) When the match has two ref matches.
    *      f) When there is no match at all!
    *      g) When the match is after the current find.
    */
    void testFindNext()
    {
        struct TestFindNextStruct
        {
            const char* testDescription ;
            const UtlContainable* searchValue ;
            const UtlContainable* expectedValue ;
        } ;
        const char* prefix = "Test the find() method when the match " ;

        UtlString noExist("This cannot and should not exist!!!") ;
        TestFindNextStruct testData[] = { \
            { "is the first element ", commonContainables[0], commonContainables[0] }, \
            { "is the last element ", commonContainables[5], commonContainables[5] }, \
            { "is a mid element (unique match) ", commonContainables[2], \
              commonContainables[2] }, \
            { "has two value matches but a single ref match ", commonContainables[4], \
              commonContainables_Clone[4] }, \
            { "has two ref matches", commonContainables[3], commonContainables[3] }, \
            { "has a value match but no ref match", commonContainables_Clone[1], \
              commonContainables[1] }, \
            { "has no match at all", &noExist, NULL } \
        } ;
       // insert a clone of the 4th element to the 1st position
       commonList.insertAt(1, (UtlContainable*)commonContainables_Clone[4]) ;
       // The new index for a value match of commonContainables[4] must be 1.

       // insert another copy of the 3rd element to the 2nd position.
       commonList.insertAt(2, (UtlContainable*)commonContainables[3]) ;
       // The new index for commonContainables[3] must be 2) ;
       // what used to be the second element has now moved to 4.


        const int testCount = sizeof(testData)/sizeof(testData[0])  ;
        UtlSListIterator iter(commonList) ;
        for (int i = 0 ; i < testCount ; i++)
        {
            string msg ;

            const UtlContainable* actualValue = iter.findNext(testData[i].searchValue) ;
            TestUtilities::createMessage(2, &msg, prefix, testData[i].testDescription) ;
            CPPUNIT_ASSERT_EQUAL_MESSAGE(msg.data(), testData[i].expectedValue, \
                actualValue) ;
            iter.reset() ;
        }

        // Now test the case where the iterator is 'past' the index
        iter.reset() ;
        iter() ;
        iter() ;
        iter() ;
        iter() ;
        iter() ;
        UtlContainable* actualValue = iter.findNext(commonContainables[1]) ;
        CPPUNIT_ASSERT_EQUAL_MESSAGE("test findNext() when the iterator has " \
           "moved past the search index", (void*)NULL, (void*)actualValue) ;
    }//testFindNext
开发者ID:ATHLSolutions,项目名称:sipxecs,代码行数:68,代码来源:UtlSListIteratorTest.cpp


示例11: getCountItems

void getCountItems(UtlSList& list, size_t itemsToPop)
{
   assert(itemsToPop);
   
   for (; !list.isEmpty() && itemsToPop; itemsToPop--)
   {
      delete dynamic_cast<UtlString*>(list.get());
   }
}
开发者ID:Jaroslav23,项目名称:sipxtapi,代码行数:9,代码来源:UtlListPerformance.cpp


示例12: testDoubleRoute

   void testDoubleRoute()
      {
         const char* message =
            "INVITE sip:[email protected] SIP/2.0\r\n"
            "Route: <sip:[email protected];lr>, <sip:[email protected];lr>\r\n"
            "Via: SIP/2.0/TCP 10.1.1.3:33855\r\n"
            "To: sip:[email protected]\r\n"
            "From: Caller <sip:[email protected]>; tag=30543f3483e1cb11ecb40866edd3295b\r\n"
            "Call-Id: f88dfabce84b6a2787ef024a7dbe8749\r\n"
            "Cseq: 1 INVITE\r\n"
            "Max-Forwards: 20\r\n"
            "Contact: [email protected]\r\n"
            "Content-Length: 0\r\n"
            "\r\n";

         SipMessage testMsg(message, strlen(message));
         Url requestUri;
         UtlSList removedRoutes;
         
         testMsg.normalizeProxyRoutes(UserAgent, requestUri, &removedRoutes);

         UtlString normalizedMsg;
         int msgLen;
         testMsg.getBytes(&normalizedMsg, &msgLen);

         const char* expectedMessage = // route header removed, uri swapped
            "INVITE sip:[email protected] SIP/2.0\r\n"
            "Via: SIP/2.0/TCP 10.1.1.3:33855\r\n"
            "To: sip:[email protected]\r\n"
            "From: Caller <sip:[email protected]>; tag=30543f3483e1cb11ecb40866edd3295b\r\n"
            "Call-Id: f88dfabce84b6a2787ef024a7dbe8749\r\n"
            "Cseq: 1 INVITE\r\n"
            "Max-Forwards: 20\r\n"
            "Contact: [email protected]\r\n"
            "Content-Length: 0\r\n"
            "\r\n";

         ASSERT_STR_EQUAL(expectedMessage, normalizedMsg.data());

         UtlString requestUriResult;
         requestUri.toString(requestUriResult);
         
         ASSERT_STR_EQUAL("sip:[email protected]", requestUriResult.data());

         UtlString* removedRoute;

         CPPUNIT_ASSERT( removedRoute = static_cast<UtlString*>(removedRoutes.get()));
         ASSERT_STR_EQUAL("<sip:[email protected];lr>", removedRoute->data());
         delete removedRoute;

         CPPUNIT_ASSERT( removedRoute = static_cast<UtlString*>(removedRoutes.get()));
         ASSERT_STR_EQUAL("<sip:[email protected];lr>", removedRoute->data());
         delete removedRoute;

         CPPUNIT_ASSERT(removedRoutes.isEmpty());

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


示例13: doListOperations

void doListOperations()
{
   UtlSList testList;

   // fill the list
   appendCountItems(testList, NUM_PERFORMANCE_STRINGS);
   
   // take the first half off the front
   if (!testList.isEmpty())
   {
      getCountItems(testList, NUM_PERFORMANCE_STRINGS / 2);
   }

   // take the rest off the end by reference
   if (!testList.isEmpty())
   {
      UtlContainable* lastItem = testList.last();
      delete dynamic_cast<UtlString*>(testList.removeReference(lastItem));
   }

   // fill the list
   appendCountItems(testList, NUM_PERFORMANCE_STRINGS);

   // search the list for each item by value
   UtlString target;
   int targetIndex;
   for (targetIndex = 0; targetIndex < NUM_PERFORMANCE_STRINGS; targetIndex += 1)
   {
      target = string[targetIndex];
      UtlString* found = dynamic_cast<UtlString*>(testList.find(&target));
      if (found)
      {
         externalForSideEffects = found->length();
      }
   }
   
   // get the object in the middle of the list by index, and remove it by value
   while(!testList.isEmpty())
   {
      int numberLeft = testList.entries();
      UtlString* middle = dynamic_cast<UtlString*>(testList.at((numberLeft / 2)));
      delete dynamic_cast<UtlString*>(testList.remove(middle));
   }

   // fill the list
   appendCountItems(testList, NUM_PERFORMANCE_STRINGS);

   // iterate over each item in the list
   UtlSListIterator iterate(testList);
   UtlString* item;
   while ((item = dynamic_cast<UtlString*>(iterate())))
   {
      externalForSideEffects = item->length();
      delete item;
   }
}
开发者ID:Jaroslav23,项目名称:sipxtapi,代码行数:56,代码来源:UtlListPerformance.cpp


示例14: getDigitStrings

UtlBoolean
DialByNameDB::insertRow ( const Url& contact ) const
{
    UtlBoolean result = FALSE;

    if ( m_pFastDB != NULL )
    {
        // Fetch the display name
        UtlString identity, displayName, contactString;
        contact.getIdentity( identity );
        contact.getDisplayName( displayName );
        contact.toString( contactString );

        // Make sure that the contact URL is valid and contains
        // a contactIdentity and a contactDisplayName
        if ( !identity.isNull() && !displayName.isNull() )
        {
            UtlSList dtmfStrings;
            getDigitStrings ( displayName, dtmfStrings );
            if ( !dtmfStrings.isEmpty() )
            {
                // Thread Local Storage
                m_pFastDB->attach();

                // Search for a matching row before deciding to update or insert
                dbCursor< DialByNameRow > cursor(dbCursorForUpdate);

                DialByNameRow row;

                dbQuery query;
                // Primary Key is identity
                query="np_identity=",identity;

                // Purge all existing entries associated with this identity
                if ( cursor.select( query ) > 0 )
                {
                    cursor.removeAllSelected();
                } 

                // insert all dtmf combinations for this user
                unsigned int i;
                for (i=0; i<dtmfStrings.entries(); i++)
                {
                    UtlString* digits = (UtlString*)dtmfStrings.at(i);
                    row.np_contact = contactString;
                    row.np_identity = identity;
                    row.np_digits = digits->data();
                    insert (row);
                }
                // Commit rows to memory - multiprocess workaround
                m_pFastDB->detach(0);
            }
        }
    }
    return result;
}
开发者ID:mranga,项目名称:sipxecs,代码行数:56,代码来源:DialByNameDB.cpp


示例15: removeItem

    /*!a test case for the interaction of remove() and item().
    */
    void removeItem()
    {
       UtlString v1("a");
       UtlString v2("b");
       UtlString v3("c");
       UtlString v4("d");
       UtlContainable* e;

       UtlSList h;
       h.insert(&v1);
       h.insert(&v2);
       h.insert(&v3);
       h.insert(&v4);

       UtlSListIterator iter(h);

       // Check that item() returns NULL in the initial state.
       CPPUNIT_ASSERT(iter.item() == NULL);

       // Step the iterator and check that item() returns v1.
       e = iter();
       CPPUNIT_ASSERT(e == &v1);
       CPPUNIT_ASSERT(iter.item() == &v1);

       // Delete the element and check that item() returns NULL.
       h.remove(e);
       CPPUNIT_ASSERT(iter.item() == NULL);

       // Step the iterator and check that item() returns v2.
       e = iter();
       CPPUNIT_ASSERT(e == &v2);
       CPPUNIT_ASSERT(iter.item() == &v2);

       // Step the iterator and check that item() returns v3.
       e = iter();
       CPPUNIT_ASSERT(e == &v3);
       CPPUNIT_ASSERT(iter.item() == &v3);

       // Delete the element and check that item() returns v2.
       // (Because deleting an element of a list backs the iterator up
       // to the previous element.)
       h.remove(e);
       CPPUNIT_ASSERT(iter.item() == &v2);

       // Step the iterator and check that item() returns v4.
       e = iter();
       CPPUNIT_ASSERT(e == &v4);
       CPPUNIT_ASSERT(iter.item() == &v4);

       // Step the iterator after the last element and check that
       // item() returns NULL.
       e = iter();
       CPPUNIT_ASSERT(e == NULL);
       CPPUNIT_ASSERT(iter.item() == NULL);

    } //removeItem()
开发者ID:ATHLSolutions,项目名称:sipxecs,代码行数:58,代码来源:UtlSListIteratorTest.cpp


示例16: groupKey

OsStatus SmsNotifier::handleAlarm(const OsTime alarmTime,
      const UtlString& callingHost,
      const cAlarmData* alarmData,
      const UtlString& alarmMsg)
{
   OsStatus retval = OS_FAILED;

   //execute the mail command for each user
   UtlString groupKey(alarmData->getGroupName());
   if (!groupKey.isNull())
   {
      UtlContainable* pContact = mContacts.findValue(&groupKey);
      if (pContact)
      {
         // Process the comma separated list of contacts
         UtlString* contactList = dynamic_cast<UtlString*> (pContact);
         if (!contactList->isNull())
         {
            MailMessage message(mSmsStrFrom, mReplyTo, mSmtpServer);
            UtlTokenizer tokenList(*contactList);

            UtlString entry;
            while (tokenList.next(entry, ","))
            {
               message.To(entry, entry);
            }

            UtlString body;
            UtlString tempStr;

            UtlString sevStr = Os::Logger::instance().priorityName(alarmData->getSeverity());
            body.append(alarmMsg);

            Os::Logger::instance().log(FAC_ALARM, PRI_DEBUG, "AlarmServer: sms body is %s", body.data());

            message.Body(body);

            UtlSList subjectParams;
            UtlString codeStr(alarmData->getCode());
            UtlString titleStr(sevStr);
            subjectParams.append(&codeStr);
            subjectParams.append(&titleStr);
            assembleMsg(mSmsStrSubject, subjectParams, tempStr);
            message.Subject(tempStr);

            // delegate send to separate task so as not to block
            EmailSendTask::getInstance()->sendMessage(message);
         }
      }
   }

   return retval;
}
开发者ID:ATHLSolutions,项目名称:sipxecs,代码行数:53,代码来源:SmsNotifier.cpp


示例17: itor

void MpRtpInputAudioConnection::handleStartReceiveRtp(UtlSList& codecList,
                                                      OsSocket& rRtpSocket,
                                                      OsSocket& rRtcpSocket)
{
   m_bAudioReceived = FALSE;
   m_inactiveFrameCount = 0;

   if (codecList.entries() > 0)
   {
      // if RFC2833 DTMF is disabled
      if (!m_bRFC2833DTMFEnabled)
      {
         UtlSListIterator itor(codecList);
         SdpCodec* pCodec = NULL;
         // go through all codecs, if you find telephone event, remove it
         while (itor())
         {
            pCodec = dynamic_cast<SdpCodec*>(itor.item());
            if (pCodec && pCodec->getCodecType() == SdpCodec::SDP_CODEC_TONES)
            {
               codecList.destroy(pCodec);
            }
         }
      }

      // continue only if numCodecs is still greater than 0
      if (codecList.entries() > 0)
      {
         // initialize jitter buffers for all codecs
         mpDejitter->initJitterBuffers(codecList);
         mpDecode->selectCodecs(codecList);
      }
   }
   // No need to synchronize as the decoder is not part of the
   // flowgraph.  It is part of this connection/resource
   //mpFlowGraph->synchronize();
   prepareStartReceiveRtp(rRtpSocket, rRtcpSocket);
   // No need to synchronize as the decoder is not part of the
   // flowgraph.  It is part of this connection/resource
   //mpFlowGraph->synchronize();
   if (codecList.entries() > 0)
   {
      mpDecode->enable();
      if (mpDtmfDetector)
      {
         mpDtmfDetector->enable();
      }
   }

   sendConnectionNotification(MP_NOTIFICATION_START_RTP_RECEIVE, 0);
}
开发者ID:Jaroslav23,项目名称:sipxtapi,代码行数:51,代码来源:MpRtpInputAudioConnection.cpp


示例18: testPeekAtNext

    void testPeekAtNext()
    {
       UtlString v1("a");
       UtlString v2("b");
       UtlString v3("c");
       UtlString v4("d");
       UtlContainable* e;

       UtlSList h;
       h.insert(&v1);
       h.insert(&v2);
       h.insert(&v3);
       h.insert(&v4);

       UtlSListIterator iter(h);

       // check that peekAtNext() returns v1 while iterator points at NULL
       e = iter.peekAtNext();
       CPPUNIT_ASSERT(e == &v1);
       CPPUNIT_ASSERT(iter.item() == NULL );

       // Step the iterator and check that peekAtNext() returns v2
       // while iterator points at v1
       iter();
       e = iter.peekAtNext();
       CPPUNIT_ASSERT(e == &v2);
       CPPUNIT_ASSERT(iter.item() == &v1);

       // Step the iterator and check that peekAtNext() returns v3
       // while iterator points at v2
       iter();
       e = iter.peekAtNext();
       CPPUNIT_ASSERT(e == &v3);
       CPPUNIT_ASSERT(iter.item() == &v2);

       // Step the iterator and check that peekAtNext() returns v4
       // while iterator points at v3
       iter();
       e = iter.peekAtNext();
       CPPUNIT_ASSERT(e == &v4);
       CPPUNIT_ASSERT(iter.item() == &v3);

       // Step the iterator and check that peekAtNext() returns NULL
       // while iterator points at v4
       iter();
       e = iter.peekAtNext();
       CPPUNIT_ASSERT(e == NULL);
       CPPUNIT_ASSERT(iter.item() == &v4);
    }
开发者ID:ATHLSolutions,项目名称:sipxecs,代码行数:49,代码来源:UtlSListIteratorTest.cpp


示例19: cursor

int
RegistrationDB::getUpdatesForRegistrar(dbQuery&  query,
                                       UtlSList& bindings) const
{
   int numRows = 0;
   if ( m_pFastDB != NULL )
   {
      SMART_DB_ACCESS;
      dbCursor<RegistrationRow> cursor(dbCursorForUpdate);
      numRows = cursor.select(query);
      if (numRows > 0)
      {
         do {
            RegistrationBinding* reg = copyRowToRegistrationBinding(cursor);
            bindings.append(reg);
         }
         while (cursor.next());
      }
   }
   else
   {
      OsSysLog::add(FAC_DB, PRI_CRIT, "RegistrationDB::getNewUpdatesForRegistrar failed - no DB");
   }
   return numRows;
}
开发者ID:mranga,项目名称:sipxecs,代码行数:25,代码来源:RegistrationDB.cpp


示例20: resourcesItor

// Generate the partial RLMI list.
// Generate list of ResourceReference's corresponding to the URIs in mResourcesList.
// Returns true if partialList is non-empty.
UtlBoolean ResourceList::genPartialList(UtlSList& partialList)
{
   UtlSListIterator resourcesItor(mResourcesList);
   ResourceReference* resource;
   UtlBoolean any_found = FALSE;

   // Check the resource list for changed items.
   while ((resource = dynamic_cast <ResourceReference*> (resourcesItor())))
   {
      UtlSListIterator changesItor(mChangesList);
      UtlString* changedRsrc;
      UtlBoolean found = FALSE;

      while ((changedRsrc = dynamic_cast <UtlString*> (changesItor())))
      {
         // Send a partial RLMI (only for resources that changed).
         if (strcmp(resource->getUri()->data(), changedRsrc->data()) == 0)
         {
            found = TRUE;
            any_found = TRUE;
         }
      }

      if (found)
      {
         partialList.append(resource);
      }
   }

   return any_found;
}
开发者ID:ClydeFroq,项目名称:sipxecs,代码行数:34,代码来源:ResourceList.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ UtlString类代码示例发布时间:2022-05-31
下一篇:
C++ UtlMemCheck类代码示例发布时间: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