1
0
Fork 0
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:
Pawel Piech 2008-02-29 16:26:34 +00:00
parent 642ea06516
commit d7635bc046
5 changed files with 33 additions and 9 deletions

View file

@ -8,7 +8,11 @@
* Contributors:
* Wind River Systems - initial API and implementation
*******************************************************************************/
//#ifdef excercises
package org.eclipse.dd.examples.dsf.dataviewer;
//#else
//#package org.eclipse.dd.examples.dsf.dataviewer.answers;
//#endif
import java.util.HashSet;
import java.util.Iterator;

View file

@ -15,7 +15,9 @@ package org.eclipse.dd.examples.dsf.dataviewer;
//#endif
import java.util.HashSet;
import java.util.Iterator;
//#ifdef answers
//#import java.util.Iterator;
//#endif
import java.util.LinkedList;
import java.util.List;
import java.util.Random;
@ -25,14 +27,16 @@ import java.util.concurrent.TimeUnit;
import org.eclipse.core.runtime.IStatus;
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.DefaultDsfExecutor;
import org.eclipse.dd.dsf.concurrent.DsfExecutor;
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.ThreadSafe;
import org.eclipse.dd.examples.dsf.DsfExamplesPlugin;
/**

View file

@ -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
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@ -8,7 +8,11 @@
* Contributors:
* Wind River Systems - initial API and implementation
*******************************************************************************/
//#ifdef excercises
package org.eclipse.dd.examples.dsf.dataviewer;
//#else
//#package org.eclipse.dd.examples.dsf.dataviewer.answers;
//#endif
import java.util.Collections;
import java.util.HashSet;

View file

@ -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
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@ -8,7 +8,11 @@
* Contributors:
* Wind River Systems - initial API and implementation
*******************************************************************************/
//#ifdef excercises
package org.eclipse.dd.examples.dsf.dataviewer;
//#else
//#package org.eclipse.dd.examples.dsf.dataviewer.answers;
//#endif
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
* is changed.
*/
@ThreadSafe
//#ifdef excercises
//TODO Excercise 3 - Add an annotationindicating allowed concurrency access
//#else
//#@ThreadSafe
//#endif
public interface IDataGenerator {
// Constants which control the data generator behavior.
// Changing the count range can stress the scalability of the system, while
// changing of the process delay and random change interval can stress
// its performance.
final static int MIN_COUNT = 50;
final static int MAX_COUNT = 100;
final static int MIN_COUNT = 100;
final static int MAX_COUNT = 200;
final static int PROCESSING_DELAY = 10;
final static int RANDOM_CHANGE_INTERVAL = 10000;
final static int RANDOM_COUNT_CHANGE_INTERVALS = 3;

View file

@ -8,7 +8,11 @@
* Contributors:
* Wind River Systems - initial API and implementation
*******************************************************************************/
//#ifdef excercises
package org.eclipse.dd.examples.dsf.dataviewer;
//#else
//#package org.eclipse.dd.examples.dsf.dataviewer.answers;
//#endif
import java.util.Set;