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


C++ MemoryBlock::copyFrom方法代码示例

本文整理汇总了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));
}
开发者ID:jrigg,项目名称:DISTRHO-Ports,代码行数:9,代码来源:PluginProcessor.cpp

示例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();
}
开发者ID:AndrewCapon,项目名称:linnstrument-updater,代码行数:12,代码来源:juce_InterprocessConnection.cpp

示例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);
}
开发者ID:gareth8118,项目名称:ctrlr,代码行数:8,代码来源:CtrlrMIDITransaction.cpp

示例4: getDataFromCurrentResponse

MemoryBlock CtrlrMIDITransaction::getDataFromCurrentResponse()
{
	MemoryBlock returnData;

	if (responseReceived.getSize() > 0)
	{
		returnData.copyFrom (responseReceived.getData(), getResponsePrefixLength(), getResponseDataLength());
	}

	return (returnData);
}
开发者ID:gareth8118,项目名称:ctrlr,代码行数:11,代码来源:CtrlrMIDITransaction.cpp

示例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();
}
开发者ID:0x4d52,项目名称:KlangFalter,代码行数:22,代码来源:juce_InterprocessConnection.cpp


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