1 /*******************************************************************************
2 * Copyright (c) 2012 Ericsson
4 * All rights reserved. This program and the accompanying materials are made
5 * 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
9 * Contributors: Matthew Khouzam - Initial API and implementation
10 *******************************************************************************/
12 package org
.eclipse
.linuxtools
.tmf
.ctf
.core
;
14 import org
.eclipse
.linuxtools
.tmf
.core
.event
.ITmfEventField
;
15 import org
.eclipse
.linuxtools
.tmf
.core
.event
.TmfEventType
;
16 import org
.eclipse
.linuxtools
.tmf
.core
.event
.TmfEventTypeManager
;
17 import org
.eclipse
.linuxtools
.tmf
.core
.trace
.ITmfTrace
;
20 * The CTF extension of the TMF event type
23 * @author Matthew khouzam
25 public class CtfTmfEventType
extends TmfEventType
{
28 * CTFTmfEventType context for the event type manager
30 private static final String CONTEXT_ID
= "Ctf Event"; //$NON-NLS-1$
32 private static final String UNKNOWN_TRACE
= "unknown"; //$NON-NLS-1$
35 * Constructor for CtfTmfEventType.
45 public CtfTmfEventType(String eventName
, ITmfTrace trace
, ITmfEventField content
) {
46 super(computeContextName(trace
), eventName
, content
);
55 public String
toString() {
60 * gets the event type for an event name
66 * @return the event type
69 public static CtfTmfEventType
get(CtfTmfTrace trace
, String eventName
) {
70 return (CtfTmfEventType
) TmfEventTypeManager
.getInstance().getType(computeContextName(trace
), eventName
);
74 * Get the context name of a ctf trace
78 * @return the context name
81 public static String
computeContextName(ITmfTrace trace
) {
82 return CONTEXT_ID
+ "/" + (trace
== null ? UNKNOWN_TRACE
: trace
.getPath()); //$NON-NLS-1$
This page took 0.031067 seconds and 5 git commands to generate.