1 /*******************************************************************************
2 * Copyright (c) 2009, 2015 Ericsson
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
10 * Francois Chouinard - Initial API and implementation
11 * Bernd Hufmann - Added APIs for composite event providers
12 *******************************************************************************/
14 package org
.eclipse
.tracecompass
.tmf
.core
.component
;
16 import java
.util
.List
;
18 import org
.eclipse
.jdt
.annotation
.NonNull
;
19 import org
.eclipse
.jdt
.annotation
.Nullable
;
20 import org
.eclipse
.tracecompass
.tmf
.core
.event
.ITmfEvent
;
21 import org
.eclipse
.tracecompass
.tmf
.core
.request
.ITmfEventRequest
;
22 import org
.eclipse
.tracecompass
.tmf
.core
.trace
.ITmfContext
;
25 * This is the interface of the data providers in TMF. Data providers have the
26 * capability of handling data requests.
28 * @author Francois Chouinard
30 * @see TmfEventProvider
32 public interface ITmfEventProvider
extends ITmfComponent
{
35 * Queue the request for processing.
37 * @param request The request to process
39 void sendRequest(ITmfEventRequest request
);
42 * Increments/decrements the pending requests counters and fires the request
43 * if necessary (counter == 0). Used for coalescing requests across multiple
47 * Should we increment (true) or decrement (false) the pending
50 void notifyPendingRequest(boolean isIncrement
);
53 * Get the event type this provider handles
55 * @return The type of ITmfEvent
58 Class
<?
extends ITmfEvent
> getEventType();
61 * Return the next event based on the context supplied. The context
62 * will be updated for the subsequent read.
64 * @param context the trace read context (updated)
65 * @return the event referred to by context
67 ITmfEvent
getNext(ITmfContext context
);
70 * Gets the parent event provider.
72 * @return the parent event provider or null if no parent.
75 ITmfEventProvider
getParent();
78 * Sets the parent event provider.
83 void setParent(@Nullable ITmfEventProvider parent
);
86 * Adds a child event provider.
89 * a child to add, cannot be null.
91 void addChild(@NonNull ITmfEventProvider child
);
94 * Gets the children event providers.
96 * @return a list of children event providers or an empty list if no
97 * children (return value cannot be null).
100 List
<ITmfEventProvider
> getChildren();
103 * Returns the child event provider with given name.
106 * name of child to find.
107 * @return child event provider or null.
110 ITmfEventProvider
getChild(String name
);
113 * Returns the child event provider for a given index
116 * index of child to get. Prior calling this method the index has
117 * to be verified so that it is within the bounds.
118 * @return child event provider (cannot be null)
121 ITmfEventProvider
getChild(int index
);
124 * Gets children for given class type.
127 * a class type to get
128 * @return a list of children event providers matching a given class type or
129 * an empty list if no children (return value cannot be null).
132 <T
extends ITmfEventProvider
> List
<@NonNull T
> getChildren(Class
<T
> clazz
);
135 * Gets the number of children
137 * @return number of children
This page took 0.037508 seconds and 5 git commands to generate.