Otawa  0.10
Driver.h
Go to the documentation of this file.
1 /*
2  * $Id$
3  * Driver class interface
4  *
5  * This file is part of OTAWA
6  * Copyright (c) 2006-07, IRIT UPS.
7  *
8  * OTAWA is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * OTAWA is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with OTAWA; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21  */
22 #ifndef OTAWA_DISPLAY_DRIVER_H
23 #define OTAWA_DISPLAY_DRIVER_H
24 
25 #include <otawa/display/Graph.h>
26 
27 namespace otawa { namespace display {
28 
29 using namespace elm;
30 
31 
32 // Kind class
33 typedef enum kind_t {
43 } kind_t;
44 
45 
46 // Driver class
47 class Driver {
48 public:
49 
50  static Driver *find(string name = "");
51  static Driver *find(kind_t kind);
52 
53  virtual ~Driver(void) { }
54  virtual Graph *newGraph(
55  const PropList& defaultGraphStyle = PropList::EMPTY,
56  const PropList& defaultNodeStyle = PropList::EMPTY,
57  const PropList& defaultEdgeStyle = PropList::EMPTY) const = 0;
58 };
59 
60 
61 // Exception class
62 class Exception: public otawa::Exception {
63 public:
64  inline Exception(const String& message)
65  : otawa::Exception(message) { }
66 };
67 
68 
69 // Configuration
72 
73 } } // otawa::display
74 
75 #endif // OTAWA_DISPLAY_DRIVER_H
Definition: Driver.h:41
Definition: Driver.h:39
Driver * find(kind_t kind)
Find a driver by its output kind.
Definition: display_Graph.cpp:245
static const PropList EMPTY
This is an empty proplist for convenience.
Definition: PropList.h:66
Definition: Driver.h:36
kind_t
Definition: Driver.h:33
A driver provides facilities to display a graph.
Definition: Driver.h:47
Inst::kind_t kind
Definition: odisasm.cpp:106
Definition: Driver.h:35
Definition: Driver.h:37
Identifier< kind_t > OUTPUT_KIND
Passed to the graph style of the Driver::newGraph() method, selects the kind of output.
Definition: Driver.h:42
This class represents identifier with a typed associated value.
Definition: Identifier.h:51
Identifier< string > OUTPUT_PATH
Passed to the graph style of the Driver::newGraph() method, selects the file to output to when the dr...
cstring name
Definition: odisasm.cpp:107
Definition: Driver.h:34
This a list of properties.
Definition: PropList.h:63
Definition: Driver.h:40
virtual ~Driver(void)
Definition: Driver.h:53
A graph provides facilities to display a graph.
Definition: Graph.h:76
Exception(const String &message)
Definition: Driver.h:64
virtual String message(void)
Definition: Driver.h:38