mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
[220446] Updated the "dataviewer" example and excercises for EclipseCon tutorial.
This commit is contained in:
parent
642ea06516
commit
d7635bc046
5 changed files with 33 additions and 9 deletions
|
@ -8,7 +8,11 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Wind River Systems - initial API and implementation
|
* Wind River Systems - initial API and implementation
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
//#ifdef excercises
|
||||||
package org.eclipse.dd.examples.dsf.dataviewer;
|
package org.eclipse.dd.examples.dsf.dataviewer;
|
||||||
|
//#else
|
||||||
|
//#package org.eclipse.dd.examples.dsf.dataviewer.answers;
|
||||||
|
//#endif
|
||||||
|
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
|
|
@ -15,7 +15,9 @@ package org.eclipse.dd.examples.dsf.dataviewer;
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Iterator;
|
//#ifdef answers
|
||||||
|
//#import java.util.Iterator;
|
||||||
|
//#endif
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
@ -25,14 +27,16 @@ import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
import org.eclipse.core.runtime.IStatus;
|
import org.eclipse.core.runtime.IStatus;
|
||||||
import org.eclipse.core.runtime.Status;
|
import org.eclipse.core.runtime.Status;
|
||||||
import org.eclipse.dd.dsf.concurrent.ConfinedToDsfExecutor;
|
//#ifdef answers
|
||||||
|
//#import org.eclipse.dd.dsf.concurrent.ConfinedToDsfExecutor;
|
||||||
|
//#import org.eclipse.dd.dsf.concurrent.Immutable;
|
||||||
|
//#import org.eclipse.dd.dsf.concurrent.ThreadSafe;
|
||||||
|
//#endif
|
||||||
import org.eclipse.dd.dsf.concurrent.DataRequestMonitor;
|
import org.eclipse.dd.dsf.concurrent.DataRequestMonitor;
|
||||||
import org.eclipse.dd.dsf.concurrent.DefaultDsfExecutor;
|
import org.eclipse.dd.dsf.concurrent.DefaultDsfExecutor;
|
||||||
import org.eclipse.dd.dsf.concurrent.DsfExecutor;
|
import org.eclipse.dd.dsf.concurrent.DsfExecutor;
|
||||||
import org.eclipse.dd.dsf.concurrent.DsfRunnable;
|
import org.eclipse.dd.dsf.concurrent.DsfRunnable;
|
||||||
import org.eclipse.dd.dsf.concurrent.Immutable;
|
|
||||||
import org.eclipse.dd.dsf.concurrent.RequestMonitor;
|
import org.eclipse.dd.dsf.concurrent.RequestMonitor;
|
||||||
import org.eclipse.dd.dsf.concurrent.ThreadSafe;
|
|
||||||
import org.eclipse.dd.examples.dsf.DsfExamplesPlugin;
|
import org.eclipse.dd.examples.dsf.DsfExamplesPlugin;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2006 Wind River Systems and others.
|
* Copyright (c) 2006, 2008 Wind River Systems and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -8,7 +8,11 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Wind River Systems - initial API and implementation
|
* Wind River Systems - initial API and implementation
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
//#ifdef excercises
|
||||||
package org.eclipse.dd.examples.dsf.dataviewer;
|
package org.eclipse.dd.examples.dsf.dataviewer;
|
||||||
|
//#else
|
||||||
|
//#package org.eclipse.dd.examples.dsf.dataviewer.answers;
|
||||||
|
//#endif
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2006 Wind River Systems and others.
|
* Copyright (c) 2006, 2008 Wind River Systems and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -8,7 +8,11 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Wind River Systems - initial API and implementation
|
* Wind River Systems - initial API and implementation
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
//#ifdef excercises
|
||||||
package org.eclipse.dd.examples.dsf.dataviewer;
|
package org.eclipse.dd.examples.dsf.dataviewer;
|
||||||
|
//#else
|
||||||
|
//#package org.eclipse.dd.examples.dsf.dataviewer.answers;
|
||||||
|
//#endif
|
||||||
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
@ -23,15 +27,19 @@ import org.eclipse.dd.dsf.concurrent.ThreadSafe;
|
||||||
* view to receive events indicating when the data supplied by the generator
|
* view to receive events indicating when the data supplied by the generator
|
||||||
* is changed.
|
* is changed.
|
||||||
*/
|
*/
|
||||||
@ThreadSafe
|
//#ifdef excercises
|
||||||
|
//TODO Excercise 3 - Add an annotationindicating allowed concurrency access
|
||||||
|
//#else
|
||||||
|
//#@ThreadSafe
|
||||||
|
//#endif
|
||||||
public interface IDataGenerator {
|
public interface IDataGenerator {
|
||||||
|
|
||||||
// Constants which control the data generator behavior.
|
// Constants which control the data generator behavior.
|
||||||
// Changing the count range can stress the scalability of the system, while
|
// Changing the count range can stress the scalability of the system, while
|
||||||
// changing of the process delay and random change interval can stress
|
// changing of the process delay and random change interval can stress
|
||||||
// its performance.
|
// its performance.
|
||||||
final static int MIN_COUNT = 50;
|
final static int MIN_COUNT = 100;
|
||||||
final static int MAX_COUNT = 100;
|
final static int MAX_COUNT = 200;
|
||||||
final static int PROCESSING_DELAY = 10;
|
final static int PROCESSING_DELAY = 10;
|
||||||
final static int RANDOM_CHANGE_INTERVAL = 10000;
|
final static int RANDOM_CHANGE_INTERVAL = 10000;
|
||||||
final static int RANDOM_COUNT_CHANGE_INTERVALS = 3;
|
final static int RANDOM_COUNT_CHANGE_INTERVALS = 3;
|
||||||
|
|
|
@ -8,7 +8,11 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Wind River Systems - initial API and implementation
|
* Wind River Systems - initial API and implementation
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
//#ifdef excercises
|
||||||
package org.eclipse.dd.examples.dsf.dataviewer;
|
package org.eclipse.dd.examples.dsf.dataviewer;
|
||||||
|
//#else
|
||||||
|
//#package org.eclipse.dd.examples.dsf.dataviewer.answers;
|
||||||
|
//#endif
|
||||||
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue