Exemplo n.º 1
0
void P2PConnection::OnSocketConnected(OpSocket* socket)
{
	ENTER_METHOD;

	AddRef();

	if(m_closing)
	{
		// we are closing, do nothing
//		m_observer = &m_nullobserver;
		if(m_socket.Get() != NULL)
		{
//			m_socket.Get()->SetObserver(&m_nullobserver);
		}
		Release();
		return;
	}
	DEBUGTRACE_CONNECT(UNI_L("CONNECTED TO: %s, "), (uni_char *)m_address);
	DEBUGTRACE8_CONNECT(UNI_L("this: 0x%08x, socket: "), this);
	DEBUGTRACE8_CONNECT(UNI_L("0x%08x\n"), socket);

	m_initiated = TRUE;
	m_connectedTime = op_time(NULL);
	m_connected = TRUE;

	Observer().AddRef();
	Observer().OnP2PConnected(this);
	Observer().Release();

	Release();

	LEAVE_METHOD;
}
Exemplo n.º 2
0
void
nsMutationReceiver::ContentInserted(nsIDocument* aDocument,
                                    nsIContent* aContainer,
                                    nsIContent* aChild,
                                    int32_t aIndexInContainer)
{
  nsINode* parent = NODE_FROM(aContainer, aDocument);
  bool wantsChildList = ChildList() && (Subtree() || parent == Target());
  if (!wantsChildList || aChild->ChromeOnlyAccess()) {
    return;
  }

  if (nsAutoMutationBatch::IsBatching()) {
    if (parent == nsAutoMutationBatch::GetBatchTarget()) {
      nsAutoMutationBatch::UpdateObserver(Observer(), wantsChildList);
    }
    return;
  }

  nsDOMMutationRecord* m =
    Observer()->CurrentRecord(NS_LITERAL_STRING("childList"));
  if (m->mTarget) {
    // Already handled case.
    return;  
  }
  m->mTarget = parent;
  m->mAddedNodes = new nsSimpleContentList(parent);
  m->mAddedNodes->AppendElement(aChild);
  m->mPreviousSibling = aChild->GetPreviousSibling();
  m->mNextSibling = aChild->GetNextSibling();
}
void
nsAnimationReceiver::RecordAnimationMutation(Animation* aAnimation,
                                             AnimationMutation aMutationType)
{
  KeyframeEffectReadonly* effect = aAnimation->GetEffect();
  if (!effect) {
    return;
  }

  Element* animationTarget = effect->GetTarget();
  if (!animationTarget) {
    return;
  }

  if (!Animations() || !(Subtree() || animationTarget == Target()) ||
      animationTarget->ChromeOnlyAccess()) {
    return;
  }

  if (nsAutoAnimationMutationBatch::IsBatching()) {
    if (nsAutoAnimationMutationBatch::GetBatchTarget() != animationTarget) {
      return;
    }

    switch (aMutationType) {
      case eAnimationMutation_Added:
        nsAutoAnimationMutationBatch::AnimationAdded(aAnimation);
        break;
      case eAnimationMutation_Changed:
        nsAutoAnimationMutationBatch::AnimationChanged(aAnimation);
        break;
      case eAnimationMutation_Removed:
        nsAutoAnimationMutationBatch::AnimationRemoved(aAnimation);
        break;
    }

    nsAutoAnimationMutationBatch::AddObserver(Observer());
    return;
  }

  nsDOMMutationRecord* m =
    Observer()->CurrentRecord(nsGkAtoms::animations);

  NS_ASSERTION(!m->mTarget, "Wrong target!");

  m->mTarget = animationTarget;

  switch (aMutationType) {
    case eAnimationMutation_Added:
      m->mAddedAnimations.AppendElement(aAnimation);
      break;
    case eAnimationMutation_Changed:
      m->mChangedAnimations.AppendElement(aAnimation);
      break;
    case eAnimationMutation_Removed:
      m->mRemovedAnimations.AppendElement(aAnimation);
      break;
  }
}
Exemplo n.º 4
0
void TestCaseMulticaster::testSingleUnsubscribe ()
{
    // Make sure we can unsubscribe one of two observers on the same address
    Value value;

    Assert ( m_multicaster->subscribe ( m_o1, "alpha" ) );
    Assert ( m_multicaster->subscribe ( m_o2, "alpha" ) );
    Assert ( m_multicaster->unsubscribe ( m_o1, "alpha" ) );
    Assert ( m_multicaster->publish ( NULL, "alpha", value ) );

    Assert ( *m_o1 == Observer () );
    Assert ( *m_o2 == Observer ( "alpha", 1 ) );

}
void
nsMutationReceiver::CharacterDataWillChange(nsIDocument *aDocument,
                                            nsIContent* aContent,
                                            CharacterDataChangeInfo* aInfo)
{
  if (nsAutoMutationBatch::IsBatching() ||
      !CharacterData() ||
      (!Subtree() && aContent != Target()) ||
      (Subtree() && RegisterTarget()->SubtreeRoot() != aContent->SubtreeRoot()) ||
      !IsObservable(aContent)) {
    return;
  }

  nsDOMMutationRecord* m =
    Observer()->CurrentRecord(nsGkAtoms::characterData);

  NS_ASSERTION(!m->mTarget || m->mTarget == aContent,
               "Wrong target!");

  if (!m->mTarget) {
    m->mTarget = aContent;
  }
  if (CharacterDataOldValue() && m->mPrevValue.IsVoid()) { 
    aContent->GetText()->AppendTo(m->mPrevValue);
  }
}
// -----------------------------------------------------------------------------
// CRemConTspController::AddressIncomingNotify
// Defines remote targets to which notify will be sent.
// (other items were commented in a header).
// -----------------------------------------------------------------------------
//
void CRemConTspController::AddressIncomingNotify(
		TUid aInterfaceUid,
		TUint aOperationId,
		TSglQue<TClientInfo>& aClients)
	{
	COM_TRACE_( "[REMCONTSPCONTROLLER] CRemConTspController::AddressIncomingNotify() start" );
	COM_TRACE_2( "[REMCONTSPCONTROLLER] aInterfaceUid = %d, aOperationId = %d", aInterfaceUid.iUid, aOperationId );
	(void)aInterfaceUid;
	(void)aOperationId;

	TClientInfo* clientInfo = aClients.First();
	TSglQueIter<TClientInfo> iter( aClients );
	TClientInfo* target = iter;
	
	while( target )
		{
		if( target->SecureId().iId == KUid3MusicPlayer )
			{
			COM_TRACE_1( "[REMCONTSPCONTROLLER] Command is sent only to PlaybackUI running in process identified by secure id=%d", target->SecureId().iId );
			break;	// get out from while-loop
			}
		iter++;
		target = iter;
		}

	Observer().IncomingNotifyAddressed(target, KErrNone);

	COM_TRACE_( "[REMCONTSPCONTROLLER] CRemConTspController::AddressIncomingCommand() ends" );

	}
// ---------------------------------------------------------
// CMMKeyBearer::ConstructL()
// 2nd-phase construction.
// ---------------------------------------------------------
//
void CMMKeyBearer::ConstructL()
    {
    FUNC_LOG;

    // throw an indication up to RemCon.
    TRemConAddress addr;
    addr.BearerUid() = Uid();
    TInt err = Observer().ConnectIndicate(addr);
    iKeyguardAccess = CKeyguardAccessApi::NewL();

    // Start Active object for listening key events from P&S
    TRAP_AND_LEAVE(
        iMMKeyBearerObserver = CMMKeyBearerObserver::NewL(*this, ESideVolumeKeys),
        "Volume key observer init failed" );

    TRAP_AND_LEAVE(
        iMediaKeyObserver = CMMKeyBearerObserver::NewL(*this, EMediaKeys),
        "Media key observer init failed" );

    TRAP_AND_LEAVE(
        iAccessoryVolKeyObserver = CMMKeyBearerObserver::NewL(*this, EAccessoryVolumeKeys),
        "Accessory key observer init failed" );

    TRAP_AND_LEAVE(
        iUSBFileTransferObserver = CMMKeyBearerObserver::NewL(*this, EFileTransferStatus),
        "USB observer init failed" );
    }
/** Procedure is done.
*/  
void CMtLrStateMachine::ProcedureDone()
	{
	// If a location response error has been reported then forward it to network
	if (KErrNone != LocRespReason())
		{
		CNetworkInterface::TNetworkError netError = 
						Observer().Network()->LocationResp(LocRespReason());
		// Handle network-related error
		if (CNetworkInterface::ENone != netError)
			{
			Observer().NetworkErrorReported();
			}
		}
	// Procedure is complete
	CompleteProcedure();
	}
void CIAUpdateSelfUpdaterCtrl::RendezvousComplete( 
    TInt aErrorCode )
    {
    // Self updater finished its job and informed about it by setting the
    // rendezvous complete.
    Observer().SelfUpdaterComplete( aErrorCode );
    }
Exemplo n.º 10
0
void TestCaseMulticaster::testMultipleHeterogenousPublish ()
{
    // Make sure we can multicast to several addresses at once
    Value value;

    Assert ( m_multicaster->subscribe ( m_o1, "alpha" ) );
    Assert ( m_multicaster->subscribe ( m_o2, "beta" ) );
    Assert ( m_multicaster->subscribe ( m_o3, "alpha" ) );
    Assert ( m_multicaster->subscribe ( m_o4, "beta" ) );
    Assert ( m_multicaster->publish (NULL, "alpha", value) );

    Assert ( *m_o1 == Observer ( "alpha", 1 ) );
    Assert ( *m_o2 == Observer () );
    Assert ( *m_o3 == Observer ( "alpha", 1 ) );
    Assert ( *m_o4 == Observer () );

}
Exemplo n.º 11
0
void P2PConnection::OnSocketDataSent(OpSocket* socket, unsigned int bytes_sent)
{
//	OP_ASSERT(m_socket == socket);

	if(m_closing)
	{
		// we are closing, do nothing
		return;
	}
	AddRef();

	Observer().AddRef();
	Observer().OnP2PDataSent(this, m_last_buffer_sent, bytes_sent);
	Observer().Release();

	Release();
}
Exemplo n.º 12
0
void P2PConnection::OnSocketConnectError(OpSocket* socket, OpSocket::Error socket_error)
{
	ENTER_METHOD;

	AddRef();

	if(m_closing == FALSE)
	{
		Observer().AddRef();
		Observer().OnP2PConnectError(this, socket_error);
		Observer().Release();
	}
	m_socket.Release();

	Release();

	LEAVE_METHOD;
}
Exemplo n.º 13
0
void MulticasterTest::testMultipleHomogenousPublish ()
{
    // Make sure we can multicast to an address
    Value value;

    assert (m_multicaster->subscribe (m_o1, "alpha"));
    assert (m_multicaster->subscribe (m_o2, "alpha"));
    assert (m_multicaster->subscribe (m_o3, "alpha"));
    assert (m_multicaster->subscribe (m_o4, "alpha"));
    assert (m_multicaster->publish (NULL, "alpha", value));

    assert (*m_o1 == Observer ("alpha", 1));
    assert (*m_o2 == Observer ("alpha", 1));
    assert (*m_o3 == Observer ("alpha", 1));
    assert (*m_o4 == Observer ("alpha", 1));


}
Exemplo n.º 14
0
void P2PConnection::OnSocketClosed(OpSocket* socket)
{
	ENTER_METHOD;

	AddRef();

	m_connected = FALSE;

	if(m_closing == FALSE)
	{
		Observer().AddRef();
		Observer().OnP2PDisconnected(this);
		Observer().Release();
	}
	Release();

	LEAVE_METHOD;
}
Exemplo n.º 15
0
    /**
     * Run the analysis on 2 files
     */
    void IterativeAnalyzer::RunAnalysis(ostream& report_file) {
    	// parse configuration
    	if (WideningStrategy.size() == 0) { // set the default widening strategy to be by-equivalence (guards are not supported so far)
    		WideningStrategy.addValue(AnalysisConfiguration::kWideningStrategyEquiv);
		}
    	AnalysisConfiguration::PrintConfigurationHeader();
    	APAbstractDomain::ValTy::mgr_ptr_ = AnalysisConfiguration::ParseManager(ManagerType);
    	APAbstractDomain::ValTy::partition_point_ = AnalysisConfiguration::ParsePartitionPoint(PartitionPoint);
    	APAbstractDomain::ValTy::partition_strategy_ = AnalysisConfiguration::ParsePartitionStrategy(PartitionStrategy);
    	APAbstractDomain::ValTy::widening_point_ = AnalysisConfiguration::ParseWideningPoint(WideningPoint);
    	APAbstractDomain::ValTy::widening_strategy_ = AnalysisConfiguration::ParseWideningStrategy(WideningStrategy);
    	APAbstractDomain::ValTy::widening_threshold_ = AnalysisConfiguration::ParseWideningThreshold(WideningThreshold);
    	int k = AnalysisConfiguration::ParseInterleavignLookaheadWindow(InterleavingLookaheadWindow);
    	int p = AnalysisConfiguration::ParseInterleavignLookaheadPartition(InterleavingLookaheadPartition);
    	AnalysisConfiguration::PrintConfigurationFooter();

    	// extract an AST from each of the files
    	CodeHandler code(InputFilename), code2(InputFilename2);
    	ASTContext * contex_ptr = code.getAST(),
    			   * contex2_ptr = code2.getAST();

    	// place functions in a map according to name (so they are easily matched)
		map<string,const FunctionDecl*> functions, functions2;
		Utils::CreateFunctionsMap(contex_ptr->getTranslationUnitDecl(),functions);
		Utils::CreateFunctionsMap(contex2_ptr->getTranslationUnitDecl(),functions2);

    	// the context manager is needed to produce a CFG
		AnalysisContextManager context_manager;
		// iterate over functions, match them, and perform the dual analysis
		for (map<string,const FunctionDecl*>::const_iterator iter = functions.begin(), end = functions.end(); iter != end; ++iter) {
			const FunctionDecl* fd = iter->second;
			if (!fd->isThisDeclarationADefinition())
				continue;
			const FunctionDecl* fd2 = functions2[iter->first];
			if (!fd2) // no matching for the function in the 2nd AST
				continue;
			CFG * cfg_ptr = context_manager.getContext(fd)->getCFG(), * cfg2_ptr = context_manager.getContext(fd2)->getCFG();
#if (DEBUG)
			cerr << "Found both cfgs for " << iter->first << ":\n";
			cfg_ptr->dump(LangOptions());
			cfg2_ptr->dump(LangOptions());
			getchar();
#endif
			// this codes sets up the observer to use the first cfg
			// an observer is what we used to report the results
			// this could be defined using the second cfg as well
			APAbstractDomain domain(*cfg_ptr);
			domain.InitializeValues(*cfg_ptr);
			APChecker Observer(*contex_ptr,code.getDiagnosticsEngine(), code.getPreprocessor());
			domain.getAnalysisData().Observer = &Observer;
			domain.getAnalysisData().setContext(*contex_ptr);
			IterativeSolver is(domain,k,p);
			is.AssumeInputEquivalence(fd,fd2);
			is.RunOnCFGs(cfg_ptr,cfg2_ptr);

		}
    }
Exemplo n.º 16
0
void P2PConnection::OnSocketReceiveError(OpSocket* socket, OpSocket::Error socket_error)
{
	ENTER_METHOD;

	AddRef();

	// blocking is not an error
	if (m_closing == FALSE &&
		socket_error != OpSocket::SOCKET_BLOCKING)
	{
		Observer().AddRef();
		Observer().OnP2PReceiveError(this, socket_error);
		Observer().Release();
		StartClosing();
		m_socket.Release();
	}
	Release();

	LEAVE_METHOD;
}
Exemplo n.º 17
0
// Destructor
CBmbPlugin::~CBmbPlugin()
	{
	TRACE_FUNC_ENTRY
	delete iListener;
	delete iPlayerControlListener;
	if( iConnIndicated )
    	{
        Observer().DisconnectIndicate(iRemConAddress);	
      	}
	TRACE_FUNC_EXIT
	}
Exemplo n.º 18
0
void TestCaseMulticaster::testSinglePublish ()
{
    // Make sure we can subscribe and publish to an address
    Value value;

    Assert ( m_multicaster->subscribe ( m_o1, "alpha" ) );
    Assert ( m_multicaster->publish ( NULL, "alpha", value ) );

    Assert ( *m_o1 == Observer ( "alpha", 1 ) );

}
// -----------------------------------------------------------------------------
// CRemConTspController::AddressOutgoingCommand
// Defines bearers (represents remote target) to which command will be sent. 
// (other items were commented in a header).
// -----------------------------------------------------------------------------
//
void CRemConTspController::AddressOutgoingCommand(
		TUid aInterfaceUid,
		TUint aOperationId, 
		const TClientInfo& aSender,
		TSglQue<TRemConAddress>& aConnections,
		TSglQue<TBearerSecurity>& aBearerSecurity)
	{
	COM_TRACE_( "[REMCONTSPCONTROLLER] CRemConTspController::AddressOutgoingCommand() starts" );
	
	// Avoid warnings for unused parameters
	(void)aInterfaceUid;
	(void)aOperationId;
	(void)aSender;
		
	TInt err = KErrNotFound;
	TSglQueIter<TBearerSecurity> iter( aBearerSecurity );
	TBearerSecurity* sec = iter;
	
	// Go through all bearers
	while( sec )
		{
		// No security check in this version.
		// Could maybe be smth like "if ( sec->SecurityPolicy().CheckPolicy( aSender.Message() ) )"
				
		// Address command to all given bearers
		TRemConAddress* conn = NULL;
		conn = new TRemConAddress;
		if ( conn )
			{
			COM_TRACE_1( "[REMCONTSPCONTROLLER] Sender's secure id = %d", aSender.SecureId().iId );
			COM_TRACE_1( "[REMCONTSPCONTROLLER] Command sent to bearer %d", sec->BearerUid().iUid );
						
			conn->BearerUid().iUid = sec->BearerUid().iUid; 
			// No connection-specific data for this bearer.
			// Ownership of conn is passed back to RemCon.
			aConnections.AddLast( *conn );
			err = KErrNone;
			}
		else
			{
			COM_TRACE_1( "[REMCONTSPCONTROLLER] Memory allocation failed for bearer %d", sec->BearerUid().iUid );
			
			err = KErrNoMemory;
			break;	// Get out from while() and return KErrNoMemory
			}
		iter++;
		sec = iter;
		}

	COM_TRACE_1( "[REMCONTSPCONTROLLER] CRemConTspController::AddressOutgoingCommand() err=%d", err );
	Observer().OutgoingCommandAddressed( err );
	
	COM_TRACE_( "[REMCONTSPCONTROLLER] CRemConTspController::AddressOutgoingCommand() ends" );
	}
