reSIProcate/stack  9694
Public Member Functions | Protected Attributes
resip::EventStackSimpleMgr Class Reference

Helper class to properly manage event loop for simple applications. More...

#include <EventStackThread.hxx>

Collaboration diagram for resip::EventStackSimpleMgr:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 EventStackSimpleMgr (const char *implName)
 ~EventStackSimpleMgr ()
void setOptions (SipStackOptions &options)
SipStackcreateStack (SipStackOptions &options)
EventStackThreadgetThread ()
void release ()

Protected Attributes

FdPollGrpmPollGrp
EventThreadInterruptormIntr
EventStackThreadmThread
SipStackmStack

Detailed Description

Helper class to properly manage event loop for simple applications.

To use: { EventStackSimpleMgr myMgr(implName); SipStackOptions options; options.something = something; SipStack& myStack = myMgr.createStack(options); do other init here (like start dum) myMgr.getThread.run(); loop doing stuff with myStack until app finished myMgr.getThread.shutdown(); myMgr.getThread.join(); }

There is nothing unique about this class; you can inline it all into your app if want.

Definition at line 109 of file EventStackThread.hxx.


Constructor & Destructor Documentation

EventStackSimpleMgr::EventStackSimpleMgr ( const char *  implName)

Definition at line 120 of file EventStackThread.cxx.

References resip::FdPollGrp::create(), mIntr, mPollGrp, and mThread.

Here is the call graph for this function:

EventStackSimpleMgr::~EventStackSimpleMgr ( )

Definition at line 128 of file EventStackThread.cxx.

References release().

{
   release();
}

Here is the call graph for this function:


Member Function Documentation

SipStack & EventStackSimpleMgr::createStack ( SipStackOptions options)

Definition at line 142 of file EventStackThread.cxx.

References resip::EventStackThread::addStack(), mStack, mThread, and setOptions().

{
   setOptions(options);
   mStack = new SipStack(options);
   mThread->addStack(*mStack);
   return *mStack;
}

Here is the call graph for this function:

EventStackThread& resip::EventStackSimpleMgr::getThread ( ) [inline]

Definition at line 132 of file EventStackThread.hxx.

References mThread.

{ assert(mThread); return *mThread; }
void EventStackSimpleMgr::release ( )

Definition at line 151 of file EventStackThread.cxx.

References mIntr, mPollGrp, mStack, and mThread.

Referenced by ~EventStackSimpleMgr().

                             {
   if ( mThread )
   {
      delete mThread; mThread = NULL;
   }
   if ( mStack ) {
      // we only delete the stack if we created, not if externally created
      delete mStack; mStack = NULL;
   }
   if ( mIntr )
   {
      delete mIntr; mIntr = NULL;
   }
   if ( mPollGrp )
   {
      delete mPollGrp; mPollGrp = NULL;
   }
}
void EventStackSimpleMgr::setOptions ( SipStackOptions options)

Member Data Documentation

Definition at line 142 of file EventStackThread.hxx.

Referenced by EventStackSimpleMgr(), release(), and setOptions().

Definition at line 141 of file EventStackThread.hxx.

Referenced by EventStackSimpleMgr(), release(), and setOptions().

Definition at line 144 of file EventStackThread.hxx.

Referenced by createStack(), and release().

Definition at line 143 of file EventStackThread.hxx.

Referenced by createStack(), EventStackSimpleMgr(), getThread(), and release().


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