1 /*******************************************************************************
2 * Copyright (c) 2012, 2014 Ericsson
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
10 * Francois Chouinard - Initial API and implementation
11 * Patrick Tasse - Updated for location in checkpoint
12 *******************************************************************************/
14 package org
.eclipse
.tracecompass
.tmf
.core
.trace
.indexer
.checkpoint
;
16 import java
.nio
.ByteBuffer
;
18 import org
.eclipse
.tracecompass
.tmf
.core
.timestamp
.ITmfTimestamp
;
19 import org
.eclipse
.tracecompass
.tmf
.core
.trace
.location
.ITmfLocation
;
22 * The basic trace checkpoint structure in TMF. The purpose of the checkpoint is
23 * to associate a trace location to an event timestamp.
28 * @author Francois Chouinard
30 public interface ITmfCheckpoint
extends Comparable
<ITmfCheckpoint
> {
32 // ------------------------------------------------------------------------
34 // ------------------------------------------------------------------------
37 * The maximum size of the serialize buffer when determining the checkpoint
40 static final int MAX_SERIALIZE_SIZE
= 1024;
43 * @return the timestamp of the event referred to by the context
45 ITmfTimestamp
getTimestamp();
48 * @return the location of the event referred to by the checkpoint
50 ITmfLocation
getLocation();
52 // ------------------------------------------------------------------------
54 // ------------------------------------------------------------------------
57 int compareTo(ITmfCheckpoint checkpoint
);
60 * Returns the checkpoint rank for this checkpoint. The checkpoint rank can
61 * be seen as the index of the checkpoint in the order it was added.
63 * @return the checkpoint rank for this checkpoint
65 long getCheckpointRank();
68 * Write the checkpoint to the ByteBuffer so that it can be saved to disk.
71 * the buffer to write to
73 void serialize(ByteBuffer bufferOut
);