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