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


C++ Parcel::writeFileDescriptor方法代码示例

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


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

示例1: shellCommand

status_t IBinder::shellCommand(const sp<IBinder>& target, int in, int out, int err,
    Vector<String16>& args, const sp<IResultReceiver>& resultReceiver)
{
    Parcel send;
    Parcel reply;
    send.writeFileDescriptor(in);
    send.writeFileDescriptor(out);
    send.writeFileDescriptor(err);
    const size_t numArgs = args.size();
    send.writeInt32(numArgs);
    for (size_t i = 0; i < numArgs; i++) {
        send.writeString16(args[i]);
    }
    send.writeStrongBinder(resultReceiver != NULL ? IInterface::asBinder(resultReceiver) : NULL);
    return target->transact(SHELL_COMMAND_TRANSACTION, send, &reply);
}
开发者ID:android-source,项目名称:platform_frameworks_native,代码行数:16,代码来源:Binder.cpp

示例2: dump

status_t BpBinder::dump(int fd, const Vector<String16>& args)
{
    Parcel send;
    Parcel reply;
    send.writeFileDescriptor(fd);
    const size_t numArgs = args.size();
    send.writeInt32(numArgs);
    for (size_t i = 0; i < numArgs; i++) {
        send.writeString16(args[i]);
    }
    status_t err = transact(DUMP_TRANSACTION, send, &reply);
    return err;
}
开发者ID:3dsfr3ak,项目名称:android_frameworks_native,代码行数:13,代码来源:BpBinder.cpp

示例3: WriteMemoryToParcel

void WriteMemoryToParcel(Parcel &parcel, allocator_memory_t *memory)
{
    int32_t p, n;
    parcel.writeInt32(memory->memtype);
    parcel.writeInt32(memory->nptrs);
    parcel.writeInt32(memory->ndims);
    for (p = 0; p < memory->nptrs; p++) {
        for(n = 0; n < memory->ndims; n++) {
            parcel.writeInt32(memory->dims[p].dims[n]);
        }
    }
    for (p = 0; p < memory->nptrs; p++) {
        for(n = 0; n < memory->ndims; n++) {
            parcel.writeInt32(memory->strides[p].dims[n]);
        }
    }
    for (p = 0; p < memory->nptrs; p++) {
        if (memory->memtype == ALLOCATOR_MEMORY_TYPE_TILED_1D_CACHED ||
            memory->memtype == ALLOCATOR_MEMORY_TYPE_TILED_1D_UNCACHED)
            parcel.writeFileDescriptor(memory->fds[p]);
        else if (memory->memtype == ALLOCATOR_MEMORY_TYPE_VIRTUAL_SHARED)
            parcel.writeInt32(memory->fds[p]);
    }
}
开发者ID:aosp,项目名称:dvp,代码行数:24,代码来源:allocator_binder.cpp


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