--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2016 EfficiOS Inc., Alexandre Montplaisir
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+
+package org.eclipse.tracecompass.internal.provisional.tmf.core.views.timegraph2;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import com.google.common.collect.ImmutableList;
+
+public class TimeGraphTreeModel {
+
+ private final List<TimeGraphTreeElement> fTreeElements = Collections.synchronizedList(new ArrayList<>());
+
+ public TimeGraphTreeModel() {
+ }
+
+ public int getNbElements() {
+ return fTreeElements.size();
+ }
+
+ public void addElement(TimeGraphTreeElement element) {
+ fTreeElements.add(element);
+ }
+
+ public TimeGraphTreeRender getSnapshot() {
+ /* Safe to use concurrently */
+ List<TimeGraphTreeElement> list = ImmutableList.copyOf(fTreeElements);
+ return new TimeGraphTreeRender(list);
+ }
+}