本文整理汇总了C++中Subscription::push_back方法的典型用法代码示例。如果您正苦于以下问题:C++ Subscription::push_back方法的具体用法?C++ Subscription::push_back怎么用?C++ Subscription::push_back使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Subscription
的用法示例。
在下文中一共展示了Subscription::push_back方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: decodeSubscribeMsg
Subscription aggregator_solver::decodeSubscribeMsg(std::vector<unsigned char>& buff, unsigned int length) {
Subscription rules;
//Only process the message if its type matches one of the subscription ids
//and if the message is large enough to be valid.
if ( length > 4 ) {
BuffReader reader(buff);
uint32_t entire_length = reader.readPrimitive<uint32_t>();
MessageID msg_type = MessageID(reader.readPrimitive<uint8_t>());
if (entire_length + 4 == length and
(subscription_request == msg_type or
subscription_response == msg_type)) {
uint32_t num_rules = reader.readPrimitive<uint32_t>();
for (size_t rule_no = 0; rule_no < num_rules; ++rule_no) {
Rule rule;
rule.physical_layer = reader.readPrimitive<unsigned char>();
//Read in the txer ids and masks
uint32_t num_txers = reader.readPrimitive<uint32_t>();
for (size_t txer_no = 0; txer_no < num_txers; ++txer_no) {
Transmitter t;
t.base_id = reader.readPrimitive<uint128_t>();
t.mask = reader.readPrimitive<uint128_t>();
rule.txers.push_back(t);
}
rule.update_interval = reader.readPrimitive<decltype(rule.update_interval)>();
rules.push_back(rule);
}
}
}
return rules;
}