1 /*******************************************************************************
2 * Copyright (c) 2012, 2013 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
.linuxtools
.tmf
.core
.trace
.indexer
.checkpoint
;
16 import java
.nio
.ByteBuffer
;
18 import org
.eclipse
.linuxtools
.tmf
.core
.timestamp
.ITmfTimestamp
;
19 import org
.eclipse
.linuxtools
.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
31 public interface ITmfCheckpoint
extends Comparable
<ITmfCheckpoint
> {
33 // ------------------------------------------------------------------------
35 // ------------------------------------------------------------------------
38 * The maximum size of the serialize buffer when determining the checkpoint
41 static final int MAX_SERIALIZE_SIZE
= 1024;
44 * @return the timestamp of the event referred to by the context
47 ITmfTimestamp
getTimestamp();
50 * @return the location of the event referred to by the checkpoint
52 ITmfLocation
getLocation();
54 // ------------------------------------------------------------------------
56 // ------------------------------------------------------------------------
59 int compareTo(ITmfCheckpoint checkpoint
);
62 * Returns the checkpoint rank for this checkpoint. The checkpoint rank can
63 * be seen as the index of the checkpoint in the order it was added.
65 * @return the checkpoint rank for this checkpoint
68 long getCheckpointRank();
71 * Write the checkpoint to the ByteBuffer so that it can be saved to disk.
74 * the buffer to write to
78 void serialize(ByteBuffer bufferOut
);