reSIProcate/DialogUsageManager  9694
Public Member Functions | Private Attributes
resip::DumProcessHandler Class Reference

#include <DumProcessHandler.hxx>

Inheritance diagram for resip::DumProcessHandler:
Inheritance graph
[legend]
Collaboration diagram for resip::DumProcessHandler:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 DumProcessHandler (ExternalTimer *)
virtual void handleProcessNotification ()
virtual void handleTimeout (AsyncID timerID)
void start (DialogUsageManager *)
void stop ()

Private Attributes

bool mHaveActiveTimer
 dcm! -- temporary
AsyncID mTimerID
DialogUsageManagermDum
ExternalTimermExternalTimer
bool mStopped
bool mCurrentlyProcessing

Detailed Description

Definition at line 14 of file DumProcessHandler.hxx.


Constructor & Destructor Documentation

resip::DumProcessHandler::DumProcessHandler ( ExternalTimer et)

Definition at line 10 of file DumProcessHandler.cxx.

                                                      :
   mHaveActiveTimer(false),
   mDum(0),
   mExternalTimer(et),
   mStopped(false),
   mCurrentlyProcessing(false)
{
}

Member Function Documentation

void resip::DumProcessHandler::handleProcessNotification ( ) [virtual]

Implements resip::AsyncProcessHandler.

Definition at line 28 of file DumProcessHandler.cxx.

References resip::ExternalTimer::createTimer(), DebugLog, resip::ExternalTimer::deleteTimer(), resip::ExternalTimer::generateAsyncID(), mCurrentlyProcessing, mDum, mExternalTimer, mHaveActiveTimer, mStopped, mTimerID, resip::DialogUsageManager::process(), resip::FdSet::selectMilliSeconds(), and resip::FdSet::size.

Referenced by handleTimeout().

{
#if 0 // !dcm! this needs to be fixed in the new model
   //only works when there is exactly one thread causing notifications; could be
   //made thread safecancelled
   if (!mCurrentlyProcessing && !mStopped)
   {
      mCurrentlyProcessing = true;
      //very temporary
      //FD_ISSET     ??
      FdSet fds;
      mDum->buildFdSet(fds);
      if (fds.size > 0)
      {         
         fds.selectMilliSeconds((long)0);
      }
      
      int timeTillProcess = 0;      
      do
      {
         mDum->process(fds);
         timeTillProcess = mDum->getTimeTillNextProcessMS();
      }
      while (timeTillProcess == 0);
      if (timeTillProcess != INT_MAX)
      {
         if (mHaveActiveTimer)
         {
            mExternalTimer->deleteTimer(mTimerID);
         }         
         assert(timeTillProcess < 60*4*60*1000); //4hr sanity check
         mTimerID = mExternalTimer->generateAsyncID();
         DebugLog ( << "Setting dum process timer: " << timeTillProcess);
         mExternalTimer->createTimer(mTimerID, timeTillProcess);
         mHaveActiveTimer = true;         
      }
      mCurrentlyProcessing = false;
   }   
#endif
}

Here is the call graph for this function:

void resip::DumProcessHandler::handleTimeout ( AsyncID  timerID) [virtual]

Implements resip::ExternalTimerHandler.

Definition at line 70 of file DumProcessHandler.cxx.

References handleProcessNotification(), mHaveActiveTimer, and mTimerID.

{
   assert(timerID == mTimerID);   
   mHaveActiveTimer = false;   
   handleProcessNotification();
}

Here is the call graph for this function:

void resip::DumProcessHandler::start ( DialogUsageManager dum)

Definition at line 20 of file DumProcessHandler.cxx.

References resip::ExternalTimer::generateAsyncID(), mDum, mExternalTimer, mTimerID, and resip::ExternalTimer::setHandler().

{
   mDum = dum;
   mExternalTimer->setHandler(this);
   mTimerID = mExternalTimer->generateAsyncID();
}

Here is the call graph for this function:

void resip::DumProcessHandler::stop ( )

Definition at line 79 of file DumProcessHandler.cxx.

References resip::ExternalTimer::deleteTimer(), mExternalTimer, mHaveActiveTimer, mStopped, and mTimerID.

{
   mStopped = true;
   if (mHaveActiveTimer)
   {
      mExternalTimer->deleteTimer(mTimerID);
   }         
}

Here is the call graph for this function:


Member Data Documentation

Definition at line 30 of file DumProcessHandler.hxx.

Referenced by handleProcessNotification().

Definition at line 27 of file DumProcessHandler.hxx.

Referenced by handleProcessNotification(), and start().

Definition at line 28 of file DumProcessHandler.hxx.

Referenced by handleProcessNotification(), start(), and stop().

dcm! -- temporary

Definition at line 25 of file DumProcessHandler.hxx.

Referenced by handleProcessNotification(), handleTimeout(), and stop().

Definition at line 29 of file DumProcessHandler.hxx.

Referenced by handleProcessNotification(), and stop().

Definition at line 26 of file DumProcessHandler.hxx.

Referenced by handleProcessNotification(), handleTimeout(), start(), and stop().


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