reSIProcate/DialogUsageManager  9694
Public Member Functions | Protected Types | Protected Attributes
resip::RedirectManager::TargetSet Class Reference

#include <RedirectManager.hxx>

Collaboration diagram for resip::RedirectManager::TargetSet:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 TargetSet (const SipMessage &request, const Ordering &order)
void addTargets (const SipMessage &msg)
bool makeNextRequest (SipMessage &request)

Protected Types

typedef std::set< NameAddrEncounteredTargetSet
typedef std::priority_queue
< NameAddr, std::vector
< NameAddr >, Ordering
TargetQueue

Protected Attributes

EncounteredTargetSet mTargetSet
TargetQueue mTargetQueue
SipMessage mRequest

Detailed Description

Definition at line 48 of file RedirectManager.hxx.


Member Typedef Documentation

Definition at line 60 of file RedirectManager.hxx.

typedef std::priority_queue<NameAddr, std::vector<NameAddr>, Ordering> resip::RedirectManager::TargetSet::TargetQueue [protected]

Definition at line 61 of file RedirectManager.hxx.


Constructor & Destructor Documentation

resip::RedirectManager::TargetSet::TargetSet ( const SipMessage request,
const Ordering order 
) [inline]

Definition at line 51 of file RedirectManager.hxx.

                                                                        :
               mTargetQueue(order),
               mRequest(request)
            {}

Member Function Documentation

void RedirectManager::TargetSet::addTargets ( const SipMessage msg)

Definition at line 74 of file RedirectManager.cxx.

References DebugLog, resip::SipMessage::exists(), resip::SipMessage::header(), mTargetQueue, and mTargetSet.

Referenced by resip::RedirectManager::handle(), and testRedirectManager::testContactOrdering().

{
   if (msg.exists(h_Contacts))
   {         
      for (NameAddrs::const_iterator it = msg.header(h_Contacts).begin(); it != msg.header(h_Contacts).end(); it++)
      {         
         if (mTargetSet.find(*it) == mTargetSet.end())
         {
            DebugLog( << "RedirectManager::TargetSet::addTargets:target: " << *it);
            mTargetSet.insert(*it);
            mTargetQueue.push(*it);
         }                     
      }
   }   
}

Here is the call graph for this function:

bool RedirectManager::TargetSet::makeNextRequest ( SipMessage request)

Definition at line 91 of file RedirectManager.cxx.

References DebugLog, h_RequestLine, resip::SipMessage::header(), resip::SipMessage::isRequest(), resip::SipMessage::mergeUri(), and resip::RequestLine::method().

Referenced by resip::RedirectManager::handle(), and testRedirectManager::testContactOrdering().

{
   request = mRequest;
   //dispaly name, check if it's an invite, recurse if it isn't, throw if
   //exhausted? Or make a boolean, elimnate hasTarget   
   while(!mTargetQueue.empty())
   {
      try
      {
         request.mergeUri(mTargetQueue.top().uri());
         mTargetQueue.pop();
         if (request.isRequest())
         {
            switch(request.header(h_RequestLine).method())
            {
               case ACK:
               case BYE:
               case CANCEL:
               case PRACK:
                  break;
               default:
                  DebugLog(<< "RedirectManager::TargetSet::makeNextRequest: " << request);
                  request.header(h_CSeq).sequence()++;
                  return true;
            }
                 }
      }
      catch(BaseException&)
      {
         DebugLog(<< "RedirectManager::TargetSet::makeNextRequest: error generating request");
         mTargetQueue.pop();
      }
   }
   return false;
}

Here is the call graph for this function:


Member Data Documentation

Definition at line 68 of file RedirectManager.hxx.

Definition at line 64 of file RedirectManager.hxx.

Referenced by addTargets().

Definition at line 63 of file RedirectManager.hxx.

Referenced by addTargets().


The documentation for this class was generated from the following files: