本文整理汇总了C++中EventInfo类的典型用法代码示例。如果您正苦于以下问题:C++ EventInfo类的具体用法?C++ EventInfo怎么用?C++ EventInfo使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了EventInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: parseEventInfo
void GuideInfoParser::parseEventInfo(int idx)
{
EventInfo info;
info.setId(atoi(m_csvHelper.getData(idx, 1)));
info.setEventName(m_csvHelper.getData(idx, 2));
info.setEventUserData(atoi(m_csvHelper.getData(idx, 3)));
m_vecEvent.push_back(info);
}
示例2: assert
/// [11/19/2008 by Guanhua Yan. ]
///
/// reads info from input file <Time> <EntityID> <ServiceAddr>
/// <InfoType> <info data .....> without any time constraints. Open a
/// file and then read all infos.
///≈
void InfoManager::readFullDataFile(const std::string& infoFiles )
{
assert(false);
/// these variables should be static because they will be reused may times
static const Control::LpPtrMap& lpMap = Control::getLpPtrMap();
SMART_ASSERT( lpMap.begin() != lpMap.end() );
SMART_ASSERT( lpMap.begin()->second );
static const LP& lp = *(lpMap.begin()->second); // get address of ANY lp on this computer node
Time now = lp.getNow();
#ifdef DEBUG
Logger::debug3() << "InfoManager: in readFullDataFile at time " << now
<< ", infoFiles= " << infoFiles << endl;
#endif
stringstream sstr;
sstr << infoFiles;
string fileName;
// for each file, setup a reader
while( sstr >> fileName )
{
InfoData::Reader reader(fileName);
while ( reader.MoreData()) {
InfoData data( reader.ReadData() );
// see if we will send the info:
LPID lpId = theEntityManager().findEntityLpId( data.getEntityId() );
Control::LpPtrMap::const_iterator lpIter = lpMap.find(lpId);
if( lpIter != lpMap.end() )
{
// the destination resides on one of LPs in this Unix process
// send the info:
#ifdef DEBUG
Logger::debug3() << "InfoManager: processing data: " << data << endl;
#endif
// get info object and fill it with data
boost::shared_ptr<Input> input( fInputHandler.createInput( data.getClassType(), data.getProfileId(), data.getData() ) );
boost::shared_ptr<Info> info = boost::dynamic_pointer_cast<Info>(input);
SMART_ASSERT( info ); /// the object MUST actually be a descendant of Info
#ifdef DEBUG
Logger::debug3() << "InfoManager: processing info: " << info << endl;
#endif
// set EventInfo parameters:
EventInfo event;
event.setTo( data.getEntityId(), data.getServiceAddress() );
event.setDelay( max (LOCAL_MINDELAY, data.getTime() - now ));
event.setInfo( info );
// send it off directly to the right LP
LP* lpPointer = lpIter->second;
SMART_ASSERT( lpPointer );
lpPointer->sendEventInfo(event);
} // else don't schedule it, other Unix process will
} // while(MoreData)
}
}
示例3: processOutgoingInfo
void Entity::processOutgoingInfo(const boost::shared_ptr<const Info> info, const Time& delay, const EntityID& dest, const ServiceAddress& serv) const
{
if(Control::getSimPhase() != Control::kPhaseRun) {
Logger::failure("Entity::processOutgoingInfo(): simulation not running!");
}
EventInfo event;
event.setTo(dest, serv);
event.setDelay(delay);
event.setInfo(info);
// send it off
fLP.sendEventInfo( event );
}
示例4: mouseReleaseEvent
bool PicItem::mouseReleaseEvent( const EventInfo &info )
{
QMouseEvent *e = info.mouseReleaseEvent( 0, 0 );
if ( !m_pressed ) {
delete e;
return CNItem::mouseReleaseEvent( info );
}
const PinItemList::iterator end = m_pinItemList.end();
for ( PinItemList::iterator it = m_pinItemList.begin(); it != end; ++it )
if ( !e->isAccepted() ) {
continue;
} else if ( (*it)->boundingRect().contains(m_pos) && (*it)->boundingRect().contains( info.pos ) ) {
if ( m_dragged ) {
(*it)->dragged( m_dx );
} else {
(*it)->switchState();
}
m_pressed = false;
m_dragged = false;
m_pos = QPoint();
m_dx = 0;
delete e;
return true;
}
delete e;
return CNItem::mouseReleaseEvent( info );
}
示例5: setupBranches
void TauAnalysisSelector::setupBranches(BranchManager& branchManager) {
fEventInfo.setupBranches(branchManager);
if(fIsEmbedded) {
branchManager.book("weightGenerator", &fGeneratorWeight);
fMuons.setupBranches(branchManager, isMC());
//fElectrons.setupBranches(branchManager, isMC());
fJets.setupBranches(branchManager);
fGenTausEmbedded.setupBranches(branchManager);
}
fTaus.setupBranches(branchManager, isMC() && !fIsEmbedded);
if(isMC())
fGenTaus.setupBranches(branchManager);
if(!fPuWeightName.empty())
branchManager.book(fPuWeightName, &fPuWeight);
branchManager.book("selectedPrimaryVertex_count", &fSelectedVertexCount);
branchManager.book("goodPrimaryVertex_count", &fVertexCount);
if(fIsEmbedded) {
branchManager.book("trigger_Mu40_eta2p1", &fMuTriggerPassed);
}
//branchManager.book("ElectronVetoPassed", &fElectronVetoPassed);
}
示例6: EventAndBlock
EventInfo* EventInfo::AutoDeserialise(QDomNode* Reader)
{
EventInfo* info = NULL;
if( Reader->nodeName() == "And" )
{
info = (EventInfo*)new EventAndBlock();
info->Deserialise( Reader );
} else if( Reader->nodeName() == "Or" ) {
info = (EventInfo*)new EventOrBlock();
info->Deserialise( Reader );
} else if( Reader->nodeName() == "Event" ) {
info = (EventInfo*)new EventPlugInInfo();
info->Deserialise( Reader );
}
return info;
}
示例7: addSharedInfo
static
void
addSharedInfo(
const EventInfo& event,
VcfWriterSV::InfoTag_t& infoTags)
{
if (event.isEvent())
{
infoTags.push_back( str(boost::format("EVENT=%i") % event.label));
}
}
示例8: theEntityManager
void InfoManager::createPyInfoFromInfoData( PyInfoData& data ) {
static const Control::LpPtrMap& lpMap = Control::getLpPtrMap();
static const LP& lp = *(lpMap.begin()->second); // get address of ANY lp on this computer node
Time now = lp.getNow();
// see if we will send the info:
LPID lpId = theEntityManager().findEntityLpId( data.getEntityId() );
Control::LpPtrMap::const_iterator lpIter = lpMap.find(lpId);
if( lpIter != lpMap.end() )
{
// the destination resides on one of LPs in this Unix process
// send the info:
#ifdef DEBUG
Logger::debug3() << "InfoManager: processing data: " << data << endl;
#endif
// get info object and fill it with data
boost::shared_ptr<Input> input( fInputHandler.createInput( data.getClassType(), data.getProfileId(), data.getProfile(), data.getData() ) );
boost::shared_ptr<Info> info = boost::dynamic_pointer_cast<Info>(input);
SMART_ASSERT( info ); /// the object MUST actually be a descendant of Info
#ifdef DEBUG
Logger::debug3() << "InfoManager: processing info: " << info << endl;
#endif
// set EventInfo parameters:
EventInfo event;
event.setTo( data.getEntityId(), data.getServiceAddress() );
if( data.getTime() < now )
Logger::warn() << "InfoManager: Sending event at time " << now
<< " which should have been sent at " << data.getTime()
<< " : Check if input is time sorted " << endl;
event.setDelay( max (LOCAL_MINDELAY, data.getTime() - now ));
event.setInfo( info );
// send it off directly to the right LP
LP* lpPointer = lpIter->second;
SMART_ASSERT( lpPointer );
lpPointer->sendEventInfo(event);
} // else don't schedule it, other Unix process will
}
示例9: modifyInfo
void
VcfWriterSomaticSV::
modifyInfo(
const EventInfo& event,
std::vector<std::string>& infotags) const
{
infotags.push_back("SOMATIC");
infotags.push_back( str(boost::format("SOMATICSCORE=%i") % getSomaticInfo().somaticScore) );
if (event.isEvent())
{
infotags.push_back( str(boost::format("JUNCTION_SOMATICSCORE=%i") % getSingleJunctionSomaticInfo().somaticScore) );
}
}
示例10: mouseMoveEvent
bool PicItem::mouseMoveEvent( const EventInfo &info )
{
QMouseEvent *e = info.mouseMoveEvent( 0, 0 );
const PinItemList::iterator end = m_pinItemList.end();
for ( PinItemList::iterator it = m_pinItemList.begin(); it != end; ++it )
if ( e->isAccepted() && (*it)->boundingRect().contains( info.pos ) ) {
QPoint vec = info.pos - m_pos;
if ( m_pressed && vec.manhattanLength() > 4 ) {
m_dragged = true;
m_dx = vec.x();
}
delete e;
return true;
}
delete e;
return CNItem::mouseMoveEvent( info );
}
示例11: mousePressEvent
bool PicItem::mousePressEvent( const EventInfo &info )
{
QMouseEvent *e = info.mousePressEvent( 0, 0 );
const PinItemList::iterator end = m_pinItemList.end();
for ( PinItemList::iterator it = m_pinItemList.begin(); it != end; ++it )
if ( e->isAccepted() && (*it)->boundingRect().contains( info.pos ) ) {
//reset mouse-gesture state
m_pressed = true;
m_pos = info.pos;
m_dragged = false;
m_dx = 0;
delete e;
return true;
}
m_pressed = false;
delete e;
return CNItem::mousePressEvent( info );
}
示例12: parseNextEvent
void MidiParser_SMF::parseNextEvent(EventInfo &info) {
info.start = _position._play_pos;
info.delta = readVLQ(_position._play_pos);
// Process the next info. If mpMalformedPitchBends
// was set, we must skip over any pitch bend events
// because they are from Simon games and are not
// real pitch bend events, they're just two-byte
// prefixes before the real info.
do {
if ((_position._play_pos[0] & 0xF0) >= 0x80)
info.event = *(_position._play_pos++);
else
info.event = _position._running_status;
} while (_malformedPitchBends && (info.event & 0xF0) == 0xE0 && _position._play_pos++);
if (info.event < 0x80)
return;
_position._running_status = info.event;
switch (info.command()) {
case 0x9: // Note On
info.basic.param1 = *(_position._play_pos++);
info.basic.param2 = *(_position._play_pos++);
if (info.basic.param2 == 0)
info.event = info.channel() | 0x80;
info.length = 0;
break;
case 0xC:
case 0xD:
info.basic.param1 = *(_position._play_pos++);
info.basic.param2 = 0;
break;
case 0x8:
case 0xA:
case 0xB:
case 0xE:
info.basic.param1 = *(_position._play_pos++);
info.basic.param2 = *(_position._play_pos++);
info.length = 0;
break;
case 0xF: // System Common, Meta or SysEx event
switch (info.event & 0x0F) {
case 0x2: // Song Position Pointer
info.basic.param1 = *(_position._play_pos++);
info.basic.param2 = *(_position._play_pos++);
break;
case 0x3: // Song Select
info.basic.param1 = *(_position._play_pos++);
info.basic.param2 = 0;
break;
case 0x6:
case 0x8:
case 0xA:
case 0xB:
case 0xC:
case 0xE:
info.basic.param1 = info.basic.param2 = 0;
break;
case 0x0: // SysEx
info.length = readVLQ(_position._play_pos);
info.ext.data = _position._play_pos;
_position._play_pos += info.length;
break;
case 0xF: // META event
info.ext.type = *(_position._play_pos++);
info.length = readVLQ(_position._play_pos);
info.ext.data = _position._play_pos;
_position._play_pos += info.length;
break;
default:
warning("MidiParser_SMF::parseNextEvent: Unsupported event code %x", info.event);
}
}
}
示例13: findGenTaus
bool TauAnalysisSelector::process(Long64_t entry) {
double weight = 1.0;
if(!fPuWeightName.empty()) {
weight *= fPuWeight->value();
}
fEventCounter.setWeight(weight);
cAll.increment();
if(fIsEmbedded) {
weight *= fGeneratorWeight->value();
fEventCounter.setWeight(weight);
}
cGeneratorWeight.increment();
/*
std::cout << "FOO Event " << fEventInfo.event() << ":" << fEventInfo.lumi() << ":" << fEventInfo.run()
<< " electronVeto passed? " << fElectronVetoPassed->value()
<< std::endl;
if( (fEventInfo.event() == 10069461 && fEventInfo.lumi() == 33572) ||
(fEventInfo.event() == 10086951 && fEventInfo.lumi() == 33630) ||
(fEventInfo.event() == 101065527 && fEventInfo.lumi() == 336953) ||
(fEventInfo.event() == 101450418 && fEventInfo.lumi() == 338236) ||
(fEventInfo.event() == 101460111 && fEventInfo.lumi() == 338268) ) {
std::cout << "BAR Event " << fEventInfo.event() << ":" << fEventInfo.lumi() << ":" << fEventInfo.run()
<< " electronVeto passed? " << fElectronVetoPassed->value()
<< " Nelectrons " << fElectrons.size()
<< std::endl;
for(size_t i=0; i<fElectrons.size(); ++i) {
ElectronCollection::Electron electron = fElectrons.get(i);
std::cout << " Electron " << i
<< " pt " << electron.p4().Pt()
<< " eta " << electron.p4().Eta()
<< " hasGsfTrack " << electron.hasGsfTrack()
<< " hasSuperCluster " << electron.hasSuperCluster()
<< " supercluster eta " << electron.superClusterEta()
<< " passIdVeto " << electron.cutBasedIdVeto()
<< std::endl;
}
}
if(!fElectronVetoPassed->value()) return false;
cElectronVeto.increment();
*/
// Tau BR
if(fIsEmbedded && fEmbeddingNormalizationMode == kIDTriggerEfficiencyTauBR) {
weight *= (1-0.357); // from my thesis, which took the numbers from PDG
fEventCounter.setWeight(weight);
}
cTauBRWeight.increment();
// MC status
std::vector<GenParticleCollection::GenParticle> genTaus;
GenParticleCollection::GenParticle theGenTau;
if(isMC()) {
bool canContinue = true;
if(fIsEmbedded) {
canContinue = findGenTaus(fGenTausEmbedded, 2212, &genTaus);
canContinue = canContinue && genTaus.size() != 0;
}
else
canContinue = findGenTaus(fGenTaus, 6, &genTaus);
if(!canContinue)
return false;
}
cGenTauFound.increment();
if(isMC() && fMCTauMultiplicity != kMCTauNone) {
size_t ntaus = genTaus.size();
if(fIsEmbedded) {
std::vector<GenParticleCollection::GenParticle> genTausOrig;
findGenTaus(fGenTaus, 6, &genTausOrig);
ntaus = genTausOrig.size();
}
if(fIsEmbedded) {
// For embedded the embedded tau is counted as one
if(fMCTauMultiplicity == kMCTauZeroTaus) return true;
if(fMCTauMultiplicity == kMCTauOneTau && ntaus != 0) return true;
if(fMCTauMultiplicity == kMCTauTwoTaus && ntaus != 1) return true;
if(fMCTauMultiplicity == kMCTauMoreThanTwoTaus && ntaus < 2) return true;
}
else {
if(fMCTauMultiplicity == kMCTauZeroTaus && ntaus != 0) return true;
if(fMCTauMultiplicity == kMCTauOneTau && ntaus != 1) return true;
if(fMCTauMultiplicity == kMCTauTwoTaus && ntaus != 2) return true;
if(fMCTauMultiplicity == kMCTauMoreThanTwoTaus && ntaus < 3) return true;
}
if(genTaus.size() > 0)
theGenTau = genTaus[0];
}
cTauMCSelection.increment();
bool originalMuonIsWMu = false;
EmbeddingMuonCollection::Muon embeddingMuon;
if(fIsEmbedded) {
if(fMuons.size() != 1)
throw std::runtime_error("Embedding muon collection size is not 1");
//.........这里部分代码省略.........
示例14: readVLQ
void MidiParser_S1D::parseNextEvent(EventInfo &info) {
info.start = _position._play_pos;
info.delta = _no_delta ? 0 : readVLQ2(_position._play_pos);
_no_delta = false;
info.event = *(_position._play_pos++);
if (info.command() < 0x8) {
_no_delta = true;
info.event += 0x80;
}
switch (info.command()) {
case 0x8:
info.basic.param1 = *(_position._play_pos++);
info.basic.param2 = 0;
info.length = 0;
break;
case 0x9:
info.basic.param1 = *(_position._play_pos++);
info.basic.param2 = *(_position._play_pos++); // I'm ASSUMING this byte is velocity!
info.length = 0;
break;
case 0xA:
case 0xB:
// I'm not sure what these are meant to do, or what the
// parameter is. Elvira 1 needs them, though, and who am I to
// argue with her?
info.basic.param1 = *(_position._play_pos++);
info.basic.param2 = 0;
break;
case 0xC:
info.basic.param1 = *(_position._play_pos++);
info.basic.param2 = 0;
++_position._play_pos; // I have NO IDEA what the second byte is for.
break;
case 0xD:
// Triggered by MOD0/MOD1/MOD2/MOD3/MOD4/MOD6/MOD7/MOD8/MOD9 in Elvira 2
// Triggered by MOD0/MOD2/MOD3/MOD5/MOD6/MOD7/MOD8/MOD9/MOD10/MOD12/MOD14/MOD15/MOD20 in Waxworks
break;
case 0xE:
// Triggered by MOD9 in Elvira 1
// Triggered by MOD3/MOD5 in Elvira 2
// Triggered by MOD3/MOD7/MOD8/MOD13 in Waxworks
break;
case 0xF:
switch (info.event & 0x0F) {
case 0x0:
// Trigged by MOD2/MOD6/MOD15 in Waxworks
// Pure guesswork
info.ext.type = *(_position._play_pos++);
info.length = readVLQ(_position._play_pos);
info.ext.data = _position._play_pos;
break;
case 0x3: // Not sure, Song Select?
// Trigged by MOD1/MOD7/MOD10 in Elvira 1
info.basic.param1 = *(_position._play_pos++);
info.basic.param2 = 0;
break;
case 0x4:
// Trigged by MOD8 in Elvira 1
break;
case 0x7:
// Trigged by MOD6 in Elvira 2
// Trigged by MOD5 in Waxworks
break;
case 0x8: // Not sure, ?
// Trigged by MOD19 in Waxworks
info.basic.param1 = info.basic.param2 = 0;
break;
case 0xA:
// Trigged by MOD5 in Elvira 2
break;
case 0xC:
// This means End of Track.
// Rewrite in SMF (MIDI transmission) form.
info.event = 0xFF;
info.ext.type = 0x2F;
info.length = 0;
break;
case 0xF: // Not sure, META event?
// Trigged by MOD8/MOD9/MOD11/MOD12/MOD13 in Waxworks
info.ext.type = *(_position._play_pos++);
info.length = readVLQ(_position._play_pos);
info.ext.data = _position._play_pos;
_position._play_pos += info.length;
break;
//.........这里部分代码省略.........
示例15: parseNextEvent
void MidiParser_RO::parseNextEvent (EventInfo &info) {
_markerCount += _lastMarkerCount;
_lastMarkerCount = 0;
info.delta = 0;
do {
info.start = _position._play_pos;
info.event = *(_position._play_pos++);
if (info.command() == 0xA) {
++_lastMarkerCount;
info.event = 0xF0;
} else if (info.event == 0xF0 || info.event == 0xF1) {
byte delay = *(_position._play_pos++);
info.delta += delay;
if (info.event == 0xF1) {
// This event is, as far as we have been able
// to determine, only used in one single song
// in EGA Loom. It seems to be meant for adding
// values greater than 255 to info.delta. See
// bug #1498785.
info.delta += 256;
}
continue;
}
break;
} while (true);
// Seems to indicate EOT
if (info.event == 0) {
info.event = 0xFF;
info.ext.type = 0x2F;
info.length = 0;
info.ext.data = 0;
return;
}
if (info.event < 0x80)
return;
_position._running_status = info.event;
switch (info.command()) {
case 0xC:
info.basic.param1 = *(_position._play_pos++);
info.basic.param2 = 0;
break;
case 0x8: case 0x9: case 0xB:
info.basic.param1 = *(_position._play_pos++);
info.basic.param2 = *(_position._play_pos++);
if (info.command() == 0x9 && info.basic.param2 == 0)
info.event = info.channel() | 0x80;
info.length = 0;
break;
case 0xF: // Marker and EOT messages
info.length = 0;
info.ext.data = 0;
if (info.event == 0xFF) {
_autoLoop = true;
info.ext.type = 0x2F;
} else {
info.ext.type = 0x7F; // Bogus META
}
info.event = 0xFF;
break;
}
}