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


C++ BBuffer::ID方法代码示例

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


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

示例1: main

int main()
{
	// app_server connection (no need to run it)
	BApplication app("application/x-vnd-test"); 
	
	BBufferGroup * group;
	status_t s;
	int32 count;
	BBuffer *buffer;

/*
	printf("using default constructor:\n");
	group = new BBufferGroup();


	s = group->InitCheck();
	printf("InitCheck: status = %ld\n",s);
	
	s = group->CountBuffers(&count);
	printf("CountBuffers: count = %ld, status = %ld\n",count,s);
	
	delete group;
*/
	printf("\n");
	printf("using size = 1234 constructor:\n");
	group = new BBufferGroup(1234);

	s = group->InitCheck();
	printf("InitCheck: status = %ld\n",s);
	
	s = group->CountBuffers(&count);
	printf("CountBuffers: count = %ld, status = %ld\n",count,s);

	s = group->GetBufferList(1,&buffer);
	printf("GetBufferList: status = %ld\n",s);

	printf("Buffer->Data:  = %08x\n",(int)buffer->Data());

	printf("Buffer->ID:  = %d\n",(int)buffer->ID());

	printf("Buffer->Size:  = %ld\n",buffer->Size());

	printf("Buffer->SizeAvailable:  = %ld\n",buffer->SizeAvailable());

	printf("Buffer->SizeUsed:  = %ld\n",buffer->SizeUsed());

	printf("\n");

	media_buffer_id id = buffer->ID();
	BBufferGroup * group2 = new BBufferGroup(1,&id);
	printf("creating second group with a buffer from first group:\n");

	s = group2->InitCheck();
	printf("InitCheck: status = %ld\n",s);

	s = group2->CountBuffers(&count);
	printf("CountBuffers: count = %ld, status = %ld\n",count,s);

	buffer = 0;
	s = group2->GetBufferList(1,&buffer);
	printf("GetBufferList: status = %ld\n",s);

	printf("Buffer->Data:  = %08x\n",(int)buffer->Data());

	printf("Buffer->ID:  = %d\n",(int)buffer->ID());

	printf("Buffer->Size:  = %ld\n",buffer->Size());

	printf("Buffer->SizeAvailable:  = %ld\n",buffer->SizeAvailable());

	printf("Buffer->SizeUsed:  = %ld\n",buffer->SizeUsed());

	delete group;
	delete group2;

	printf("\n");
/*
	printf("creating a BSmallBuffer:\n");
	BSmallBuffer * sb = new BSmallBuffer;

	printf("sb->Data:  = %08x\n",(int)sb->Data());

	printf("sb->ID:  = %d\n",(int)sb->ID());

	printf("sb->Size:  = %ld\n",sb->Size());

	printf("sb->SizeAvailable:  = %ld\n",sb->SizeAvailable());

	printf("sb->SizeUsed:  = %ld\n",sb->SizeUsed());

	printf("sb->SmallBufferSizeLimit:  = %ld\n",sb->SmallBufferSizeLimit());

	delete sb;
*/
	return 0;
}
开发者ID:mariuz,项目名称:haiku,代码行数:96,代码来源:BufferTest.cpp


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