Commit | Line | Data |
---|---|---|
a52fde77 AM |
1 | /******************************************************************************* |
2 | * Copyright (c) 2012 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 | ||
18ab1d18 | 13 | package org.eclipse.linuxtools.tmf.core.statesystem; |
a52fde77 | 14 | |
2c2f900e AM |
15 | import org.eclipse.linuxtools.tmf.core.event.ITmfEvent; |
16 | import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace; | |
17 | ||
a52fde77 AM |
18 | /** |
19 | * This is the interface used to define the "state change input", which is the | |
20 | * main type of input that goes in the state system. | |
21 | * | |
22 | * Usually a state change input, also called "state provider" is the piece of | |
23 | * the pipeline which converts trace events to state changes. | |
24 | * | |
25 | * @author alexmont | |
26 | * | |
27 | */ | |
2c2f900e | 28 | public interface IStateChangeInput { |
a52fde77 | 29 | |
2c2f900e AM |
30 | /** |
31 | * Get the trace with which this state input plugin is associated. | |
32 | * | |
33 | * @return The associated trace | |
34 | */ | |
35 | @SuppressWarnings("rawtypes") | |
36 | public ITmfTrace getTrace(); | |
37 | ||
a52fde77 AM |
38 | /** |
39 | * Return the start time of this "state change input", which is normally the | |
40 | * start time of the originating trace (or it can be the time of the first | |
41 | * state-changing event). | |
42 | * | |
43 | * @return The start time | |
44 | */ | |
45 | public long getStartTime(); | |
46 | ||
2c2f900e AM |
47 | /** |
48 | * Method for the input plugin to specify which type of events it expects. | |
49 | * This will guarantee that all events it receives via processEvent() are | |
50 | * indeed of the given type, so it should be safe to cast to that type. | |
51 | * | |
52 | * @return An example event of the expected class, which implements | |
53 | * ITmfEvent. The contents of that event doesn't matter, only the | |
54 | * class will be checked. | |
55 | */ | |
56 | public ITmfEvent getExpectedEventType(); | |
57 | ||
a52fde77 AM |
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 | * | |
d26f90fd | 65 | * @param ssb |
a52fde77 | 66 | */ |
d26f90fd | 67 | public void assignTargetStateSystem(IStateSystemBuilder ssb); |
2c2f900e AM |
68 | |
69 | /** | |
70 | * Send an event to this input plugin for processing. The implementation | |
71 | * should check the contents, and call the state-modifying methods of its | |
72 | * IStateSystemBuilder object accordingly. | |
73 | * | |
74 | * @param event | |
75 | * The event (which should be safe to cast to the | |
76 | * expectedEventType) that has to be processed. | |
77 | */ | |
78 | public void processEvent(ITmfEvent event); | |
79 | ||
80 | /** | |
81 | * Indicate to the state history building process that we are done (for now), | |
82 | * and that it should close its current history. | |
83 | */ | |
84 | public void dispose(); | |
a52fde77 | 85 | } |