本文整理汇总了C++中TTrigger类的典型用法代码示例。如果您正苦于以下问题:C++ TTrigger类的具体用法?C++ TTrigger怎么用?C++ TTrigger使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TTrigger类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: malloc
void TriggerUnit::processDataStream( QString & data, int line )
{
if( data.size() > 0 )
{
char * subject = (char *) malloc( strlen( data.toLocal8Bit().data() ) + 1 );
strcpy( subject, data.toLocal8Bit().data() );
typedef list<TTrigger *>::const_iterator I;
for( I it = mTriggerRootNodeList.begin(); it != mTriggerRootNodeList.end(); it++)
{
TTrigger * pChild = *it;
//QFuture<bool> future = QtConcurrent::run( pChild, &TTrigger::match, subject, data, line, 0 );
//future.waitForFinished();
pChild->match( subject, data, line );
}
free( subject );
for( I it = mCleanupList.begin(); it != mCleanupList.end(); it++ )
{
delete *it;
}
mCleanupList.clear();
}
}
示例2: reenableAllTriggers
void TriggerUnit::reenableAllTriggers()
{
typedef list<TTrigger *>::const_iterator I;
for( I it = mTriggerRootNodeList.begin(); it != mTriggerRootNodeList.end(); it++)
{
TTrigger * pChild = *it;
pChild->enableFamily();
}
}
示例3: stopAllTriggers
void TriggerUnit::stopAllTriggers()
{
typedef list<TTrigger *>::const_iterator I;
for( I it = mTriggerRootNodeList.begin(); it != mTriggerRootNodeList.end(); it++)
{
TTrigger * pChild = *it;
QString name = pChild->getName();
pChild->disableFamily();
}
}
示例4: compileAll
void TriggerUnit::compileAll()
{
typedef list<TTrigger *>::const_iterator I;
for( I it = mTriggerRootNodeList.begin(); it != mTriggerRootNodeList.end(); it++)
{
TTrigger * pChild = *it;
if( pChild->isActive() )
{
pChild->compileAll();
}
}
}
示例5: removeAllTempTriggers
void TriggerUnit::removeAllTempTriggers()
{
typedef list<TTrigger *>::const_iterator I;
for( I it = mTriggerRootNodeList.begin(); it != mTriggerRootNodeList.end(); it++)
{
TTrigger * pChild = *it;
if( pChild->isTempTrigger() )
{
pChild->setIsActive( false );
markCleanup( pChild );
}
}
}
示例6: serialize
bool TriggerUnit::serialize( QDataStream & ofs )
{
bool ret = true;
ofs << (qint64)mMaxID;
ofs << (qint64)mTriggerRootNodeList.size();
typedef list<TTrigger *>::const_iterator I;
for( I it = mTriggerRootNodeList.begin(); it != mTriggerRootNodeList.end(); it++)
{
TTrigger * pChild = *it;
ret = pChild->serialize( ofs );
}
return ret;
}
示例7: recurseTriggers
void dlgPackageExporter::recurseTriggers(TTrigger* trig, QTreeWidgetItem* qTrig){
list<TTrigger *> * childList = trig->getChildrenList();
if (!childList->size())
return;
list<TTrigger *>::iterator it;
for(it=childList->begin(); it!=childList->end();it++){
TTrigger * pChild = *it;
if (pChild->isTempTrigger())
continue;
QStringList sl;
sl << pChild->getName();
QTreeWidgetItem * pItem = new QTreeWidgetItem(sl);
triggerMap.insert(pItem, pChild);
pItem->setFlags(Qt::ItemIsUserCheckable|Qt::ItemIsTristate|Qt::ItemIsEnabled|Qt::ItemIsSelectable);
pItem->setCheckState(0, Qt::Unchecked);
qTrig->addChild(pItem);
recurseTriggers(pChild, pItem);
}
}
示例8: listTriggers
void dlgPackageExporter::listTriggers()
{
TriggerUnit* tu = mpHost->getTriggerUnit();
list<TTrigger *>::const_iterator it;
std::list<TTrigger *> tList = tu->getTriggerRootNodeList();
QList<QTreeWidgetItem *> items = treeWidget->findItems(QString("Triggers"), Qt::MatchExactly, 0);
QTreeWidgetItem * top = items.first();
for(it = tList.begin(); it != tList.end(); it++)
{
TTrigger * pChild = *it;
QStringList sl;
sl << pChild->getName();
QTreeWidgetItem * pItem = new QTreeWidgetItem(sl);
pItem->setFlags(Qt::ItemIsUserCheckable|Qt::ItemIsTristate|Qt::ItemIsEnabled|Qt::ItemIsSelectable);
pItem->setCheckState(0, Qt::Unchecked);
top->addChild(pItem);
triggerMap.insert(pItem, pChild);
recurseTriggers(pChild, pItem);
}
}
示例9: getTriggerPrivate
void TriggerUnit::reParentTrigger( int childID, int oldParentID, int newParentID, int parentPosition, int childPosition )
{
TTrigger * pOldParent = getTriggerPrivate( oldParentID );
TTrigger * pNewParent = getTriggerPrivate( newParentID );
TTrigger * pChild = getTriggerPrivate( childID );
if( ! pChild )
{
return;
}
if( pOldParent )
{
pOldParent->popChild( pChild );
}
else
{
mTriggerRootNodeList.remove( pChild );
}
if( pNewParent )
{
pNewParent->addChild( pChild, parentPosition, childPosition );
if( pChild ) pChild->setParent( pNewParent );
//cout << "dumping family of newParent:"<<endl;
//pNewParent->Dump();
}
else
{
pChild->Tree<TTrigger>::setParent( 0 );
addTriggerRootNode( pChild, parentPosition, childPosition, true );
}
}
示例10: reorderTriggersAfterPackageImport
// trigger matching order is permantent trigger objects first, temporary objects second
// after package import or module sync this order needs to be reset
void TriggerUnit::reorderTriggersAfterPackageImport()
{
QList<TTrigger *> tempList;
typedef list<TTrigger *>::const_iterator I;
for( I it = mTriggerRootNodeList.begin(); it != mTriggerRootNodeList.end(); it++)
{
TTrigger * pChild = *it;
if( pChild->isTempTrigger() )
{
tempList.push_back( pChild );
}
}
for( int i=0; i<tempList.size(); i++ )
{
mTriggerRootNodeList.remove( tempList[i] );
}
for( int i=0; i<tempList.size(); i++ )
{
mTriggerRootNodeList.push_back( tempList[i] );
}
}
示例11: TTrigger
void XMLimport::readTriggerGroup( TTrigger * pParent )
{
TTrigger * pT;
if( pParent )
{
pT = new TTrigger( pParent, mpHost );
}
else
{
pT = new TTrigger( 0, mpHost );
}
if (module){
pT->mModuleMember = true;
}
mpHost->getTriggerUnit()->registerTrigger( pT );
pT->setIsActive( (attributes().value("isActive") == "yes" ) );
pT->mIsFolder = ( attributes().value("isFolder") == "yes" );
pT->mIsTempTrigger = ( attributes().value("isTempTrigger") == "yes" );
pT->mIsMultiline = ( attributes().value("isMultiline") == "yes" );
pT->mPerlSlashGOption = ( attributes().value("isPerlSlashGOption") == "yes" );
pT->mIsColorizerTrigger = ( attributes().value("isColorizerTrigger") == "yes" );
pT->mFilterTrigger = ( attributes().value("isFilterTrigger") == "yes" );
pT->mSoundTrigger = ( attributes().value("isSoundTrigger") == "yes" );
pT->mColorTrigger = ( attributes().value("isColorTrigger") == "yes" );
pT->mColorTriggerBg = ( attributes().value("isColorTriggerBg") == "yes" );
pT->mColorTriggerFg = ( attributes().value("isColorTriggerFg") == "yes" );
while( ! atEnd() )
{
readNext();
//qDebug()<<"[INFO] element:"<<name().toString()<<" text:"<<text().toString();
if( isEndElement() ) break;
if( isStartElement() )
{
if( name() == "name" )
{
pT->setName( readElementText() );
continue;
}
else if( name() == "script")
{
pT->mScript = readElementText();
continue;
}
else if( name() == "packageName")
{
pT->mPackageName = readElementText();
continue;
}
else if( name() == "triggerType" )
{
pT->mTriggerType = readElementText().toInt();
continue;
}
else if( name() == "conditonLineDelta" )
{
pT->mConditionLineDelta = readElementText().toInt();
continue;
}
else if( name() == "mStayOpen" )
{
pT->mStayOpen = readElementText().toInt();
continue;
}
else if( name() == "mCommand" )
{
pT->mCommand = readElementText();
continue;
}
else if( name() == "mFgColor")
{
pT->mFgColor.setNamedColor( readElementText() );
continue;
}
else if( name() == "mBgColor")
{
pT->mBgColor.setNamedColor( readElementText() );
continue;
}
else if( name() == "colorTriggerFgColor")
{
pT->mColorTriggerFgColor.setNamedColor( readElementText() );
continue;
}
else if( name() == "colorTriggerBgColor")
{
pT->mColorTriggerBgColor.setNamedColor( readElementText() );
continue;
}
else if( name() == "mSoundFile" )
{
pT->mSoundFile = readElementText();
continue;
}
//.........这里部分代码省略.........
示例12: setDevice
bool XMLexport::writeModuleXML( QIODevice * device, QString moduleName){
setDevice(device);
qDebug()<<moduleName;
writeStartDocument();
writeDTD("<!DOCTYPE MudletPackage>");
writeStartElement( "MudletPackage" );
writeAttribute("version", "1.0");
qDebug()<<"starting writeModule routine";
writeStartElement( "TriggerPackage" );
Host * pT = mpHost;
bool ret = true;
int nodesWritten = 0;
//we go a level down for all these functions so as to not infinitely nest the module
typedef list<TTrigger *>::const_iterator ItTriggerUnit;
for( ItTriggerUnit it1 = pT->mTriggerUnit.mTriggerRootNodeList.begin(); it1 != pT->mTriggerUnit.mTriggerRootNodeList.end(); it1++ ) {
TTrigger * pChildTrigger = *it1;
if( ! pChildTrigger || pChildTrigger->mPackageName != moduleName ) continue;
if( ! pChildTrigger->isTempTrigger() && pChildTrigger->mModuleMember ) {
bool result = writeTrigger( pChildTrigger );
if( ! result )
ret = false;
nodesWritten+=1;
}
}
if( ! nodesWritten )
writeEndElement(); //end trigger package tag
nodesWritten=0;
writeStartElement( "TimerPackage" );
typedef list<TTimer *>::const_iterator ItTimerUnit;
for( ItTimerUnit it2 = pT->mTimerUnit.mTimerRootNodeList.begin(); it2 != pT->mTimerUnit.mTimerRootNodeList.end(); it2++ ) {
TTimer * pChildTimer = *it2;
if( ! pChildTimer || pChildTimer->mPackageName != moduleName ) continue;
if( ! pChildTimer->isTempTimer() && pChildTimer->mModuleMember ) {
bool result = writeTimer( pChildTimer );
if( ! result )
ret = false;
nodesWritten+=1;
}
}
if( ! nodesWritten )
writeEndElement(); //end trigger package tag
nodesWritten=0;
writeStartElement( "AliasPackage" );
typedef list<TAlias *>::const_iterator ItAliasUnit;
for( ItAliasUnit it3 = pT->mAliasUnit.mAliasRootNodeList.begin(); it3 != pT->mAliasUnit.mAliasRootNodeList.end(); it3++ ) {
TAlias * pChildAlias = *it3;
if( ! pChildAlias || pChildAlias->mPackageName != moduleName ) continue;
if( ! pChildAlias->isTempAlias() && pChildAlias->mModuleMember ) {
bool result = writeAlias( pChildAlias );
if( ! result )
ret = false;
nodesWritten+=1;
}
}
if( ! nodesWritten )
writeEndElement(); //end trigger package tag
nodesWritten=0;
writeStartElement( "ActionPackage" );
typedef list<TAction *>::const_iterator ItActionUnit;
for( ItActionUnit it4 = pT->mActionUnit.mActionRootNodeList.begin(); it4 != pT->mActionUnit.mActionRootNodeList.end(); it4++ ) {
TAction * pChildAction = *it4;
if( ! pChildAction || pChildAction->mPackageName != moduleName ) continue;
if( pChildAction->mModuleMember ) {
bool result = writeAction( pChildAction );
if( ! result )
ret = false;
nodesWritten+=1;
}
}
if( ! nodesWritten )
writeEndElement(); //end trigger package tag
nodesWritten=0;
writeStartElement( "ScriptPackage" );
typedef list<TScript *>::const_iterator ItScriptUnit;
for( ItScriptUnit it5 = pT->mScriptUnit.mScriptRootNodeList.begin(); it5 != pT->mScriptUnit.mScriptRootNodeList.end(); it5++ ) {
TScript * pChildScript = *it5;
if( ! pChildScript || pChildScript->mPackageName != moduleName ) continue;
if( pChildScript->mModuleMember ) {
bool result = writeScript( pChildScript );
if( ! result )
ret = false;
nodesWritten+=1;
}
}
if( ! nodesWritten )
writeEndElement(); //end trigger package tag
nodesWritten=0;
writeStartElement( "KeyPackage" );
typedef list<TKey *>::const_iterator ItKeyUnit;
for( ItKeyUnit it6 = pT->mKeyUnit.mKeyRootNodeList.begin(); it6 != pT->mKeyUnit.mKeyRootNodeList.end(); it6++ ) {
TKey * pChildKey = *it6;
if( ! pChildKey || pChildKey->mPackageName != moduleName ) continue;
if( pChildKey->mModuleMember ) {
//.........这里部分代码省略.........
示例13: writeStartElement
bool XMLexport::writeGenericPackage( Host * pT )
{
writeStartElement( "TriggerPackage" );
bool ret = true;
typedef list<TTrigger *>::const_iterator ItTriggerUnit;
for( ItTriggerUnit it1 = pT->mTriggerUnit.mTriggerRootNodeList.begin(); it1 != pT->mTriggerUnit.mTriggerRootNodeList.end(); it1++)
{
TTrigger * pChildTrigger = *it1;
if( ! pChildTrigger ) continue;
if( ! pChildTrigger->isTempTrigger())
{
ret = writeTrigger( pChildTrigger );
}
}
writeEndElement(); //end trigger package tag
writeStartElement("TimerPackage");
typedef list<TTimer *>::const_iterator ItTimerUnit;
for( ItTimerUnit it2 = pT->mTimerUnit.mTimerRootNodeList.begin(); it2 != pT->mTimerUnit.mTimerRootNodeList.end(); it2++)
{
TTimer * pChildTimer = *it2;
if( ! pChildTimer->isTempTimer())
{
ret = writeTimer( pChildTimer );
}
}
writeEndElement();
writeStartElement("AliasPackage");
typedef list<TAlias *>::const_iterator ItAliasUnit;
for( ItAliasUnit it3 = pT->mAliasUnit.mAliasRootNodeList.begin(); it3 != pT->mAliasUnit.mAliasRootNodeList.end(); it3++)
{
TAlias * pChildAlias = *it3;
if( ! pChildAlias->isTempAlias())
{
ret = writeAlias( pChildAlias );
}
}
writeEndElement();
writeStartElement("ActionPackage");
typedef list<TAction *>::const_iterator ItActionUnit;
for( ItActionUnit it4 = pT->mActionUnit.mActionRootNodeList.begin(); it4 != pT->mActionUnit.mActionRootNodeList.end(); it4++)
{
TAction * pChildAction = *it4;
ret = writeAction( pChildAction );
}
writeEndElement();
writeStartElement("ScriptPackage");
typedef list<TScript *>::const_iterator ItScriptUnit;
for( ItScriptUnit it5 = pT->mScriptUnit.mScriptRootNodeList.begin(); it5 != pT->mScriptUnit.mScriptRootNodeList.end(); it5++)
{
TScript * pChildScript = *it5;
ret = writeScript( pChildScript );
}
writeEndElement();
writeStartElement("KeyPackage");
typedef list<TKey *>::const_iterator ItKeyUnit;
for( ItKeyUnit it6 = pT->mKeyUnit.mKeyRootNodeList.begin(); it6 != pT->mKeyUnit.mKeyRootNodeList.end(); it6++)
{
TKey * pChildKey = *it6;
ret = writeKey( pChildKey );
}
writeEndElement();
return ret;
}
示例14: writeStartElement
bool XMLexport::writeHost( Host * pT )
{
writeStartElement( "Host" );
writeAttribute( "autoClearCommandLineAfterSend", pT->mAutoClearCommandLineAfterSend ? "yes" : "no" );
writeAttribute( "disableAutoCompletion", pT->mDisableAutoCompletion ? "yes" : "no" );
writeAttribute( "printCommand", pT->mPrintCommand ? "yes" : "no" );
writeAttribute( "USE_IRE_DRIVER_BUGFIX", pT->mUSE_IRE_DRIVER_BUGFIX ? "yes" : "no" );
writeAttribute( "mUSE_FORCE_LF_AFTER_PROMPT", pT->mUSE_FORCE_LF_AFTER_PROMPT ? "yes" : "no" );
writeAttribute( "mUSE_UNIX_EOL", pT->mUSE_UNIX_EOL ? "yes" : "no" );
writeAttribute( "mNoAntiAlias", pT->mNoAntiAlias ? "yes" : "no" );
writeAttribute( "mRawStreamDump", pT->mRawStreamDump ? "yes" : "no" );
writeAttribute( "mAlertOnNewData", pT->mAlertOnNewData ? "yes" : "no" );
writeAttribute( "mFORCE_NO_COMPRESSION", pT->mFORCE_NO_COMPRESSION ? "yes" : "no" );
writeAttribute( "mFORCE_GA_OFF", pT->mFORCE_GA_OFF ? "yes" : "no" );
writeAttribute( "mFORCE_SAVE_ON_EXIT", pT->mFORCE_SAVE_ON_EXIT ? "yes" : "no" );
writeAttribute( "mEnableGMCP", pT->mEnableGMCP ? "yes" : "no" );
writeAttribute( "mMapStrongHighlight", pT->mMapStrongHighlight ? "yes" : "no" );
writeAttribute( "mLogStatus", pT->mLogStatus ? "yes" : "no" );
writeAttribute( "mEnableSpellCheck", pT->mEnableSpellCheck ? "yes" : "no" );
writeAttribute( "mShowInfo", pT->mShowInfo ? "yes" : "no" );
writeAttribute( "mAcceptServerGUI", pT->mAcceptServerGUI ? "yes" : "no" );
writeAttribute( "mMapperUseAntiAlias", pT->mMapperUseAntiAlias ? "yes" : "no" );
writeAttribute( "mFORCE_MXP_NEGOTIATION_OFF", pT->mFORCE_MXP_NEGOTIATION_OFF ? "yes" : "no" );
writeTextElement( "name", pT->mHostName );
//writeTextElement( "login", pT->mLogin );
//writeTextElement( "pass", pT->mPass );
writeStartElement( "mInstalledPackages" );
for( int i=0; i<pT->mInstalledPackages.size(); i++ )
{
writeTextElement( "string", pT->mInstalledPackages[i] );
}
writeEndElement();
writeTextElement( "url", pT->mUrl );
writeTextElement( "serverPackageName", pT->mServerGUI_Package_name );
writeTextElement( "serverPackageVersion", QString::number(pT->mServerGUI_Package_version ) );
writeTextElement( "port", QString::number(pT->mPort) );
writeTextElement( "borderTopHeight", QString::number(pT->mBorderTopHeight) );
writeTextElement( "borderBottomHeight", QString::number(pT->mBorderBottomHeight) );
writeTextElement( "borderLeftWidth", QString::number(pT->mBorderLeftWidth) );
writeTextElement( "borderRightWidth", QString::number(pT->mBorderRightWidth) );
writeTextElement( "wrapAt", QString::number(pT->mWrapAt) );
writeTextElement( "wrapIndentCount", QString::number(pT->mWrapIndentCount) );
writeTextElement( "commandSeperator", pT->mCommandSeperator );
writeTextElement( "mFgColor", pT->mFgColor.name() );
writeTextElement( "mBgColor", pT->mBgColor.name() );
writeTextElement( "mCommandFgColor", pT->mCommandFgColor.name() );
writeTextElement( "mCommandBgColor", pT->mCommandBgColor.name() );
writeTextElement( "mCommandLineFgColor", pT->mCommandLineFgColor.name() );
writeTextElement( "mCommandLineBgColor", pT->mCommandLineBgColor.name() );
writeTextElement( "mBlack", pT->mBlack.name() );
writeTextElement( "mLightBlack", pT->mLightBlack.name() );
writeTextElement( "mRed", pT->mRed.name() );
writeTextElement( "mLightRed", pT->mLightRed.name() );
writeTextElement( "mBlue", pT->mBlue.name() );
writeTextElement( "mLightBlue", pT->mLightBlue.name() );
writeTextElement( "mGreen", pT->mGreen.name() );
writeTextElement( "mLightGreen", pT->mLightGreen.name() );
writeTextElement( "mYellow", pT->mYellow.name() );
writeTextElement( "mLightYellow", pT->mLightYellow.name() );
writeTextElement( "mCyan", pT->mCyan.name() );
writeTextElement( "mLightCyan", pT->mLightCyan.name() );
writeTextElement( "mMagenta", pT->mMagenta.name() );
writeTextElement( "mLightMagenta", pT->mLightMagenta.name() );
writeTextElement( "mWhite", pT->mWhite.name() );
writeTextElement( "mLightWhite", pT->mLightWhite.name() );
writeTextElement( "mDisplayFont", pT->mDisplayFont.toString() );
writeTextElement( "mCommandLineFont", pT->mCommandLineFont.toString() );
writeTextElement( "mCommandSeparator", pT->mCommandSeparator );
writeTextElement( "commandLineMinimumHeight", QString::number(pT->commandLineMinimumHeight) );
writeTextElement( "mFgColor2", pT->mFgColor_2.name() );
writeTextElement( "mBgColor2", pT->mBgColor_2.name() );
writeTextElement( "mBlack2", pT->mBlack_2.name() );
writeTextElement( "mLightBlack2", pT->mLightBlack_2.name() );
writeTextElement( "mRed2", pT->mRed_2.name() );
writeTextElement( "mLightRed2", pT->mLightRed_2.name() );
writeTextElement( "mBlue2", pT->mBlue_2.name() );
writeTextElement( "mLightBlue2", pT->mLightBlue_2.name() );
writeTextElement( "mGreen2", pT->mGreen_2.name() );
writeTextElement( "mLightGreen2", pT->mLightGreen_2.name() );
writeTextElement( "mYellow2", pT->mYellow_2.name() );
writeTextElement( "mLightYellow2", pT->mLightYellow_2.name() );
writeTextElement( "mCyan2", pT->mCyan_2.name() );
writeTextElement( "mLightCyan2", pT->mLightCyan_2.name() );
writeTextElement( "mMagenta2", pT->mMagenta_2.name() );
writeTextElement( "mLightMagenta2", pT->mLightMagenta_2.name() );
writeTextElement( "mWhite2", pT->mWhite_2.name() );
writeTextElement( "mLightWhite2", pT->mLightWhite_2.name() );
writeTextElement( "mSpellDic", pT->mSpellDic );
writeTextElement( "mLineSize", QString::number(pT->mLineSize) );
writeTextElement( "mRoomSize", QString::number(pT->mRoomSize) );
writeEndElement(); // end Host tag
writeEndElement(); // end HostPackage tag
writeStartElement( "TriggerPackage" );
bool ret = true;
typedef list<TTrigger *>::const_iterator ItTriggerUnit;
for( ItTriggerUnit it1 = pT->mTriggerUnit.mTriggerRootNodeList.begin(); it1 != pT->mTriggerUnit.mTriggerRootNodeList.end(); it1++)
//.........这里部分代码省略.........