Fix previous commit
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.core / src / org / eclipse / linuxtools / tmf / core / statesystem / IStateChangeInput.java
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
13 package org.eclipse.linuxtools.tmf.core.statesystem;
14
15 import org.eclipse.linuxtools.tmf.core.event.ITmfEvent;
16 import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace;
17
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 * @version 1.0
26 * @author Alexandre Montplaisir
27 */
28 public interface IStateChangeInput {
29
30 /**
31 * Get the trace with which this state input plugin is associated.
32 *
33 * @return The associated trace
34 */
35 public ITmfTrace getTrace();
36
37 /**
38 * Return the start time of this "state change input", which is normally the
39 * start time of the originating trace (or it can be the time of the first
40 * state-changing event).
41 *
42 * @return The start time
43 */
44 public long getStartTime();
45
46 /**
47 * Method for the input plugin to specify which type of events it expects.
48 * This will guarantee that all events it receives via processEvent() are
49 * indeed of the given type, so it should be safe to cast to that type.
50 *
51 * @return An example event of the expected class, which implements
52 * ITmfEvent. The contents of that event doesn't matter, only the
53 * class will be checked.
54 */
55 public ITmfEvent getExpectedEventType();
56
57 /**
58 * Assign the target state system where this SCI will insert its state
59 * changes. Because of dependencies issues, this can normally not be done at
60 * the constructor.
61 *
62 * This needs to be called before .run()!
63 *
64 * @param ssb
65 * Target state system for the state changes generated by this
66 * input plugin
67 */
68 public void assignTargetStateSystem(IStateSystemBuilder ssb);
69
70 /**
71 * Send an event to this input plugin for processing. The implementation
72 * should check the contents, and call the state-modifying methods of its
73 * IStateSystemBuilder object accordingly.
74 *
75 * @param event
76 * The event (which should be safe to cast to the
77 * expectedEventType) that has to be processed.
78 */
79 public void processEvent(ITmfEvent event);
80
81 /**
82 * Indicate to the state history building process that we are done (for now),
83 * and that it should close its current history.
84 */
85 public void dispose();
86 }
This page took 0.061943 seconds and 5 git commands to generate.