示例#1
0
void ContextModel::setContext( QSharedPointer<fugio::ContextInterface> pContext )
{
	clearContext();

	mContext = pContext;

	fugio::ContextSignals		*CS = mContext->qobject();

	connect( CS, SIGNAL(clearContext()), this, SLOT(clearContext()) );

	connect( CS, SIGNAL(nodeAdded(QUuid)), this, SLOT(nodeAdded(QUuid)) );
	connect( CS, SIGNAL(nodeRemoved(QUuid)), this, SLOT(nodeRemoved(QUuid)) );
	connect( CS, SIGNAL(nodeRenamed(QUuid,QUuid)), this, SLOT(nodeRenamed(QUuid,QUuid)) );

	connect( CS, SIGNAL(pinAdded(QUuid,QUuid)), this, SLOT(pinAdded(QUuid,QUuid)) );
	connect( CS, SIGNAL(pinRemoved(QUuid,QUuid)), this, SLOT(pinRemoved(QUuid,QUuid)) );
	connect( CS, SIGNAL(pinRenamed(QUuid,QUuid,QUuid)), this, SLOT(pinRenamed(QUuid,QUuid,QUuid)) );

	connect( CS, SIGNAL(loadStart(QSettings&,bool)), this, SLOT(loadStarted(QSettings&,bool)) );
	connect( CS, SIGNAL(loadEnd(QSettings&,bool)), this, SLOT(loadEnded(QSettings&,bool)) );

	//	if( QSharedPointer<ContextPrivate> C = qSharedPointerCast<ContextPrivate>( mContext ) )
	//	{
	//		connect( C.data(), SIGNAL(loading(QSettings&,bool)), this, SLOT(loadContext(QSettings&,bool)) );

	//		connect( C.data(), SIGNAL(saving(QSettings&)), this, SLOT(saveContext(QSettings&)) );

	//		connect( C.data(), SIGNAL(nodeUpdated(QUuid)), this, SLOT(nodeChanged(QUuid)) );
	//		connect( C.data(), SIGNAL(nodeActivated(QUuid)), this, SLOT(nodeActivated(QUuid)) );

	//		connect( C.data(), SIGNAL(linkAdded(QUuid,QUuid)), this, SLOT(linkAdded(QUuid,QUuid)) );
	//		connect( C.data(), SIGNAL(linkRemoved(QUuid,QUuid)), this, SLOT(linkRemoved(QUuid,QUuid)) );
	//	}


	MainWindow		*MW = gApp->mainWindow();

	QDockWidget		*DW = new QDockWidget( "Context Model", MW );

	DW->setObjectName( "ContextModel" );

	QTreeView		*TV = new QTreeView( DW );

	TV->setModel( this );

	DW->setWidget( TV );

	MW->addDockWidget( Qt::RightDockWidgetArea, DW );
}
示例#2
0
		 BrokerResponseContext& operator = (BrokerResponseContext const &src)
		 {
				clearContext();

				if (src.data_m) {
					data_m = src.data_m->clone();
				}

				return *this;
		 }
示例#3
0
void QQmlContextData::destroy()
{
    Q_ASSERT(refCount == 0);
    linkedContext = 0;

    // avoid recursion
    ++refCount;
    if (engine)
        invalidate();

    Q_ASSERT(refCount == 1);
    clearContext();
    Q_ASSERT(refCount == 1);

    while (contextObjects) {
        QQmlData *co = contextObjects;
        contextObjects = contextObjects->nextContextObject;

        co->context = 0;
        co->outerContext = 0;
        co->nextContextObject = 0;
        co->prevContextObject = 0;
    }
    Q_ASSERT(refCount == 1);

    QQmlGuardedContextData *contextGuard = contextGuards;
    while (contextGuard) {
        QQmlGuardedContextData *next = contextGuard->m_next;
        contextGuard->m_next = 0;
        contextGuard->m_prev = 0;
        contextGuard->m_contextData = 0;
        contextGuard = next;
    }
    contextGuards = 0;
    Q_ASSERT(refCount == 1);

    delete [] idValues;
    idValues = 0;

    Q_ASSERT(refCount == 1);
    if (publicContext) {
        // the QQmlContext destructor will remove one ref again
        ++refCount;
        delete publicContext;
    }

    Q_ASSERT(refCount == 1);
    --refCount;
    Q_ASSERT(refCount == 0);

    delete this;
}
/** 
 * constructor used in building SOLICIT message
 * 
 * @param ClntCfgPD 
 * @param parent 
 */
TClntOptIA_PD::TClntOptIA_PD(SPtr<TClntCfgPD> cfgPD, TMsg* parent)
    :TOptIA_PD(cfgPD->getIAID(), cfgPD->getT1(), cfgPD->getT2(), parent)
{
    cfgPD->firstPrefix();
    SPtr<TClntCfgPrefix> cfgPrefix;
    while (cfgPrefix = cfgPD->getPrefix() ) {
        SubOptions.append(new TClntOptIAPrefix(cfgPrefix->get(),
                                               cfgPrefix->getPref(),
                                               cfgPrefix->getValid(),
                                               cfgPrefix->getLength(), 0));
    }
    clearContext();
}
示例#5
0
void QDeclarativeContextData::destroy()
{
    if (linkedContext)
        linkedContext->destroy();

    if (engine) invalidate();

    clearContext();

    while (contextObjects) {
        QDeclarativeData *co = contextObjects;
        contextObjects = contextObjects->nextContextObject;

        co->context = 0;
        co->outerContext = 0;
        co->nextContextObject = 0;
        co->prevContextObject = 0;
    }

    QDeclarativeGuardedContextData *contextGuard = contextGuards;
    while (contextGuard) {
        QDeclarativeGuardedContextData *next = contextGuard->m_next;
        contextGuard->m_next = 0;
        contextGuard->m_prev = 0;
        contextGuard->m_contextData = 0;
        contextGuard = next;
    }
    contextGuards = 0;

    if (propertyNames)
        propertyNames->release();

    if (imports)
        imports->release();

    if (optimizedBindings)
        optimizedBindings->release();

    delete [] idValues;

    if (isInternal)
        delete publicContext;

    delete this;
}
示例#6
0
void DOMTimer::fired()
{
    ExecutionContext* context = getExecutionContext();
    ASSERT(context);
    context->timers()->setTimerNestingLevel(m_nestingLevel);
    ASSERT(!context->activeDOMObjectsAreSuspended());
    // Only the first execution of a multi-shot timer should get an affirmative user gesture indicator.
    UserGestureIndicator gestureIndicator(m_userGestureToken.release());

    TRACE_EVENT1("devtools.timeline", "TimerFire", "data", InspectorTimerFireEvent::data(context, m_timeoutID));
    InspectorInstrumentation::NativeBreakpoint nativeBreakpoint(context, "timerFired", false);
    InspectorInstrumentation::AsyncTask asyncTask(context, this);

    // Simple case for non-one-shot timers.
    if (isActive()) {
        if (repeatInterval() && repeatInterval() < minimumInterval) {
            m_nestingLevel++;
            if (m_nestingLevel >= maxTimerNestingLevel)
                augmentRepeatInterval(minimumInterval - repeatInterval());
        }

        // No access to member variables after this point, it can delete the timer.
        m_action->execute(context);
        return;
    }

    // Unregister the timer from ExecutionContext before executing the action
    // for one-shot timers.
    ScheduledAction* action = m_action.release();
    context->timers()->removeTimeoutByID(m_timeoutID);

    action->execute(context);

    TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "UpdateCounters", TRACE_EVENT_SCOPE_THREAD, "data", InspectorUpdateCountersEvent::data());

    // ExecutionContext might be already gone when we executed action->execute().
    ExecutionContext* executionContext = getExecutionContext();
    if (!executionContext)
        return;

    executionContext->timers()->setTimerNestingLevel(0);
    // Eagerly unregister as ExecutionContext observer.
    clearContext();
}
/** 
 * Used to create object from received message
 * 
 * @param buf 
 * @param bufsize 
 * @param parent 
 */
