当前位置: 首页>>代码示例>>C++>>正文


C++ BObjectList::RemoveItem方法代码示例

本文整理汇总了C++中BObjectList::RemoveItem方法的典型用法代码示例。如果您正苦于以下问题:C++ BObjectList::RemoveItem方法的具体用法?C++ BObjectList::RemoveItem怎么用?C++ BObjectList::RemoveItem使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BObjectList的用法示例。


在下文中一共展示了BObjectList::RemoveItem方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: MediaFilePlayer

void
PlayMediaFile(const char* media_type, const char* media_name)
{
	entry_ref ref;
	if (BMediaFiles().GetRefFor(media_type, media_name, &ref) != B_OK
		|| !BEntry(&ref).Exists())
		return;

	MediaFilePlayer* player = list.EachElement(FindMediaFilePlayer,
		(void*)media_name);

	if (player != NULL) {
		if (*(player->Ref()) == ref) {
			player->Restart();
			return;
		}

		list.RemoveItem(player);
		delete player;
		player = NULL;
	}

	if (player == NULL) {
		player = new MediaFilePlayer(media_type, media_name, &ref);
		if (player->InitCheck() == B_OK)
			list.AddItem(player);
		else
			delete player;
	}
}
开发者ID:garodimb,项目名称:haiku,代码行数:30,代码来源:MediaFilePlayer.cpp

示例2: _

/*!	\brief Cleans up any memory allocated by the bitmap and
		informs the server to do so as well (if needed).
*/
void
BBitmap::_CleanUp()
{
	if (fWindow != NULL) {
		if (fWindow->Lock())
			delete fWindow;
		fWindow = NULL;
			// this will leak fWindow if it couldn't be locked
	}

	if (fBasePointer == NULL)
		return;

	if ((fFlags & B_BITMAP_NO_SERVER_LINK) != 0) {
		free(fBasePointer);
	} else if (fServerToken != -1) {
		BPrivate::AppServerLink link;
		// AS_DELETE_BITMAP:
		// Attached Data:
		//	1) int32 server token
		link.StartMessage(AS_DELETE_BITMAP);
		link.Attach<int32>(fServerToken);
		link.Flush();

		// The server areas are deleted via kMsgDeleteServerMemoryArea message

		fArea = -1;
		fServerToken = -1;
		fAreaOffset = -1;

		BAutolock _(sBitmapListLock);
		sBitmapList.RemoveItem(this);
	}
	fBasePointer = NULL;
}
开发者ID:orangejua,项目名称:haiku,代码行数:38,代码来源:Bitmap.cpp

示例3:

// _PutAddOn
void
ModuleManager::_PutAddOn(ModuleAddOn *addon)
{
	if (addon) {
		if (addon->Put()) {
			fAddOns.RemoveItem(addon);
			delete addon;
		}
	}
}
开发者ID:SummerSnail2014,项目名称:haiku,代码行数:11,代码来源:module.cpp

示例4:

void
ExternalEventSource::RemoveListener(BaseJob* job)
{
	fListeners.RemoveItem(job);
}
开发者ID:garodimb,项目名称:haiku,代码行数:5,代码来源:LaunchDaemon.cpp

示例5:

void
RegisteredEvent::RemoveListener(BaseJob* job)
{
	fListeners.RemoveItem(job);
}
开发者ID:puckipedia,项目名称:haiku,代码行数:5,代码来源:LaunchDaemon.cpp


注:本文中的BObjectList::RemoveItem方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。