Exemplo n.º 20
0
void AnalysisConsumer::AnalyzeFunction(CFG& cfg, ASTContext &contex, unsigned &report_ctr) {
        // Compute the ranges information.
    	cfg.print(llvm::outs(),LangOptions());
        APAbstractDomain Dom(cfg);
        Dom.InitializeValues(cfg);
        APChecker Observer(contex,diagnostics_engine_, preprocessor_ptr_);
        Dom.getAnalysisData().Observer = &Observer;
        Dom.getAnalysisData().setContext(contex);
        Solver S(Dom);
        S.runOnCFG(cfg, true);
        Observer.ObserveFixedPoint(true, compute_diff_, report_ctr);
    }
Exemplo n.º 21
0
void TestCaseMulticaster::testMultipleUnsubscribe ()
{
    // Make sure we unsubscribe all occurrences of an observer on the same address
    Value value;

    Assert ( m_multicaster->subscribe ( m_o1, "alpha ") );
    Assert ( m_multicaster->subscribe ( m_o1, "alpha ") );
    Assert ( m_multicaster->unsubscribe ( m_o1, "alpha ") );
    Assert ( m_multicaster->publish ( NULL, "alpha", value ) );
    Assert ( *m_o1 == Observer () );

}
void
nsMutationReceiver::ContentAppended(nsIDocument* aDocument,
                                    nsIContent* aContainer,
                                    nsIContent* aFirstNewContent,
                                    int32_t aNewIndexInContainer)
{
  nsINode* parent = NODE_FROM(aContainer, aDocument);
  bool wantsChildList =
    ChildList() &&
    ((Subtree() && RegisterTarget()->SubtreeRoot() == parent->SubtreeRoot()) ||
     parent == Target());
  if (!wantsChildList || !IsObservable(aFirstNewContent)) {
    return;
  }

  if (nsAutoMutationBatch::IsBatching()) {
    if (parent == nsAutoMutationBatch::GetBatchTarget()) {
      nsAutoMutationBatch::UpdateObserver(Observer(), wantsChildList);
    }
    return;
  }

  nsDOMMutationRecord* m =
    Observer()->CurrentRecord(nsGkAtoms::childList);
  NS_ASSERTION(!m->mTarget || m->mTarget == parent,
               "Wrong target!");
  if (m->mTarget) {
    // Already handled case.
    return;
  }
  m->mTarget = parent;
  m->mAddedNodes = new nsSimpleContentList(parent);

  nsINode* n = aFirstNewContent;
  while (n) {
    m->mAddedNodes->AppendElement(static_cast<nsIContent*>(n));
    n = n->GetNextSibling();
  }
  m->mPreviousSibling = aFirstNewContent->GetPreviousSibling();
}
Exemplo n.º 23
0
//---------------------------------------------------------------------------------------
Observer* EventNotifier::add_observer_for(Observable* target)
{
    std::list<Observer*>::iterator it;
    for (it = m_observers.begin(); it != m_observers.end(); ++it)
    {
        if ((*it)->target() == target)
            return *it;
    }

    Observer* observer = LOMSE_NEW Observer(target);
    m_observers.push_back(observer);
    return observer;
}
Exemplo n.º 24
0
/** Timer expired callback.
This is called by a CStateTimer object when the timer
has expired - the event is identified by aEvent parameter.
@param aTimerId The timer event identifier.
*/
void CMtLrStateMachine::OnTimerEventL(TInt aTimerId)
	{
	// Perform relevant action for the expired timer
	switch (aTimerId)
		{

	// MT-LR request timer
	case KMtLrReqIssuedTimerEvent:
		iPrivacyResp = CLbsNetworkProtocolBase::EPrivacyResponseUnknown;
		CancelMachine(ECancelClientTimeout);
		break;

	// Measurement control timer
	case KMeasureControlTimerEvent:
		// Inform protocol manager
		Observer().MeasurementControlTimeout();
		break;

	// Additional assistance data timer
	case KAssistDataTimerEvent:
		// Ensure assistance data action is performed upon cancellation
		iAssistanceDataActionRequired = ETrue;
		// Inform protocol manager
		Observer().MeasurementControlTimeout();
		break;

	// Location response timer
	case KLocRespTimerEvent:
		iLocRespReason = KErrTimedOut;
		CancelMachine(ECancelClientTimeout);
		break;

	// Ignore unknown timer events
	default:
		break;

		};

	}
Exemplo n.º 25
0
void TestCaseMulticaster::testComplexUnsubscribeAll ()
{
    // Make sure we unsubscribe all occurrences of an observer on all addresses
    // in the presence of many observers
    Value value;

    Assert ( m_multicaster->subscribe ( m_o1, "alpha" ) );
    Assert ( m_multicaster->subscribe ( m_o1, "beck" ) );
    Assert ( m_multicaster->subscribe ( m_o1, "gamma" ) );
    Assert ( m_multicaster->subscribe ( m_o2, "beck" ) );
    Assert ( m_multicaster->subscribe ( m_o2, "gamma" ) );
    Assert ( m_multicaster->subscribe ( m_o2, "demeter" ) );
    m_multicaster->unsubscribeFromAll ( m_o2 );

    Assert ( m_multicaster->publish ( NULL, "alpha", value) );
    Assert ( m_multicaster->publish ( NULL, "beck", value) );
    Assert ( m_multicaster->publish ( NULL, "gamma", value) );
    Assert ( m_multicaster->publish ( NULL, "demeter", value) );
    Assert ( *m_o1 == Observer ( "gamma", 3 ) );
    Assert ( *m_o2 == Observer () );

}
Exemplo n.º 26
0
int main(){
	lv_system System(2.0, 3.0, 4.0, 5.0);
	lv_system::state State = {1.0,0.5};

	std::cout << "time=0 " << "x=" << State[0] << " " << "y=" << State[1] << std::endl;

	//4次のrunge_kutta法を使ってみる
	boost::numeric::odeint::runge_kutta4<lv_system::state> Stepper;
	csv_observer Observer("result2.csv");
	boost::numeric::odeint::integrate_adaptive(Stepper, System, State, 0.0, 5.0, 0.05, std::ref(Observer));

	std::cout << "time=10 " << "x=" << State[0] << " " << "y=" << State[1] << std::endl;
}
Exemplo n.º 27
0
void CheckUninitializedValues(CFG& cfg, ASTContext &Ctx, Diagnostic &Diags,
                              bool FullUninitTaint) {

    // Compute the uninitialized values information.
    UninitializedValues U(cfg);
    U.getAnalysisData().FullUninitTaint = FullUninitTaint;
    Solver S(U);
    S.runOnCFG(cfg);

    // Scan for DeclRefExprs that use uninitialized values.
    UninitializedValuesChecker Observer(Ctx,Diags);
    U.getAnalysisData().Observer = &Observer;
    S.runOnAllBlocks(cfg);
}
Exemplo n.º 28
0
void MulticasterTest::testSimpleUnsubscribeAll ()
{
    // Make sure we unsubscribe all occurrences of an observer on all addresses
    Value value;

    assert (m_multicaster->subscribe (m_o1, "alpha"));
    assert (m_multicaster->subscribe (m_o1, "beck"));
    assert (m_multicaster->subscribe (m_o1, "gamma"));
    m_multicaster->unsubscribeFromAll (m_o1);
    assert (m_multicaster->publish (NULL, "alpha", value));
    assert (m_multicaster->publish (NULL, "beck", value));
    assert (m_multicaster->publish (NULL, "gamma", value));
    assert (*m_o1 == Observer ());

}
Exemplo n.º 29
0
//---------------------------------------------------------------------------------------
Observer* EventNotifier::add_observer_for_child(Observable* parent, int childType,
                                                ImoId childId)
{
    std::list<Observer*>::iterator it;
    for (it = m_observers.begin(); it != m_observers.end(); ++it)
    {
        Observable* target = parent->get_observable_child(childType, childId);
        if ((*it)->target() == target)
            return *it;
    }

    Observer* observer = LOMSE_NEW Observer(parent, childType, childId);
    m_observers.push_back(observer);
    return observer;
}
// ---------------------------------------------------------------------------
// CIAUpdateContentOperation::OperationComplete
// 
// ---------------------------------------------------------------------------
// 
void CIAUpdateContentOperation::OperationComplete( TInt aError )
    {
    IAUPDATE_TRACE("[IAUPDATE] CIAUpdateContentOperation::OperationComplete() begin");

    // Reset and set everything before calling observer complete because
    // the observer may delete this object immediately.

    // Operation has completed. So, it is not in use anymore.
    SetOperationInUse( EFalse );


    // Inform the observer about the completion of the operation. 
    // Give the main node as a parameter.
    Observer().ContentOperationComplete( Node(), aError );

    IAUPDATE_TRACE("[IAUPDATE] CIAUpdateContentOperation::OperationComplete() end");
    }