本文整理汇总了C++中MessageBuffer::Deserialize方法的典型用法代码示例。如果您正苦于以下问题:C++ MessageBuffer::Deserialize方法的具体用法?C++ MessageBuffer::Deserialize怎么用?C++ MessageBuffer::Deserialize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MessageBuffer
的用法示例。
在下文中一共展示了MessageBuffer::Deserialize方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: unlock
int DbWrapper::unlock()
{
// no unlock for system db
if (m_uid < 5000)
return CKM_API_SUCCESS;
int retCode;
RawBuffer ret = m_logic.unlockUserKey(m_uid, m_pw);
MessageBuffer buff;
buff.Push(ret);
buff.Deserialize(retCode);
return retCode;
}
示例2: HandleReadBody
void MuddComm::HandleReadBody(const error_code& error)
{
if (!error)
{
MessageBuffer msgs;
msgs.Deserialize(_readMsg.data());
ProcessMessageBuffer(msgs);
// Reserve space for the header, then read it in
_readMsg.resize(MessageBuffer::HEADER_LENGTH, '\0');
async_read(_socket, buffer(_readMsg.data(), MessageBuffer::HEADER_LENGTH), bind(&MuddComm::HandleReadHeader, shared_from_this(), _1));
}
else
{
_room.Leave(shared_from_this());
}
}
示例3: getCertChain
int getCertChain(
ServiceConnection & serviceConnection,
LogicCommand command,
int counter,
const CertificateShPtr &certificate,
const T &untrustedVector,
const T &trustedVector,
bool useTrustedSystemCertificates,
CertificateShPtrVector &certificateChainVector)
{
return try_catch([&] {
MessageBuffer recv;
auto send = MessageBuffer::Serialize(static_cast<int>(command),
counter,
certificate->getDER(),
untrustedVector,
trustedVector,
useTrustedSystemCertificates);
int retCode = serviceConnection.processRequest(send.Pop(), recv);
if (CKM_API_SUCCESS != retCode)
return retCode;
int retCommand;
int retCounter;
RawBufferVector rawBufferVector;
recv.Deserialize(retCommand, retCounter, retCode, rawBufferVector);
if ((counter != retCounter) || (static_cast<int>(command) != retCommand))
return CKM_API_ERROR_UNKNOWN;
if (retCode != CKM_API_SUCCESS)
return retCode;
for (auto &e: rawBufferVector) {
CertificateShPtr cert(new CertificateImpl(e, DataFormat::FORM_DER));
if (cert->empty())
return CKM_API_ERROR_BAD_RESPONSE;
certificateChainVector.push_back(cert);
}
return retCode;
});
}