本文整理汇总了C++中EventPtr::equal_range方法的典型用法代码示例。如果您正苦于以下问题:C++ EventPtr::equal_range方法的具体用法?C++ EventPtr::equal_range怎么用?C++ EventPtr::equal_range使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EventPtr
的用法示例。
在下文中一共展示了EventPtr::equal_range方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: process
void FissionReactor::process(const EventPtr& e)
{
if (e->getType() == m_input_event_type.term_ref) {
// used for generating new events
EventFactory event_factory;
EventPtr new_ptr;
bool read_result;
// iterate through each value defined for the input event term
Event::ValuesRange range = e->equal_range(m_input_event_term.term_ref);
for (Event::ConstIterator it = range.first; it != range.second; ++it) {
// create an input stream based upon the term value
const Event::BlobType& ss = boost::get<const Event::BlobType&>(it->value);
boost::iostreams::stream<boost::iostreams::array_source> input_stream(ss.get(), ss.size());
// read Event(s) from the input stream
while ( isRunning() && !input_stream.eof() ) {
// only allow one thread to use the codec at a time
boost::mutex::scoped_lock codec_lock(m_codec_mutex);
event_factory.create(new_ptr, m_codec_ptr->getEventType());
read_result = m_codec_ptr->read(input_stream, *new_ptr);
codec_lock.unlock();
if (! read_result)
break;
// copy terms from original event ?
if (m_copy_all_terms) {
// copy all terms from original event
*new_ptr += *e;
} else if (! m_copy_terms.empty() ) {
// copy some terms from original event
for (TermVector::const_iterator term_it = m_copy_terms.begin();
term_it != m_copy_terms.end(); ++term_it)
{
new_ptr->copyValues(*e, term_it->term_ref);
}
}
// deliver the event
deliverEvent(new_ptr);
}
}
}
}