Merge branch 'master' into lttng-luna
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.core / src / org / eclipse / linuxtools / tmf / core / ctfadaptor / CtfLocation.java
index a41066b50a97701f99717ffcfd85459688cbf759..55acb6b584382a21a33ff39af0dfd5142b6136ce 100644 (file)
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2012 Ericsson
+ * Copyright (c) 2012, 2013 Ericsson
  *
  * All rights reserved. This program and the accompanying materials are made
  * available under the terms of the Eclipse Public License v1.0 which
  *******************************************************************************/
 package org.eclipse.linuxtools.tmf.core.ctfadaptor;
 
-import org.eclipse.linuxtools.tmf.core.event.ITmfTimestamp;
-import org.eclipse.linuxtools.tmf.core.trace.TmfLocation;
+import java.nio.ByteBuffer;
+
+import org.eclipse.linuxtools.tmf.core.timestamp.ITmfTimestamp;
+import org.eclipse.linuxtools.tmf.core.trace.location.TmfLocation;
 
 /**
  * The nugget of information that is unique to a location in a CTF trace.
@@ -43,6 +45,7 @@ public final class CtfLocation extends TmfLocation {
      *
      * @param timestamp
      *            The timestamp of this location
+     * @since 2.0
      */
     public CtfLocation(final ITmfTimestamp timestamp) {
         this(timestamp.getValue(), 0);
@@ -100,6 +103,18 @@ public final class CtfLocation extends TmfLocation {
     // TmfLocation
     // ------------------------------------------------------------------------
 
+    /**
+     * Construct the location from the ByteBuffer.
+     *
+     * @param bufferIn
+     *            the buffer to read from
+     *
+     * @since 3.0
+     */
+    public CtfLocation(ByteBuffer bufferIn) {
+        super(new CtfLocationInfo(bufferIn));
+    }
+
     /**
      * @since 2.0
      */
@@ -120,4 +135,14 @@ public final class CtfLocation extends TmfLocation {
         return super.toString();
     }
 
+    /**
+     * Constructs the location from the ByteBuffer. This typically happens when reading from disk.
+     *
+     * @since 3.0
+     */
+    @Override
+    public void serialize(ByteBuffer bufferOut) {
+        getLocationInfo().serialize(bufferOut);
+
+    }
 }
This page took 0.024117 seconds and 5 git commands to generate.