本文整理汇总了C++中boost::intrusive_ptr::enqueueComplete方法的典型用法代码示例。如果您正苦于以下问题:C++ intrusive_ptr::enqueueComplete方法的具体用法?C++ intrusive_ptr::enqueueComplete怎么用?C++ intrusive_ptr::enqueueComplete使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类boost::intrusive_ptr
的用法示例。
在下文中一共展示了intrusive_ptr::enqueueComplete方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: enqueue
void enqueue(TransactionContext* tx,
const boost::intrusive_ptr<PersistableMessage>& pmsg,
const PersistableQueue& queue)
{
ostringstream o;
string data = getContent(pmsg);
o << "<enqueue " << queue.getName() << " " << data;
if (tx) o << " tx=" << getId(*tx);
o << ">";
log(o.str());
// Dump the message if there is a dump file.
if (dump.get()) {
*dump << "Message(" << data.size() << "): " << data << endl;
}
string logPrefix = "TestStore "+name+": ";
Action action(data);
bool doComplete = true;
if (action.index && action.executeIn(name)) {
switch (action.index) {
case Action::THROW:
throw Exception(logPrefix + data);
break;
case Action::DELAY: {
if (action.args.empty()) {
QPID_LOG(error, logPrefix << "async-id needs argument: " << data);
break;
}
asyncIds[action.args[0]] = pmsg;
QPID_LOG(debug, logPrefix << "delayed completion " << action.args[0]);
doComplete = false;
break;
}
case Action::COMPLETE: {
if (action.args.empty()) {
QPID_LOG(error, logPrefix << "complete-id needs argument: " << data);
break;
}
AsyncIds::iterator i = asyncIds.find(action.args[0]);
if (i != asyncIds.end()) {
i->second->enqueueComplete();
QPID_LOG(debug, logPrefix << "completed " << action.args[0]);
asyncIds.erase(i);
} else {
QPID_LOG(info, logPrefix << "not found for completion " << action.args[0]);
}
break;
}
default:
QPID_LOG(error, logPrefix << "unknown action: " << data);
}
}
if (doComplete) pmsg->enqueueComplete();
}
示例2: run
void run() {
qpid::sys::usleep(usecs);
message->enqueueComplete();
delete this;
}