本文整理汇总了C++中message::vals方法的典型用法代码示例。如果您正苦于以下问题:C++ message::vals方法的具体用法?C++ message::vals怎么用?C++ message::vals使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类message
的用法示例。
在下文中一共展示了message::vals方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: make
merged_tuple::cow_ptr merged_tuple::make(message x, message y) {
data_type data{x.vals(), y.vals()};
mapping_type mapping;
auto s = x.size();
for (size_t i = 0; i < s; ++i) {
if (x.match_element<index_mapping>(i))
mapping.emplace_back(1, x.get_as<index_mapping>(i).value - 1);
else
mapping.emplace_back(0, i);
}
return cow_ptr{make_counted<merged_tuple>(std::move(data),
std::move(mapping))};
}
示例2: enqueue_impl
void peer::enqueue_impl(msg_hdr_cref hdr, const message& msg) {
BOOST_ACTOR_LOG_TRACE("");
auto tname = msg.tuple_type_names();
add_type_if_needed((tname) ? *tname : detail::get_tuple_type_names(*msg.vals()));
uint32_t size = 0;
auto& wbuf = write_buffer();
auto before = static_cast<uint32_t>(wbuf.size());
binary_serializer bs(&wbuf, &(parent()->get_namespace()), &m_outgoing_types);
wbuf.write(sizeof(uint32_t), &size);
try { bs << hdr << msg; }
catch (std::exception& e) {
BOOST_ACTOR_LOG_ERROR(to_verbose_string(e));
cerr << "*** exception in peer::enqueue; "
<< to_verbose_string(e)
<< endl;
return;
}
BOOST_ACTOR_LOG_DEBUG("serialized: " << to_string(hdr) << " " << to_string(msg));
size = static_cast<std::uint32_t>((wbuf.size() - before))
- static_cast<std::uint32_t>(sizeof(std::uint32_t));
// update size in buffer
memcpy(wbuf.offset_data(before), &size, sizeof(std::uint32_t));
}
示例3: equals
bool message::equals(const message& other) const {
if (empty())
return other.empty();
return other.empty() ? false : vals_->equals(*other.vals());
}