本文整理汇总了C++中EventMap::begin方法的典型用法代码示例。如果您正苦于以下问题:C++ EventMap::begin方法的具体用法?C++ EventMap::begin怎么用?C++ EventMap::begin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EventMap
的用法示例。
在下文中一共展示了EventMap::begin方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void
LaunchDaemon::_ResolveRegisteredEvents(BaseJob* job)
{
if (job->Event() == NULL)
return;
for (EventMap::iterator iterator = fEvents.begin();
iterator != fEvents.end(); iterator++) {
RegisteredEvent* event = iterator->second;
if (Events::ResolveRegisteredEvent(job->Event(), event->Name()))
event->AddListener(job);
}
}
示例2: WriteRtpData
int WriteRtpData(const string &output,
const EventMap &event_map) {
FILE *fp = fopen(output.c_str(), "wb");
if (!fp) {
cerr << "cannot open file: " << output << endl;
return -1;
}
EventMap::const_iterator it = event_map.begin();
for (; it != event_map.end(); ++it) {
fwrite(&it->second.ts, sizeof(timeval), 1, fp);
fwrite(&it->second.len, sizeof(int), 1, fp);
fwrite(&it->second.pkt, 1, it->second.len, fp);
}
timeval tm_fin;
tm_fin.tv_sec = tm_fin.tv_usec = MAX_TIME;
fwrite(&tm_fin, sizeof(timeval), 1, fp);
fclose(fp);
return 0;
}
示例3: UpdateEventMap
static void UpdateEventMap()
{
EventMap map;
Thread::Mutex::Scoped l(locker_event);
for(IOMap::const_iterator it = ionew.begin(), ie = ionew.end(); it != ie; ++it)
{
PollIO *io = (*it).second;
iomap[(*it).first] = io;
if (io->newevent)
eventset.insert(io);
}
ionew.clear();
for (EventSet::iterator it = eventset.begin(), ie = eventset.end(); it != ie; ++it)
{
map.insert( std::make_pair(*it, (*it)->event) );
(*it)->update = false;
(*it)->event = (*it)->newevent;
(*it)->newevent = 0;
}
eventset.clear();
wakeup_flag = true;
std::for_each(map.begin(), map.end(), std::ptr_fun(&LoadEvent));
}
示例4: events
void TestMidi::events()
{
QFETCH(QString, file);
QString readFile(DIR + file + ".mscx");
QString writeFile(file + "-test.txt");
QString reference(DIR + file + "-ref.txt");
Score* score = readScore(readFile);
score->doLayout();
EventMap events;
score->renderMidi(&events);
qDebug() << "Opened score " << readFile;
QFile filehandler(writeFile);
filehandler.open(QIODevice::WriteOnly | QIODevice::Text);
QTextStream out(&filehandler);
multimap<int, NPlayEvent> ::iterator iter;
for (auto iter = events.begin(); iter!= events.end(); ++iter){
out << qSetFieldWidth(5) << "Tick = ";
out << qSetFieldWidth(5) << iter->first;
out << qSetFieldWidth(5) << " Type = ";
out << qSetFieldWidth(5) << iter->second.type();
out << qSetFieldWidth(5) << " Pitch = ";
out << qSetFieldWidth(5) << iter->second.dataA();
out << qSetFieldWidth(5) << " Velocity = ";
out << qSetFieldWidth(5) << iter->second.dataB();
out << qSetFieldWidth(5) << " Channel = ";
out << qSetFieldWidth(5) << iter->second.channel();
out << endl;
}
filehandler.close();
QVERIFY(score);
QVERIFY(compareFiles(writeFile, reference));
// QVERIFY(saveCompareScore(score, writeFile, reference));
}