1: 
   2: 
   3: /*********************
   4: *                    *
   5: *  PROJECT INCLUDES  *
   6: *                    *
   7: *********************/
   8: 
   9: 
  10: #include "requesttable.h" 
  11: #include "wwwi/mutexholder.h" 
  12: #include "wwwi/string.h" 
  13: 
  14: 
  15: /*********************
  16: *                    *
  17: *  METHOD ISINTABLE  *
  18: *                    *
  19: *********************/
  20: 
  21: 
  22: bool RequestTable::IsInTable(RequestPtr i_requestPtr) {
  23:   MutexHolder mh(&m_mutex);
  24:   RequestMap::iterator itStart;
  25:   RequestMap::iterator itEnd;
  26:   RequestMap::iterator it;
  27: 
  28:   make_pair(itStart,itEnd) = m_requestMap.equal_range(i_requestPtr->GetID());
  29:   if (itStart==m_requestMap.end()) return false;
  30:   for(it=itStart;it!=itEnd;it++) {
  31:     cout << "Checking " << i_requestPtr->GetID() << " vs. " << (*it).first << endl;
  32:     if (memcmp(i_requestPtr->m_saiRemotePtr,(*it).second->m_saiRemotePtr,sizeof(SockAddrIn))==0) return true;
  33:   }
  34:   
  35:   return false;
  36: }
  37: 
  38: 
  39: /***************
  40: *              *
  41: *  METHOD ADD  *
  42: *              *
  43: ***************/
  44: 
  45: 
  46: void RequestTable::Add(RequestPtr i_requestPtr) {
  47:   cout << "Adding " << i_requestPtr->GetID() << endl;
  48:   m_requestMap.insert(make_pair(i_requestPtr->GetID(),i_requestPtr));
  49: }
  50: 
  51: 
  52: