ROSE  0.9.6a
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classhierarchy.h
Go to the documentation of this file.
1 /******************************************************************************
2  *
3  * ROSE Global Database Test
4  *
5  * Classhierarchy implementation
6  *
7  *****************************************************************************/
8 
9 #ifndef CLASSHIERARCHY_H
10 #define CLASSHIERARCHY_H
11 
12 #include "/home/thuerey1/local/include/config.h"
13 
14 #include "DatabaseGraph.h"
15 #ifndef TABLES_DEFINED
17 #endif
18 
19 //typedef set<SgMemberFunctionType *> chVertexData;
20 //typedef set<SgNode *> chVertexData;
21 
22 class chVertexData {
23  public:
25  set<SgNode *> defined;
26  set<SgNode *> inherited;
27  map<SgNode *, set<SgNode *> > multDeclarations;
28 };
29 
30 // install boost database graph property map types
31 namespace boost {
33  BOOST_INSTALL_PROPERTY( vertex, classhierarchy );
34 }
35 
36 
39 public DatabaseGraph<typesRowdata, EdgeTypeEmpty,
40  setS, vecS, bidirectionalS, property< vertex_classhierarchy_t, chVertexData, GraphvizVertexProperty>,
41  GraphvizEdgeProperty,
42  GraphvizGraphProperty >
43 {
44  public:
46  Classhierarchy( long pid, long type, GlobalDatabaseConnection *gdb ) :
47  DatabaseGraph<typesRowdata, EdgeTypeEmpty, setS, vecS, bidirectionalS,
48  property< vertex_classhierarchy_t, chVertexData, GraphvizVertexProperty>,
49  GraphvizEdgeProperty,
50  GraphvizGraphProperty >(pid,type,gdb) { };
51 
54 
57 
59  vector<SgMemberFunctionDeclaration*> searchMemberFunctionCalls(SgMemberFunctionDeclaration*);
60 
61  private:
62 };
63 
64 
65 
66 
67 /******************************************************************************
68  * traversal classes
69  *****************************************************************************/
70 
71 
72 // Build an inherited attribute for the classhierarchy traversal
74 {
75  public:
77  ClasshierarchyInhAttr ( SgNode* astNode ) { };
78 
79  ClasshierarchyInhAttr ( const ClasshierarchyInhAttr & X, SgNode* astNode ) { };
80 
81  private:
82 
84 };
85 
86 
87 // tree traversal for class hierarchy generation
89 : public SgTopDownProcessing<ClasshierarchyInhAttr>
90 {
91  public:
94  {
95  mProjectId = -1;
96  mFileId = -1;
97  mClasshierarchy = NULL;
98  mpSgProject = NULL;
99  };
100 
101  // Functions required by the tree traversal mechanism
103  SgNode* astNode,
104  ClasshierarchyInhAttr inheritedAttribute );
105 
106 
108  void removeDeletedFunctionRows( void );
109 
110 
112  void setFileScopes( vector<long> *set ){ mpFileScopes = set; };
114  vector<long> *getFileScopes( void ) { return mpFileScopes; };
115 
117  void setDB( GlobalDatabaseConnection *set ){ mpGDB = set; };
119  GlobalDatabaseConnection *getDB( void ) { return mpGDB; };
120 
122  void setProjectId( long set ){ mProjectId = set; };
124  long getProjectId( void ){ return mProjectId; };
125 
127  void setFileId( long set ){ mFileId = set; };
129  long getFileId( void ){ return mFileId; };
130 
135 
137  void setSgProject( SgProject *set ) { mpSgProject = set; }
139  SgProject *getSgProject( void ) { return mpSgProject; }
140 
141 
142  private:
143 
144  // ! DB connection pointer
145  GlobalDatabaseConnection *mpGDB;
146 
149 
151  long mFileId;
152 
155 
157  vector<long> *mpFileScopes;
158 
161 };
162 
163 
164 
165 #endif
166 
167 
168