|
reSIProcate/stack
9694
|
Helper class to properly manage event loop for simple applications. More...
#include <EventStackThread.hxx>

Public Member Functions | |
| EventStackSimpleMgr (const char *implName) | |
| ~EventStackSimpleMgr () | |
| void | setOptions (SipStackOptions &options) |
| SipStack & | createStack (SipStackOptions &options) |
| EventStackThread & | getThread () |
| void | release () |
Protected Attributes | |
| FdPollGrp * | mPollGrp |
| EventThreadInterruptor * | mIntr |
| EventStackThread * | mThread |
| SipStack * | mStack |
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.
| EventStackSimpleMgr::EventStackSimpleMgr | ( | const char * | implName | ) |
Definition at line 120 of file EventStackThread.cxx.
References resip::FdPollGrp::create(), mIntr, mPollGrp, and mThread.
: mPollGrp(0), mIntr(0), mThread(0), mStack(0) { mPollGrp = FdPollGrp::create(implName); mIntr = new EventThreadInterruptor(*mPollGrp); mThread = new EventStackThread(*mIntr, *mPollGrp); }

| EventStackSimpleMgr::~EventStackSimpleMgr | ( | ) |
Definition at line 128 of file EventStackThread.cxx.
References release().
{
release();
}

| 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;
}

| EventStackThread& resip::EventStackSimpleMgr::getThread | ( | ) | [inline] |
Definition at line 132 of file EventStackThread.hxx.
References mThread.
| void EventStackSimpleMgr::release | ( | ) |
Definition at line 151 of file EventStackThread.cxx.
References mIntr, mPollGrp, mStack, and mThread.
Referenced by ~EventStackSimpleMgr().
| void EventStackSimpleMgr::setOptions | ( | SipStackOptions & | options | ) |
Definition at line 134 of file EventStackThread.cxx.
References resip::SipStackOptions::mAsyncProcessHandler, mIntr, resip::SipStackOptions::mPollGrp, and mPollGrp.
Referenced by createStack().
{
options.mPollGrp = mPollGrp;
options.mAsyncProcessHandler = mIntr;
}
EventThreadInterruptor* resip::EventStackSimpleMgr::mIntr [protected] |
Definition at line 142 of file EventStackThread.hxx.
Referenced by EventStackSimpleMgr(), release(), and setOptions().
FdPollGrp* resip::EventStackSimpleMgr::mPollGrp [protected] |
Definition at line 141 of file EventStackThread.hxx.
Referenced by EventStackSimpleMgr(), release(), and setOptions().
SipStack* resip::EventStackSimpleMgr::mStack [protected] |
Definition at line 144 of file EventStackThread.hxx.
Referenced by createStack(), and release().
EventStackThread* resip::EventStackSimpleMgr::mThread [protected] |
Definition at line 143 of file EventStackThread.hxx.
Referenced by createStack(), EventStackSimpleMgr(), getThread(), and release().
1.7.5.1