Warning, file /sdk/kcachegrind/libcore/context.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001 /* 0002 This file is part of KCachegrind. 0003 0004 SPDX-FileCopyrightText: 2002-2016 Josef Weidendorfer <Josef.Weidendorfer@gmx.de> 0005 0006 SPDX-License-Identifier: GPL-2.0-only 0007 */ 0008 0009 #ifndef CONTEXT_H 0010 #define CONTEXT_H 0011 0012 #include <QString> 0013 #include <QHash> 0014 0015 /** 0016 * Base class for source contexts which event costs contained 0017 * in a ProfileData instance, ie. a profiling experiment, can relate to. 0018 * 0019 * This only includes code/source related context. Any other cost 0020 * context such as thread number, see DataContext, which relates to ProfileData. 0021 */ 0022 class ProfileContext 0023 { 0024 0025 public: 0026 // RTTI for trace item classes, using type() method 0027 enum Type { 0028 InvalidType = 0, UnknownType, 0029 PartInstr, Instr, 0030 PartLine, Line, 0031 PartInstrJump, InstrJump, 0032 PartLineJump, LineJump, 0033 PartInstrCall, InstrCall, 0034 PartLineCall, LineCall, 0035 PartCall, Call, 0036 PartLineRegion, LineRegion, 0037 PartFunction, FunctionSource, Function, FunctionCycle, 0038 PartClass, Class, ClassCycle, 0039 PartFile, File, FileCycle, 0040 PartObject, Object, ObjectCycle, 0041 Part, Data, 0042 MaxType }; 0043 0044 explicit ProfileContext(ProfileContext::Type = InvalidType); 0045 0046 ProfileContext::Type type() { return _type; } 0047 0048 static ProfileContext* context(ProfileContext::Type); 0049 0050 // conversion of context type to locale independent string (e.g. for config) 0051 static QString typeName(Type); 0052 static Type type(const QString&); 0053 // the versions below should be used for user visible strings, as 0054 // these use localization settings 0055 static QString i18nTypeName(Type); 0056 static Type i18nType(const QString&); 0057 0058 // clean up some static data 0059 static void cleanup(); 0060 0061 private: 0062 Type _type; 0063 0064 static ProfileContext* _contexts; 0065 static QString* _typeName; 0066 static QString* _i18nTypeName; 0067 }; 0068 0069 #endif // CONTEXT_H