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

C++ UtlContainable类代码示例

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

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



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

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


示例2: take

// Find the first occurrence of the designated object by equality.
UtlContainable* UtlSList::find(const UtlContainable* containableToMatch) const
{
   UtlLink* listNode;
   UtlContainable* matchElement = NULL;
   UtlContainable* visitNode;

   unsigned targetHash = containableToMatch->hash();

   OsLock take(mContainerLock);

   LIST_SANITY_CHECK;
   for(listNode = head()->findNextHash(targetHash);
       listNode &&  matchElement == NULL;
       listNode = listNode->next()->findNextHash(targetHash)
       )
   {
      visitNode = (UtlContainable*) listNode->data;
      if(visitNode && visitNode->compareTo(containableToMatch) == 0)
      {
         matchElement = visitNode;
      }
   }
   LIST_SANITY_CHECK;

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


示例3: deleteAttrElements

void ProvisioningAttrList::deleteAttrElements(UtlContainable* pAttrElements)
{
   UtlString*         pMemberName;
   UtlContainable*    pMemberValue;

   if (UtlString(pAttrElements->getContainableType()) == "UtlHashMap") {
      UtlHashMapIterator structureIterator(*dynamic_cast<UtlHashMap*>(pAttrElements));
      while ((pMemberName = dynamic_cast<UtlString*>(structureIterator())) != NULL) {
         pMemberValue = dynamic_cast<UtlHashMap*>(pAttrElements)->findValue(pMemberName);
         if (UtlString(pMemberValue->getContainableType()) == "UtlHashMap"
             || UtlString(pMemberValue->getContainableType()) == "UtlSList") {
            deleteAttrElements(pMemberValue);
         }

         delete pMemberName;
         delete pMemberValue;
      }
   }
   else if (UtlString(pAttrElements->getContainableType()) == "UtlSList") {
      UtlSListIterator arrayIterator(*dynamic_cast<UtlSList*>(pAttrElements));
      while ((pMemberValue = arrayIterator()) != NULL) {
         if (UtlString(pMemberValue->getContainableType()) == "UtlHashMap"
             || UtlString(pMemberValue->getContainableType()) == "UtlSList") {
            deleteAttrElements(pMemberValue);
         }

         delete pMemberValue;
      }
   }
}
开发者ID:Konnekt,项目名称:lib-sipx,代码行数:30,代码来源:ProvisioningAttrList.cpp


示例4: findNode

// Return the first UtlLink node to find.
UtlLink* UtlSortedList::findNode(UtlLink* start, MatchType match, const UtlContainable* obj) const
{
   UtlLink*        listNode;
   UtlLink*        foundNode;
   UtlContainable* listElement;
   int             comparison = 0;
   
   // the caller already holds the mContainerLock

   for (listNode = start, foundNode = NULL;
        !foundNode && listNode;
        listNode = listNode->next()
        )
   {
      listElement = (UtlContainable*)listNode->data;
      if (listElement)
      {
         // we can't use the hash as a shortcut here because we need the order too
         comparison = listElement->compareTo(obj);
         if ( comparison >= 0 )
         {
            foundNode = listNode;
         }
      }
   }

   if (foundNode && match == EXACTLY && comparison != 0) // match not exact
   {
      foundNode = NULL; 
   }
   return foundNode;
}
开发者ID:Jaroslav23,项目名称:sipxtapi,代码行数:33,代码来源:UtlSortedList.cpp


示例5: validateAttribute

void ProvisioningAttrList::validateAttribute(const char* pKey, eAttributeType type, bool ignoreMissing)
{
   UtlContainable* attribute;
   UtlString utlKey(pKey);

   attribute = dynamic_cast<const UtlHashMap*>(mpData)->findValue(&utlKey);
   if (attribute == NULL) {
      if (ignoreMissing) {
         // If it is missing, just return
         return;
      }
      else {
         UtlString errorText("Missing attribute: '");
         errorText += pKey;
         errorText += "'";
         throw errorText;
      }
   }

   switch (type) {
      case ProvisioningAttrList::INT:
         if (UtlString(attribute->getContainableType()) != "UtlInt") {
            UtlString errorText("Attribute '");
            errorText += pKey;
            errorText += "' must be of type: INT";
            throw errorText;
         }
         break;
      case ProvisioningAttrList::BOOL:
         if (UtlString(attribute->getContainableType()) != "UtlBool") {
            UtlString errorText("Attribute: '");
            errorText += pKey;
            errorText += "' must be of type: BOOL";
            throw errorText;
         }
         break;
      case ProvisioningAttrList::STRING:
         if (UtlString(attribute->getContainableType()) != "UtlString") {
            UtlString errorText("Attribute: '");
            errorText += pKey;
            errorText += "' must be of type: STRING";
            throw errorText;
         }
         break;
   }
}
开发者ID:Konnekt,项目名称:lib-sipx,代码行数:46,代码来源:ProvisioningAttrList.cpp


示例6: dumpList

// Dump the contents of a list of RegistrationBinding's.
void dumpList(const UtlSList& list)
{
   fprintf(stderr, "=== start\n");
   UtlSListIterator list_iter(list);
   RegistrationBinding* item;
   int item_no = 0;
   while ((item = dynamic_cast <RegistrationBinding*> (list_iter())))
   {
      fprintf(stderr, "--- item %d\n", item_no);
      UtlHashMap contents;
      item->copy(contents);
      UtlHashMapIterator iter(contents);
      UtlString* name;
      while ((name = dynamic_cast <UtlString*> (iter())))
      {
         UtlContainable* value = iter.value();
         UtlContainableType type = value->getContainableType();
         if (type == UtlString::TYPE)
         {
            fprintf(stderr, "%s = '%s'\n",
                    name->data(),
                    (dynamic_cast <UtlString*> (iter.value()))->data());
         }
         else if (type == UtlLongLongInt::TYPE)
         {
            Int64 value =
               (dynamic_cast <UtlLongLongInt*> (iter.value()))->getValue();
            fprintf(stderr, "%s = 0x%" FORMAT_INTLL "x = %" FORMAT_INTLL "d\n",
                    name->data(), value, value);
         }
         else if (type == UtlInt::TYPE)
         {
            fprintf(stderr, "%s = %" PRIdPTR "\n",
                    name->data(),
                    (dynamic_cast <UtlInt*> (iter.value()))->getValue());
         }
         else
         {
            fprintf(stderr, "%s has unknown type %s\n",
                    name->data(), type);
         }                  
      }
      item_no++;
   }
   fprintf(stderr, "=== end\n");
}
开发者ID:chemeris,项目名称:sipxecs,代码行数:47,代码来源:ApplyUpdatesTest.cpp


示例7: utlKey

bool ProvisioningAttrList::getAttribute(const char* pKey, bool& rValue)
{
   UtlString utlKey(pKey);
   UtlContainable* results;

   results = dynamic_cast<const UtlHashMap*>(mpData)->findValue(&utlKey);
   if (results == NULL) {
      return false;
   }

   if (UtlString(results->getContainableType()) != "UtlBool") {
      return false;
   }

   rValue = dynamic_cast<UtlBool*>(results)->getValue();

   return true;
}
开发者ID:Konnekt,项目名称:lib-sipx,代码行数:18,代码来源:ProvisioningAttrList.cpp


示例8: requestAttributes

bool ProvisioningAgentXmlRpcAction::execute(const HttpRequestContext&      rContext,
                                            UtlSList&                      rParameters,
                                            void*                          pProvisioningAgentInstance,
                                            XmlRpcResponse&                rResponse,
                                            XmlRpcMethod::ExecutionStatus& rStatus)
{
   rStatus = XmlRpcMethod::OK;

   // Extract the request argument structure from the head of the SList.
   UtlContainable *pRequestArgs = rParameters.at(0);

   // Verify that a parameter list was given
   if (pRequestArgs != NULL) {
      // Verify that the parameter list is a structure ("UtlHashMap").
      if (UtlString(pRequestArgs->getContainableType()) == "UtlHashMap") {
         // Now call the Provisioning Agent.
         ProvisioningAttrList requestAttributes(dynamic_cast<UtlHashMap*>(pRequestArgs));
         ProvisioningAttrList* pResponseAttributes;
         pResponseAttributes = ((ProvisioningAgent*)pProvisioningAgentInstance)->Action(requestAttributes);

         if (pResponseAttributes == NULL) {
            // Method failure.  Report error back to client
            rResponse.setFault(METHOD_DISPATCH_FAULT_CODE, METHOD_DISPATCH_FAULT_STRING);
         }
         else {
            // Encode the response
            rResponse.setResponse(dynamic_cast<UtlContainable*>(pResponseAttributes->getData()));

            // and clean up the responsettributes list.
            delete pResponseAttributes;
         }
      }
      else {
         // Missing parameter list.  Report error back to client
         rResponse.setFault(EXPECTED_STRUCT_FAULT_CODE, EXPECTED_STRUCT_FAULT_STRING);
      }
   }
   else {
      // Bad parameter list.  Report error back to client
      rResponse.setFault(EXPECTED_STRUCT_FAULT_CODE, EXPECTED_STRUCT_FAULT_STRING);
   }

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


示例9: take

// Return the number of occurrences of the designated object.
size_t UtlSortedList::occurrencesOf(const UtlContainable* containableToMatch) const 
{
   int count = 0;
   UtlLink* listNode;
   UtlContainable* visitNode = NULL;
   int             comparison;

   OsLock take(const_cast<OsBSem&>(mContainerLock));
   
   for (listNode = head(), comparison = 0;
        comparison <= 0 && listNode;
        listNode = listNode->next()
        )
   {
      visitNode = (UtlContainable*)listNode->data;
      if(visitNode && visitNode->compareTo(containableToMatch) == 0)
      {
         count++;
      }
   }

   return(count);
}
开发者ID:Jaroslav23,项目名称:sipxtapi,代码行数:24,代码来源:UtlSortedList.cpp


示例10: execute

bool AddExtension::execute(const HttpRequestContext& requestContext,
                           UtlSList& params,
                           void* userData,
                           XmlRpcResponse& response,
                           XmlRpcMethod::ExecutionStatus& status)
{
   bool result = false;
   
   int totalParams = params.entries();
   if (totalParams > 2)
   {
      response.setFault(TOO_MANY_PARAMS_FAULT_CODE, TOO_MANY_PARAMS_FAULT_STRING);
      result = false;
   }
   else
   {
      UtlString groupName;
      UtlString extension;
      for (int index = 0; index < totalParams; index++)
      {
               
         UtlContainable *value = params.at(index);
         if (index == 0 || index == 1)
         {
            UtlString paramType(value->getContainableType());
            if (paramType.compareTo("UtlString") == 0)
            {
               if (index == 0)
               {
                  groupName = *((UtlString *)value);
               }
               else
               {
                  extension = *((UtlString *)value);
               }
               
               result = true;
            }
            else
            {
               response.setFault(ILLEGAL_PARAM_FAULT_CODE, ILLEGAL_PARAM_FAULT_STRING);
               result = false;
            }  
         }
      }
      
      if (result)
      {
         SipDialogMonitor* dialogMonitor = (SipDialogMonitor *) userData;
         
         Url extensionUrl(extension);
             
         dialogMonitor->addExtension(groupName, extensionUrl);
         
         status = XmlRpcMethod::OK;
         
         // Construct the response
         UtlString responseText("method call \"addExtension\" successful");
         response.setResponse(&responseText);
      }
   }
   
   return true;
}
开发者ID:mranga,项目名称:sipxecs,代码行数:64,代码来源:dmConfig.cpp


示例11: pingRequest

OsStatus SipRedirectorPresenceRouting::pingOpenfire( void )
{
    OsStatus rc = OS_FAILED;
    UtlString presenceMonitorUrlAsString = mLocalPresenceMonitorServerUrl.toString();
    XmlRpcRequest pingRequest( mOpenFirePresenceServerUrl, PING_METHOD );
    pingRequest.addParam( &mLogName );
    XmlRpcResponse pingResponse;
    if( pingRequest.execute( pingResponse ) == true )
    {
       UtlContainable* pValue = NULL;
       if ( !pingResponse.getResponse( pValue ) || !pValue )
       {
          OsSysLog::add(FAC_NAT, PRI_CRIT, "SipRedirectorPresenceRouting::pingOpenfire response had no result.");
       }
       else
       {
          UtlString keyName;
          UtlHashMap* pMap = dynamic_cast<UtlHashMap*>( pValue );
          if ( !pMap )
          {
             OsSysLog::add(FAC_NAT, PRI_ERR,
                           "SipRedirectorPresenceRouting::pingOpenfire response result had unexpected type: %s",
                           pValue->getContainableType() );
          }
          else
          {
             // extract status code and check it.
             keyName = STATUS_CODE;
             UtlString* pStatusCode = dynamic_cast<UtlString*>( pMap->findValue( &keyName ) );
             if( pStatusCode->compareTo( STATUS_CODE_VALUE_OK, UtlString::ignoreCase ) == 0 )
             {
                keyName = INSTANCE_HANDLE;
                UtlString* pInstanceHandle = dynamic_cast<UtlString*>( pMap->findValue( &keyName ) );
                if( pInstanceHandle )
                {
                   if( mOpenfireInstanceHandle.compareTo( NIL_INSTANCE_HANDLE_VALUE ) == 0 )
                   {
                      // This is the first instance handle we get from openfire, save it
                      mOpenfireInstanceHandle = *pInstanceHandle;
                      rc = OS_SUCCESS;
                   }
                   else
                   {
                      // check if the openfire handle we received matches the one we have on record
                      if( mOpenfireInstanceHandle.compareTo( *pInstanceHandle ) == 0 )
                      {
                         // there is a match; everything is fine.
                         rc = OS_SUCCESS;
                      }
                      else
                      {
                         // mistmatch - likely caused by openfire resetting behind our back.
                         // fail the ping to cause a re-register with openfire
                         mOpenfireInstanceHandle = *pInstanceHandle;
                         rc = OS_FAILED; // rc already set to OS_FAILED; added for readability
                      }
                   }
                }
             }
          }
       }
    }
    return rc;
}
开发者ID:astubbs,项目名称:sipxecs,代码行数:64,代码来源:SipRedirectorPresenceRouting.cpp


示例12: registerPresenceMonitorRequest

OsStatus SipRedirectorPresenceRouting::registerPresenceMonitorServerWithOpenfire( void )
{
    OsStatus rc = OS_FAILED;
    UtlString presenceMonitorUrlAsString = mLocalPresenceMonitorServerUrl.toString();

    XmlRpcRequest registerPresenceMonitorRequest( mOpenFirePresenceServerUrl, REGISTER_PRESENCE_MONITOR_METHOD );
    UtlString protocol = XML_RPC_PROTOCOL;
    registerPresenceMonitorRequest.addParam( &protocol );
    registerPresenceMonitorRequest.addParam( &presenceMonitorUrlAsString );
    XmlRpcResponse registerPresenceMonitorResponse;
    if( registerPresenceMonitorRequest.execute( registerPresenceMonitorResponse ) == true )
    {
       UtlContainable* pValue = NULL;
       if ( !registerPresenceMonitorResponse.getResponse( pValue ) || !pValue )
       {
          OsSysLog::add(FAC_NAT, PRI_ERR, "SipRedirectorPresenceRouting::registerPresenceMonitorRequestWithOpenfire response had no result.");
       }
       else
       {
          UtlString keyName;
          UtlHashMap* pMap = dynamic_cast<UtlHashMap*>( pValue );
          if ( !pMap )
          {
             OsSysLog::add(FAC_NAT, PRI_ERR,
                           "SipRedirectorPresenceRouting::registerPresenceMonitorRequestWithOpenfire response result had unexpected type: %s",
                           pValue->getContainableType() );
          }
          else
          {
             // extract status code and check it.
             keyName = STATUS_CODE;
             UtlString* pStatusCode = dynamic_cast<UtlString*>( pMap->findValue( &keyName ) );
             if( pStatusCode->compareTo( STATUS_CODE_VALUE_OK, UtlString::ignoreCase ) != 0 )
             {
                // status-code is not "OK", some error happened - extract error information.
                keyName = ERROR_CODE;
                UtlString* pErrorCode = dynamic_cast<UtlString*>( pMap->findValue( &keyName ) );
                keyName = ERROR_INFO;
                UtlString* pErrorInfo = dynamic_cast<UtlString*>( pMap->findValue( &keyName ) );
                if( pErrorCode && pErrorInfo )
                {
                   OsSysLog::add(FAC_NAT, PRI_ERR, "SipRedirectorPresenceRouting::registerPresenceMonitorRequestWithOpenfire request failed: %s:'%s'", pErrorCode->data(), pErrorInfo->data() );
                }
             }
             else
             {
                keyName = INSTANCE_HANDLE;
                UtlString* pInstanceHandle = dynamic_cast<UtlString*>( pMap->findValue( &keyName ) );
                if( pInstanceHandle )
                {
                   // set openfire instance value 
                   mOpenfireInstanceHandle = *pInstanceHandle;
                }
                rc = OS_SUCCESS;
             }
          }
       }
    }
    else
    {
       // Check if the request failed because of a failed connection.
       // That error can sometimes happen when the server closed the TCP
       // connection we were using to communicate to it and can usually

        // be recovered by sending the request again.  Try to send the
        // request once more to see if it will fly this time.
        int faultCode;
        UtlString faultString;
        registerPresenceMonitorResponse.getFault( &faultCode, faultString );
        OsSysLog::add( FAC_NAT, PRI_ERR,
                       "SipRedirectorPresenceRouting::registerPresenceMonitorRequestWithOpenfire failed to execute() request: %d : %s",
                       faultCode, faultString.data() );
    }
    return rc;
}
开发者ID:astubbs,项目名称:sipxecs,代码行数:75,代码来源:SipRedirectorPresenceRouting.cpp


示例13: mComponent

// Constructor
SipPersistentSubscriptionMgr::SipPersistentSubscriptionMgr(
   const UtlString& component,
   const UtlString& domain,
   const UtlString& fileName) :
   mComponent(component),
   mDomain(domain),
   mSubscriptionDBInstance(SubscriptionDB::getInstance(fileName)),
   mPersistenceTimer(mPersistTask.getMessageQueue(), 0),
   mPersistTask(mSubscriptionDBInstance)
{
   OsSysLog::add(FAC_SIP, PRI_DEBUG,
                 "SipPersistentSubscriptionMgr:: "
                 "mComponent = '%s', mDomain = '%s', fileName = '%s'",
                 mComponent.data(), mDomain.data(), fileName.data());

   // Start the persist task.
   mPersistTask.start();

   // Read the subscription table and initialize the SipSubscriptionMgr.

   unsigned long now = OsDateTime::getSecsSinceEpoch();
   ResultSet rs;
   mSubscriptionDBInstance->getAllRows(rs);
   UtlSListIterator itor(rs);
   UtlHashMap* rowp;
   while ((rowp = dynamic_cast <UtlHashMap*> (itor())))
   {
      if (OsSysLog::willLog(FAC_SIP, PRI_DEBUG))
      {
         UtlString out;
         UtlHashMapIterator itor(*rowp);
         UtlString* key;
         UtlContainable* value;
         while ((key = dynamic_cast <UtlString*> (itor())))
         {
            value = itor.value();
            if (!out.isNull())
            {
               out.append(", ");
            }
            out.append(*key);
            out.append(" = ");
            if (value->getContainableType() == UtlString::TYPE)
            {
               out.append("'");
               out.append(*(dynamic_cast <UtlString*> (value)));
               out.append("'");
            }
            else if (value->getContainableType() == UtlInt::TYPE)
            {
               out.appendNumber((int) (*(dynamic_cast <UtlInt*> (value))));
            }
            else
            {
               out.append(value->getContainableType());
            }
         }
         OsSysLog::add(FAC_SIP, PRI_DEBUG,
                       "SipPersistentSubscriptionMgr:: "
                       "table row: %s",
                       out.data());
      }

      // First, filter for rows that have the right component and have
      // not yet expired.
      UtlString* componentp =
         dynamic_cast <UtlString*> (rowp->findValue(&SubscriptionDB::gComponentKey));
      assert(componentp);
      int expires =
         *(dynamic_cast <UtlInt*> (rowp->findValue(&SubscriptionDB::gExpiresKey)));
      if (componentp->compareTo(mComponent) == 0 &&
          expires - now >= 0)
      {
         OsSysLog::add(FAC_SIP, PRI_DEBUG,
                       "SipPersistentSubscriptionMgr:: "
                       "loading row");

         // Extract the values from the row.
         const UtlString* top =
            dynamic_cast <UtlString*> (rowp->findValue(&SubscriptionDB::gToKey));
         const UtlString* fromp =
            dynamic_cast <UtlString*> (rowp->findValue(&SubscriptionDB::gFromKey));
         const UtlString* callidp =
            dynamic_cast <UtlString*> (rowp->findValue(&SubscriptionDB::gCallidKey));
         const UtlString* eventtypep =
            dynamic_cast <UtlString*> (rowp->findValue(&SubscriptionDB::gEventtypeKey));
         const UtlString* eventidp =
            dynamic_cast <UtlString*> (rowp->findValue(&SubscriptionDB::gIdKey));
         // Correct the null string if it is returned as
         // SPECIAL_IMDB_NULL_VALUE.
         if (eventidp->compareTo(special_imdb_null_value) == 0)
         {
            eventidp = &null_string;
         }
         int subcseq =
            *(dynamic_cast <UtlInt*> (rowp->findValue(&SubscriptionDB::gSubscribecseqKey)));
         const UtlString* urip =
            dynamic_cast <UtlString*> (rowp->findValue(&SubscriptionDB::gUriKey));
         const UtlString* contactp =
//.........这里部分代码省略.........
开发者ID:mranga,项目名称:sipxecs,代码行数:101,代码来源:SipPersistentSubscriptionMgr.cpp


示例14: dumpAttributes

void ProvisioningAttrList::dumpAttributes(const UtlContainable* pAttribute)
{
   static UtlString*  pMemberName;
   UtlContainable*    pMemberValue;

   if (UtlString(pAttribute->getContainableType()) == "UtlHashMap") {
      UtlHashMapIterator structureIterator(*dynamic_cast<const UtlHashMap*>(pAttribute));
      while ((pMemberName = dynamic_cast<UtlString*>(structureIterator())) != NULL) {
         pMemberValue = dynamic_cast<const UtlHashMap*>(pAttribute)->findValue(pMemberName);
         if (UtlString(pMemberValue->getContainableType()) == "UtlHashMap"
             || UtlString(pMemberValue->getContainableType()) == "UtlSList") {
            dumpAttributes(pMemberValue);
         }

         if (UtlString(pMemberValue->getContainableType()) == "UtlBool") {
            osPrintf("{%s} = (BOOL) %s\n",
                   pMemberName->data(),
                   (dynamic_cast<UtlBool*>(pMemberValue)->getValue() ? "TRUE" : "FALSE"));
         }
         else if (UtlString(pMemberValue->getContainableType()) == "UtlInt") {
            osPrintf("{%s} = (INT) %d\n",
                   pMemberName->data(),
                   dynamic_cast<UtlInt*>(pMemberValue)->getValue());
         }
         else if (UtlString(pMemberValue->getContainableType()) == "UtlString") {
            osPrintf("{%s} = (STRING) \"%s\"\n",
                   pMemberName->data(),
                   dynamic_cast<UtlString*>(pMemberValue)->data());
         }
      }
   }
   else if (UtlString(pAttribute->getContainableType()) == "UtlSList") {
      UtlSListIterator arrayIterator(*dynamic_cast<const UtlSList*>(pAttribute));
      int arrayIndex = 0;
      while ((pMemberValue = arrayIterator()) != NULL) {
         if (UtlString(pMemberValue->getContainableType()) == "UtlHashMap"
             || UtlString(pMemberValue->getContainableType()) == "UtlSList") {
            dumpAttributes(pMemberValue);
         }

         if (UtlString(pMemberValue->getContainableType()) == "UtlBool") {
            osPrintf("{%s}[%d] = (BOOL) %s\n",
                   pMemberName->data(),
                   arrayIndex++,
                   (dynamic_cast<UtlBool*>(pMemberValue)->getValue() ? "TRUE" : "FALSE"));
         }
         else if (UtlString(pMemberValue->getContainableType()) == "UtlInt") {
            osPrintf("{%s}[%d] = (INT) %d\n",
                   pMemberName->data(),
                   arrayIndex++,
                   dynamic_cast<UtlInt*>(pMemberValue)->getValue());
         }
         else if (UtlString(pMemberValue->getContainableType()) == "UtlString") {
            osPrintf("{%s}[%d] = (STRING) \"%s\"\n",
                   pMemberName->data(),
                   arrayIndex++,
                   dynamic_cast<UtlString*>(pMemberValue)->data());
         }
      }
   }
}
开发者ID:Konnekt,项目名称:lib-sipx,代码行数:61,代码来源:ProvisioningAttrList.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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