• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdesdk API Reference
  • KDE Home
  • Contact Us
 

kcachegrind

  • sources
  • kde-4.14
  • kdesdk
  • kcachegrind
  • libcore
loader.h
Go to the documentation of this file.
1 /* This file is part of KCachegrind.
2  Copyright (C) 2002 - 2010 Josef Weidendorfer <Josef.Weidendorfer@gmx.de>
3 
4  KCachegrind is free software; you can redistribute it and/or
5  modify it under the terms of the GNU General Public
6  License as published by the Free Software Foundation, version 2.
7 
8  This program is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  General Public License for more details.
12 
13  You should have received a copy of the GNU General Public License
14  along with this program; see the file COPYING. If not, write to
15  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16  Boston, MA 02110-1301, USA.
17 */
18 
19 /*
20  * Base class for loaders of profiling data.
21  */
22 
23 #ifndef LOADER_H
24 #define LOADER_H
25 
26 #include <QList>
27 #include <QString>
28 
29 class QIODevice;
30 class TraceData;
31 class Loader;
32 class Logger;
33 
51 class Loader
52 {
53 public:
54  Loader(const QString& name, const QString& desc);
55  virtual ~Loader();
56 
57  // reimplement for a specific Loader
58  virtual bool canLoad(QIODevice* file);
59  /* load a profile data file.
60  * for every section (time span covered by profile), create a TracePart
61  * return the number of sections loaded (0 on error)
62  */
63  virtual int load(TraceData*, QIODevice* file, const QString& filename);
64 
65  static Loader* matchingLoader(QIODevice* file);
66  static Loader* loader(const QString& name);
67  static void initLoaders();
68  static void deleteLoaders();
69 
70  QString name() const { return _name; }
71  QString description() const { return _description; }
72 
73  // consumer for notifications
74  void setLogger(Logger*);
75 
76 protected:
77  // notifications for the user
78  void loadStart(const QString& filename);
79  void loadProgress(int progress); // 0 - 100
80  void loadError(int line, const QString& msg);
81  void loadWarning(int line, const QString& msg);
82  void loadFinished(const QString &msg = QString::null);
83 
84 protected:
85  Logger* _logger;
86 
87 private:
88  QString _name, _description;
89 
90  static QList<Loader*> _loaderList;
91 };
92 
93 
94 #endif
Logger
Definition: logger.h:32
QIODevice
Loader::description
QString description() const
Definition: loader.h:71
Loader::name
QString name() const
Definition: loader.h:70
Loader::setLogger
void setLogger(Logger *)
Definition: loader.cpp:87
Loader::initLoaders
static void initLoaders()
Definition: loader.cpp:73
Loader::_logger
Logger * _logger
Definition: loader.h:85
Loader
To implement a new loader, inherit from the Loader class and and reimplement canLoad() and load()...
Definition: loader.h:51
Loader::canLoad
virtual bool canLoad(QIODevice *file)
Definition: loader.cpp:42
Loader::loadError
void loadError(int line, const QString &msg)
Definition: loader.cpp:104
Loader::loadWarning
void loadWarning(int line, const QString &msg)
Definition: loader.cpp:110
Loader::~Loader
virtual ~Loader()
Definition: loader.cpp:39
Loader::loader
static Loader * loader(const QString &name)
Definition: loader.cpp:61
QString
QList< Loader * >
Loader::loadProgress
void loadProgress(int progress)
Definition: loader.cpp:98
Loader::loadFinished
void loadFinished(const QString &msg=QString::null)
Definition: loader.cpp:116
Loader::matchingLoader
static Loader * matchingLoader(QIODevice *file)
Definition: loader.cpp:52
Loader::deleteLoaders
static void deleteLoaders()
Definition: loader.cpp:79
Loader::load
virtual int load(TraceData *, QIODevice *file, const QString &filename)
Definition: loader.cpp:47
TraceData
This class holds profiling data of multiple tracefiles generated with cachegrind on one command...
Definition: tracedata.h:1363
Loader::Loader
Loader(const QString &name, const QString &desc)
Definition: loader.cpp:31
Loader::loadStart
void loadStart(const QString &filename)
Definition: loader.cpp:92
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:39:50 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kcachegrind

Skip menu "kcachegrind"
  • Main Page
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdesdk API Reference

Skip menu "kdesdk API Reference"
  • kapptemplate
  • kcachegrind
  • kompare
  • lokalize
  • umbrello
  •   umbrello

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal