本文整理汇总了C++中CBuffer::get方法的典型用法代码示例。如果您正苦于以下问题:C++ CBuffer::get方法的具体用法?C++ CBuffer::get怎么用?C++ CBuffer::get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBuffer
的用法示例。
在下文中一共展示了CBuffer::get方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: findProfilesResponse
bool PmpIpcProtocol::findProfilesResponse(const std::list<iviLink::Profile::Uid> & profiles,
iviLink::Ipc::DirectionID const& dirId)
{
LOG4CPLUS_TRACE_METHOD(msLogger, __PRETTY_FUNCTION__ );
CBuffer writeBuf = mWriteBufMgr.getBuffer();
ProfileManager::Ipc::PmMessage* req = reinterpret_cast<ProfileManager::Ipc::PmMessage*>(writeBuf.get());
req->header.type = ProfileManager::Ipc::PMP_PMAL_FIND_PROFILES;
iviLink::Ipc::Helpers::CBufferWriter writer(req->data, writeBuf.getSize() - sizeof(req->header));
BaseError err = writer.write(profiles.begin(), profiles.end());
if (!err.isNoError())
{
LOG4CPLUS_ERROR(msLogger, static_cast<std::string>(err));
return false;
}
req->header.size = writer.getUsedSize();
iviLink::Ipc::MsgID id = mMsgIdGen.getNext();
UInt32 const reqSize = sizeof(ProfileManager::Ipc::PmMessage) + req->header.size;
err = mIpc->asyncRequest(id, writeBuf.get(), reqSize, &dirId);
if (!err.isNoError())
{
LOG4CPLUS_ERROR(msLogger, static_cast<std::string>(err));
return false;
}
return true;
}
示例2: incomingProfile
bool PmpIpcProtocol::incomingProfile(iviLink::BaseUid const& profileUid,
iviLink::Profile::ApiUid const& papiUid,
iviLink::Profile::IUid const& piuid,
iviLink::Service::Uid const& serviceUID,
iviLink::Ipc::DirectionID const& dirId)
{
LOG4CPLUS_TRACE_METHOD(msLogger, __PRETTY_FUNCTION__ );
CBuffer writeBuf = mWriteBufMgr.getBuffer();
ProfileManager::Ipc::PmMessage* req = reinterpret_cast<ProfileManager::Ipc::PmMessage*>(writeBuf.get());
req->header.type = ProfileManager::Ipc::PMP_PMAL_INCOMMING_PROFILE;
iviLink::Ipc::Helpers::CBufferWriter writer(req->data, writeBuf.getSize() - sizeof(req->header));
BaseError err = writer.write(profileUid);
if (!err.isNoError())
{
LOG4CPLUS_ERROR(msLogger, static_cast<std::string>(err));
return false;
}
err = writer.write(papiUid);
if (!err.isNoError())
{
LOG4CPLUS_ERROR(msLogger, static_cast<std::string>(err));
return false;
}
err = writer.write(piuid);
if (!err.isNoError())
{
LOG4CPLUS_ERROR(msLogger, static_cast<std::string>(err));
return false;
}
err = writer.write(serviceUID);
if (!err.isNoError())
{
LOG4CPLUS_ERROR(msLogger, static_cast<std::string>(err));
return false;
}
req->header.size = writer.getUsedSize();
iviLink::Ipc::MsgID id = mMsgIdGen.getNext();
UInt32 const reqSize = sizeof(ProfileManager::Ipc::PmMessage) + req->header.size;
err = mIpc->asyncRequest(id, writeBuf.get(), reqSize, &dirId);
return err.isNoError();
}