本文整理汇总了C++中MemoryBlock::copyFrom方法的典型用法代码示例。如果您正苦于以下问题:C++ MemoryBlock::copyFrom方法的具体用法?C++ MemoryBlock::copyFrom怎么用?C++ MemoryBlock::copyFrom使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MemoryBlock
的用法示例。
在下文中一共展示了MemoryBlock::copyFrom方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getStateInformation
//==============================================================================
void AdmvAudioProcessor::getStateInformation (MemoryBlock& destData)
{
uint8 version = getStateVersion();
destData.ensureSize(sizeof(mState) + 1, false);
destData.copyFrom(&version, 0, 1);
destData.copyFrom(&mState, 1, sizeof(mState));
}
示例2: sendMessage
//==============================================================================
bool InterprocessConnection::sendMessage (const MemoryBlock& message)
{
uint32 messageHeader[2] = { ByteOrder::swapIfBigEndian (magicMessageHeader),
ByteOrder::swapIfBigEndian ((uint32) message.getSize()) };
MemoryBlock messageData (sizeof (messageHeader) + message.getSize());
messageData.copyFrom (messageHeader, 0, sizeof (messageHeader));
messageData.copyFrom (message.getData(), sizeof (messageHeader), message.getSize());
return writeData (messageData.getData(), (int) messageData.getSize()) == (int) messageData.getSize();
}
示例3: getDataFromResponse
const MemoryBlock CtrlrMIDITransaction::getDataFromResponse(const MidiMessage &messageToExtractFrom)
{
MemoryBlock returnData;
MemoryBlock temp(messageToExtractFrom.getRawData(), messageToExtractFrom.getRawDataSize());
returnData.copyFrom (temp.getData(), getResponsePrefixLength(), getResponseDataLength());
return (returnData);
}
示例4: getDataFromCurrentResponse
MemoryBlock CtrlrMIDITransaction::getDataFromCurrentResponse()
{
MemoryBlock returnData;
if (responseReceived.getSize() > 0)
{
returnData.copyFrom (responseReceived.getData(), getResponsePrefixLength(), getResponseDataLength());
}
return (returnData);
}
示例5: sendMessage
//==============================================================================
bool InterprocessConnection::sendMessage (const MemoryBlock& message)
{
uint32 messageHeader[2];
messageHeader [0] = ByteOrder::swapIfBigEndian (magicMessageHeader);
messageHeader [1] = ByteOrder::swapIfBigEndian ((uint32) message.getSize());
MemoryBlock messageData (sizeof (messageHeader) + message.getSize());
messageData.copyFrom (messageHeader, 0, sizeof (messageHeader));
messageData.copyFrom (message.getData(), sizeof (messageHeader), message.getSize());
int bytesWritten = 0;
const ScopedLock sl (pipeAndSocketLock);
if (socket != nullptr)
bytesWritten = socket->write (messageData.getData(), (int) messageData.getSize());
else if (pipe != nullptr)
bytesWritten = pipe->write (messageData.getData(), (int) messageData.getSize(), pipeReceiveMessageTimeout);
return bytesWritten == (int) messageData.getSize();
}