本文整理汇总了C++中BLooper::RemoveHandler方法的典型用法代码示例。如果您正苦于以下问题:C++ BLooper::RemoveHandler方法的具体用法?C++ BLooper::RemoveHandler怎么用?C++ BLooper::RemoveHandler使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BLooper
的用法示例。
在下文中一共展示了BLooper::RemoveHandler方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
/**
RemoveHandler(BHandler* handler)
@case handler is NULL
@param handler NULL
@results RemoveHandler() returns false. R5 implementation seg faults;
we've fixed that.
*/
void TRemoveHandlerTest::RemoveHandler1()
{
BLooper Looper;
#ifndef TEST_R5
CPPUNIT_ASSERT(!Looper.RemoveHandler(NULL));
#endif
}
示例2: BMessageFilter
/**
RemoveHandler(BHandler* handler)
@case Valid looper and handler; handler has filters
@param handler Valid BHandler pointer
@results RemoveHandler() returns true
handler->FilterList() returns NULL after removal
*/
void TRemoveHandlerTest::RemoveHandler5()
{
BLooper Looper;
BHandler Handler;
BMessageFilter* MessageFilter = new BMessageFilter('1234');
Handler.AddFilter(MessageFilter);
Looper.AddHandler(&Handler);
CPPUNIT_ASSERT(Looper.RemoveHandler(&Handler));
CPPUNIT_ASSERT(Handler.FilterList());
}
示例3: Looper
BHandler::~BHandler()
{
if (LockLooper()) {
BLooper* looper = Looper();
looper->RemoveHandler(this);
looper->Unlock();
}
// remove all filters
if (fFilters) {
int32 count = fFilters->CountItems();
for (int32 i = 0; i < count; i++)
delete (BMessageFilter*)fFilters->ItemAtFast(i);
delete fFilters;
}
// remove all observers (the observer list manages itself)
delete fObserverList;
// free rest
free(fName);
gDefaultTokens.RemoveToken(fToken);
}