Commit | Line | Data |
---|---|---|
1d7e62f9 GB |
1 | /******************************************************************************* |
2 | * Copyright (c) 2014 École Polytechnique de Montréal | |
3 | * | |
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 | |
8 | * | |
9 | * Contributors: | |
10 | * Geneviève Bastien - Initial API and implementation | |
11 | *******************************************************************************/ | |
12 | ||
2bdf0193 | 13 | package org.eclipse.tracecompass.tmf.analysis.xml.core.model; |
1d7e62f9 GB |
14 | |
15 | import java.util.List; | |
16 | ||
1d7e62f9 | 17 | import org.eclipse.jdt.annotation.Nullable; |
e894a508 AM |
18 | import org.eclipse.tracecompass.statesystem.core.exceptions.AttributeNotFoundException; |
19 | import org.eclipse.tracecompass.statesystem.core.exceptions.StateValueTypeException; | |
20 | import org.eclipse.tracecompass.statesystem.core.exceptions.TimeRangeException; | |
21 | import org.eclipse.tracecompass.statesystem.core.statevalue.ITmfStateValue; | |
2bdf0193 | 22 | import org.eclipse.tracecompass.tmf.core.event.ITmfEvent; |
1d7e62f9 GB |
23 | |
24 | /** | |
25 | * Interface that describe operations on a state value described in an XML | |
26 | * element | |
27 | * | |
28 | * @author Geneviève Bastien | |
29 | */ | |
30 | public interface ITmfXmlStateValue { | |
31 | ||
32 | /** | |
33 | * Get the current {@link ITmfStateValue} of this state value for an event. | |
34 | * It does not increment the value and does not any other processing of the | |
35 | * value. | |
36 | * | |
37 | * @param event | |
38 | * The current event or <code>null</code> if no event is | |
39 | * available. | |
0b563c20 JCK |
40 | * @param scenarioInfo |
41 | * The active scenario details. Or <code>null</code> if there is | |
42 | * no scenario. | |
1d7e62f9 GB |
43 | * @return the {@link ITmfStateValue} |
44 | * @throws AttributeNotFoundException | |
45 | * May be thrown by the state system during the query | |
0b563c20 | 46 | * @since 2.0 |
1d7e62f9 | 47 | */ |
0b563c20 | 48 | ITmfStateValue getValue(@Nullable ITmfEvent event, @Nullable TmfXmlScenarioInfo scenarioInfo) throws AttributeNotFoundException; |
1d7e62f9 GB |
49 | |
50 | /** | |
51 | * Get the value of the event field that is the path of this state value | |
52 | * | |
53 | * @param event | |
54 | * The current event | |
55 | * @return the value of the event field | |
56 | */ | |
12685851 | 57 | ITmfStateValue getEventFieldValue(ITmfEvent event); |
1d7e62f9 GB |
58 | |
59 | /** | |
60 | * Get the list of state attributes, the path to the state value | |
61 | * | |
62 | * @return the list of Attribute to have the path in the State System | |
63 | */ | |
64 | List<ITmfXmlStateAttribute> getAttributes(); | |
65 | ||
66 | /** | |
67 | * Handles an event, by setting the value of the attribute described by the | |
68 | * state attribute path in the state system. | |
69 | * | |
70 | * @param event | |
71 | * The event to process | |
0b563c20 JCK |
72 | * @param scenarioInfo |
73 | * The active scenario details. Or <code>null</code> if there is | |
74 | * no scenario. | |
1d7e62f9 GB |
75 | * @throws AttributeNotFoundException |
76 | * Pass through the exception it received | |
77 | * @throws TimeRangeException | |
78 | * Pass through the exception it received | |
79 | * @throws StateValueTypeException | |
80 | * Pass through the exception it received | |
0b563c20 | 81 | * @since 2.0 |
1d7e62f9 | 82 | */ |
0b563c20 | 83 | void handleEvent(ITmfEvent event, @Nullable TmfXmlScenarioInfo scenarioInfo) throws AttributeNotFoundException, StateValueTypeException, TimeRangeException; |
1d7e62f9 GB |
84 | |
85 | } |