tmf: Bug 488042: TmfStatisticsModule returns null in @NonNull interface
[deliverable/tracecompass.git] / tmf / org.eclipse.tracecompass.tmf.core / src / org / eclipse / tracecompass / tmf / core / statesystem / ITmfStateProvider.java
1 /*******************************************************************************
2 * Copyright (c) 2012, 2015 Ericsson
3 * Copyright (c) 2010, 2011 École Polytechnique de Montréal
4 * Copyright (c) 2010, 2011 Alexandre Montplaisir <alexandre.montplaisir@gmail.com>
5 *
6 * All rights reserved. This program and the accompanying materials are
7 * made available under the terms of the Eclipse Public License v1.0 which
8 * accompanies this distribution, and is available at
9 * http://www.eclipse.org/legal/epl-v10.html
10 *
11 *******************************************************************************/
12
13 package org.eclipse.tracecompass.tmf.core.statesystem;
14
15 import org.eclipse.jdt.annotation.Nullable;
16 import org.eclipse.tracecompass.statesystem.core.ITmfStateSystem;
17 import org.eclipse.tracecompass.statesystem.core.ITmfStateSystemBuilder;
18 import org.eclipse.tracecompass.tmf.core.event.ITmfEvent;
19 import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
20
21 /**
22 * This is the interface used to define the "state change input", which is the
23 * main type of input that goes in the state system.
24 *
25 * Usually a state change input, also called "state provider" is the piece of
26 * the pipeline which converts trace events to state changes.
27 *
28 * @author Alexandre Montplaisir
29 */
30 public interface ITmfStateProvider {
31
32 /**
33 * Event handler plugins should provide a version number. This is used to
34 * determine if a potential existing file can be re-opened later (if the
35 * versions in the file and in the viewer match), or if the file should be
36 * rebuilt from scratch (if the versions don't match).
37 *
38 * @return The version number of the input plugin
39 */
40 int getVersion();
41
42 /**
43 * Get the trace with which this state input plugin is associated.
44 *
45 * @return The associated trace
46 */
47 ITmfTrace getTrace();
48
49 /**
50 * Return the start time of this "state change input", which is normally the
51 * start time of the originating trace (or it can be the time of the first
52 * state-changing event).
53 *
54 * @return The start time
55 */
56 long getStartTime();
57
58 /**
59 * Assign the target state system where this SCI will insert its state
60 * changes. Because of dependencies issues, this can normally not be done at
61 * the constructor.
62 *
63 * This needs to be called before .run()!
64 *
65 * @param ssb
66 * Target state system for the state changes generated by this
67 * input plugin
68 */
69 void assignTargetStateSystem(ITmfStateSystemBuilder ssb);
70
71 /**
72 * Return the currently assigned target state system.
73 *
74 * @return Reference to the currently assigned state system, or null if no
75 * SS is assigned yet
76 */
77 @Nullable ITmfStateSystem getAssignedStateSystem();
78
79 /**
80 * Send an event to this input plugin for processing. The implementation
81 * should check the contents, and call the state-modifying methods of its
82 * IStateSystemBuilder object accordingly.
83 *
84 * @param event
85 * The event (which should be safe to cast to the
86 * expectedEventType) that has to be processed.
87 */
88 void processEvent(ITmfEvent event);
89
90 /**
91 * Provide a non-initialized copy of this state input plugin. You will need
92 * to call {@link #assignTargetStateSystem} on it to assign its target.
93 *
94 * @return A new state change input object, of the same type, but without an
95 * assigned target state system
96 */
97 ITmfStateProvider getNewInstance();
98
99 /**
100 * Indicate to the state history building process that we are done (for now),
101 * and that it should close its current history.
102 */
103 void dispose();
104 }
This page took 0.032225 seconds and 5 git commands to generate.