本文整理汇总了C++中Owned::data方法的典型用法代码示例。如果您正苦于以下问题:C++ Owned::data方法的具体用法?C++ Owned::data怎么用?C++ Owned::data使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Owned
的用法示例。
在下文中一共展示了Owned::data方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _saveBlob
// We are not using process::write because of an issue related to junk
// characters being written to the file (see MESOS-3798).
// TODO(jojy): Replace this with process::write once MESOS-3798 is resolved.
Future<Nothing> _saveBlob(
int fd,
const Owned<string>& data,
size_t index)
{
return process::io::write(
fd,
(void*) (data->data() + index),
data->size() - index)
.then([=](size_t writeSize) -> Future<Nothing> {
if (index + writeSize < data->size()) {
return _saveBlob(fd, data, index + writeSize);
}
return Nothing();
});
}
示例2: Nothing
static Future<Nothing> _send(
const std::shared_ptr<SocketImpl>& impl,
Owned<string> data,
size_t index,
size_t length)
{
// Increment the index into the data.
index += length;
// Check if we've sent all of the data.
if (index == data->size()) {
return Nothing();
}
// Keep sending!
return impl->send(data->data() + index, data->size() - index)
.then(lambda::bind(&_send, impl, data, index, lambda::_1));
}
示例3: Nothing
static Future<Nothing> _send(
Socket socket,
Owned<string> data,
size_t index,
size_t length)
{
// Increment the index into the data.
index += length;
// Check if we've sent all of the data.
if (index == data->size()) {
return Nothing();
}
// Keep sending!
return socket.send(data->data() + index, data->size() - index)
.then(lambda::bind(&_send, socket, data, index, lambda::_1));
}