tmf: Make TmfEventFieldAspect independent of event content
[deliverable/tracecompass.git] / org.eclipse.tracecompass.btf.core / src / org / eclipse / tracecompass / btf / core / trace / BtfEventAspects.java
index 78e88e436d06e6b811c76e13456ba10aa797819e..e3463aa313f4f514d60faabab81a717c13006f72 100644 (file)
@@ -18,7 +18,7 @@ import org.eclipse.tracecompass.btf.core.event.BtfEvent;
 import org.eclipse.tracecompass.common.core.NonNullUtils;
 import org.eclipse.tracecompass.tmf.core.event.ITmfEvent;
 import org.eclipse.tracecompass.tmf.core.event.aspect.ITmfEventAspect;
-import org.eclipse.tracecompass.tmf.core.event.aspect.TmfEventFieldAspect;
+import org.eclipse.tracecompass.tmf.core.event.aspect.TmfContentFieldAspect;
 
 import com.google.common.collect.ImmutableList;
 
@@ -35,12 +35,12 @@ public final class BtfEventAspects {
             NonNullUtils.checkNotNull(ImmutableList.of(
                     ITmfEventAspect.BaseAspects.TIMESTAMP,
                     new BtfSourceAspect(),
-                    new BtfSourceInstanceAspect(),
+                    new TmfContentFieldAspect(BtfColumnNames.SOURCE_INSTANCE.toString(), BtfColumnNames.SOURCE_INSTANCE.toString()),
                     ITmfEventAspect.BaseAspects.EVENT_TYPE,
                     new BtfTargetAspect(),
-                    new BtfTargetInstanceAspect(),
-                    new BtfEventAspect(),
-                    new BtfNotesAspect()
+                    new TmfContentFieldAspect(BtfColumnNames.TARGET_INSTANCE.toString(), BtfColumnNames.TARGET_INSTANCE.toString()),
+                    new TmfContentFieldAspect(BtfColumnNames.EVENT.toString(), BtfColumnNames.EVENT.toString()),
+                    new TmfContentFieldAspect(BtfColumnNames.NOTES.toString(), BtfColumnNames.NOTES.toString())
                     ));
 
     /**
@@ -68,17 +68,6 @@ public final class BtfEventAspects {
         }
     }
 
-    /**
-     * The "source instance" aspect, whose value comes from the field of the
-     * same name.
-     */
-    private static class BtfSourceInstanceAspect extends TmfEventFieldAspect {
-        public BtfSourceInstanceAspect() {
-            super(BtfColumnNames.SOURCE_INSTANCE.toString(),
-                    BtfColumnNames.SOURCE_INSTANCE.toString());
-        }
-    }
-
     /**
      * The "target" aspect, taking its value from
      * {@link ITmfEvent#getReference()}.
@@ -105,38 +94,6 @@ public final class BtfEventAspects {
         }
     }
 
-    /**
-     * The "target instance" aspect, whose value comes from the field of the
-     * same name.
-     */
-    private static class BtfTargetInstanceAspect extends TmfEventFieldAspect {
-        public BtfTargetInstanceAspect() {
-            super(BtfColumnNames.TARGET_INSTANCE.toString(),
-                    BtfColumnNames.TARGET_INSTANCE.toString());
-        }
-    }
-
-    /**
-     * The "event" aspect, whose value comes from the field of the same name.
-     */
-    private static class BtfEventAspect extends TmfEventFieldAspect {
-        public BtfEventAspect() {
-            super(BtfColumnNames.EVENT.toString(),
-                    BtfColumnNames.EVENT.toString());
-        }
-    }
-
-    /**
-     * The "notes" column, whose value comes from the field of the same name, if
-     * present.
-     */
-    private static class BtfNotesAspect extends TmfEventFieldAspect {
-        public BtfNotesAspect() {
-            super(BtfColumnNames.NOTES.toString(),
-                    BtfColumnNames.NOTES.toString());
-        }
-    }
-
     /**
      * Return the event aspects defined for BTF traces.
      *
This page took 0.027378 seconds and 5 git commands to generate.