final IStateChangeInput htInput = new StatsStateProvider(trace);
this.stats = StateSystemManager.loadStateHistory(htFile, htInput, false);
+ registerStateSystems();
}
/**
this.trace = trace;
final IStateChangeInput htInput = new StatsStateProvider(trace);
this.stats = StateSystemManager.loadStateHistory(historyFile, htInput, true);
+ registerStateSystems();
+ }
+
+ /**
+ * Register the state systems used here into the trace's state system array.
+ */
+ private void registerStateSystems() {
+ trace.registerStateSystem(STATE_ID, stats);
}
// ------------------------------------------------------------------------
*/
public Collection<String> listStateSystems();
+ /**
+ * If a state system is not build by the trace itself, it's possible to
+ * register it if it comes from another source. It will then be accessible
+ * with {@link #getStateSystems} normally.
+ *
+ * @param id
+ * The unique ID to assign to this state system. In case of
+ * conflicting ID's, the new one will overwrite the previous one
+ * (default Map behavior).
+ * @param ss
+ * The already-built state system
+ * @since 2.0
+ */
+ public void registerStateSystem(String id, ITmfStateSystem ss);
+
// ------------------------------------------------------------------------
// Trace characteristics getters
// ------------------------------------------------------------------------
return fStateSystems.keySet();
}
+ /**
+ * @since 2.0
+ */
+ @Override
+ public final void registerStateSystem(String id, ITmfStateSystem ss) {
+ fStateSystems.put(id, ss);
+ }
+
// ------------------------------------------------------------------------
// ITmfTrace - Trace characteristics getters
// ------------------------------------------------------------------------