TClntOptIA_PD::TClntOptIA_PD(char * buf,int bufsize, TMsg* parent)
:TOptIA_PD(buf,bufsize, parent)
{
    int pos=0;
    while(pos<bufsize) 
    {
        int code=buf[pos]*256+buf[pos+1];
        pos+=2;
        int length=buf[pos]*256+buf[pos+1];
       	pos+=2;
        if ((code>0)&&(code<=26))
        {                
	        if(allowOptInOpt(parent->getType(),OPTION_IA_PD,code))
            {
		        SPtr<TOpt> opt= SPtr<TOpt>();
                switch (code)
                {
                case OPTION_IAPREFIX:
        		        SubOptions.append( new TClntOptIAPrefix(buf+pos,length,this->Parent));
                    break;
                case OPTION_STATUS_CODE:
                    SubOptions.append( new TClntOptStatusCode(buf+pos,length,this->Parent));
                    break;
                default:
	                Log(Warning) << "Option opttype=" << code<< "not supported "
                                 << " in field of message (type="<< parent->getType() 
                                 << ") in this version of server."<<LogEnd;
                    break;
                }
                if((opt)&&(opt->isValid()))
                    SubOptions.append(opt);
            } else
		    Log(Warning) << "Illegal option received, opttype=" << code 
                         << " in field options of IA_PD option" << LogEnd;
        } else {
	        Log(Warning) << "Unknown option in option IA_NA(optType=" 
			     << code << "). Option ignored." << LogEnd;
        };
        pos+=length;
    }

    clearContext();
}
示例#8
0
void ContextPrivate::clear( void )
{
	for( QUuid ID : mNodeHash.keys() )
	{
		unregisterNode( ID );
	}

	// disconnect all pins

	for( QUuid PID : mConnectIO.keys() )
	{
		disconnectPin( PID );
	}

	for( QSharedPointer<fugio::NodeInterface> N : mNodeHash.values() )
	{
		if( NodePrivate *NP = qobject_cast<NodePrivate *>( N->qobject() ) )
		{
			NP->clear();
		}
	}

	emit clearContext();

	QMutexLocker	MutLck( &mUpdatePinMapMutex );

	mUpdatedNodeList.clear();
	mFinishedNodeList.clear();
	mInitDeferNodeList.clear();

	mUpdatePinMap.clear();

	mNodeHash.clear();
	mPinHash.clear();

	mConnectIO.clear();
	mConnectOI.clear();

	mMetaInfoMap.clear();
}
/** 
 * Used in REQUEST, RENEW, REBIND, DECLINE and RELEASE
 * 
 * @param addrPD 
 * @param parent 
 */
TClntOptIA_PD::TClntOptIA_PD(SPtr<TAddrIA> addrPD, TMsg* parent)
    :TOptIA_PD(addrPD->getIAID(),addrPD->getT1(),addrPD->getT2(), parent)
{
    
    bool zeroTimes = false;
    if ( (parent->getType()==RELEASE_MSG) || (parent->getType()==DECLINE_MSG)) {
        this->T1 = 0;
        this->T2 = 0;
	    zeroTimes = true;
    }

    clearContext();

    SPtr<TAddrPrefix> ptrPrefix;
    addrPD->firstPrefix();
    while ( ptrPrefix = addrPD->getPrefix() )
    {
	SubOptions.append(new TClntOptIAPrefix(ptrPrefix->get(), zeroTimes?0:ptrPrefix->getPref(), 
					       zeroTimes?0:ptrPrefix->getValid(), 
					       ptrPrefix->getLength(), this->Parent) );
    }
}
示例#10
0
ContextModel::~ContextModel()
{
	clearContext();
}
示例#11
0
 void dispose() {
   m_parent = nullptr;
   clearContext();
 }
示例#12
0
		 void setContext(BrokerContext const& brkCtx)
		 {
				clearContext();
				data_m = brkCtx.clone();
			 
		 }
示例#13
0
		~BrokerResponseContext()
		{
			clearContext();
		}