本文整理汇总了C++中EventMap::end方法的典型用法代码示例。如果您正苦于以下问题:C++ EventMap::end方法的具体用法?C++ EventMap::end怎么用?C++ EventMap::end使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EventMap
的用法示例。
在下文中一共展示了EventMap::end方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
ExternalEventSource*
LaunchDaemon::_FindEvent(const char* owner, const char* name) const
{
if (name == NULL)
return NULL;
BString eventName = name;
eventName.ToLower();
EventMap::const_iterator found = fEvents.find(eventName);
if (found != fEvents.end())
return found->second;
if (owner == NULL)
return NULL;
eventName.Prepend("/");
eventName.Prepend(get_leaf(owner));
found = fEvents.find(eventName);
if (found != fEvents.end())
return found->second;
return NULL;
}
示例2: UpdateEvent
/// Обновление
void UpdateEvent (const char* name, ResourceState state)
{
EventMap::iterator iter = event_map.find (name);
if (iter == event_map.end ())
{
EventPtr event = EventPtr (new EventDesc (name, state), false);
EventList::iterator iter = event_list.insert (event_list.end (), event);
event_map.insert_pair (name, iter);
}
else
{
EventPtr event = *iter->second;
if (state == event->state)
return;
if (event->state == ResourceState_Ignore)
{
event_list.splice (event_list.end (), event_list, iter->second);
event->state = state;
return;
}
switch (state)
{
case ResourceState_Unloaded:
event->state = ResourceState_Ignore;
break;
case ResourceState_Prefetched:
if (event->state != ResourceState_Unloaded)
return;
event_list.splice (event_list.end (), event_list, iter->second);
event->state = state;
break;
case ResourceState_Loaded:
if (event->state == ResourceState_Unloaded) event->state = ResourceState_Ignore;
else
{
event_list.splice (event_list.end (), event_list, iter->second);
event->state = state;
}
break;
default:
break;
}
}
}
示例3:
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);
}
}
示例4: 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;
}
示例5: 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));
}
示例6: 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));
}