All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
function.h
Go to the documentation of this file.
1 #ifndef FUNCTION_H_INCLUDED_
2 #define FUNCTION_H_INCLUDED_
3 
4 #include <vector>
5 #include <string>
6 
7 #include "rose.h"
8 
9 #include "definition.h"
10 #include "class.h"
11 
12 namespace risc {
13 
14 class Function: public Definition {
15 
16 public:
17 
21  Function(SgFunctionDefinition *ast_node, Type type = FunctionType,
22  Class *parent = NULL);
23 
28  SgFunctionDefinition* get_ast_node();
29 
33  virtual std::string get_ast_type_name();
34 
38  std::string get_name();
39 
47 
53 
54 /************** Added by Guantao Liu 08/28/2015 **************/
59  SgNode* starting_node_;
60 
64  void set_starting_node(SgNode*);
65 
66 /**************** End Guantao Liu 08/28/2015 ****************/
67 
68 private:
72  Function(const Function &f);
73 };
74 
75 typedef std::vector<Function*> FunctionVector;
76 typedef std::vector<Function*>::iterator FunctionVectorIter;
77 typedef std::vector<Function*>::const_iterator FunctionVectorConstIter;
78 
79 }; // end namespace risc
80 
81 #endif /* FUNCTION_H_INCLUDED_ */
82 
83 /* ex: set softtabstop=2 tabstop=2 shiftwidth=2 expandtab: */
std::string get_name()
returns the name of the function definition
Definition: function.cpp:20
Definition: definition.h:12
Definition: class.h:53
std::vector< Function * > FunctionVector
Definition: class.h:37
SgNode * starting_node_
This variables stores the associated function call which starts a thread, cthread, or method.
Definition: function.h:59
int starting_id_
After generating a segment graph for a thread, cthread, or method each function will have a starting ...
Definition: function.h:46
Function(SgFunctionDefinition *ast_node, Type type=FunctionType, Class *parent=NULL)
Default constructor.
Definition: function.cpp:3
Class * parent_
If this function belongs to a module/channel it has a link to its class definition.
Definition: function.h:52
void set_starting_node(SgNode *)
Sets the starting_node_.
Definition: function.cpp:35
SgFunctionDefinition * get_ast_node()
Returns the ast definition of the function.
Definition: function.cpp:15
std::vector< Function * >::const_iterator FunctionVectorConstIter
Definition: function.h:77
Type
We are using these enums to identify type type of and instance or definition during traversal...
Definition: definition.h:20
Definition: function.h:14
Definition: definition.h:27
std::vector< Function * >::iterator FunctionVectorIter
Definition: function.h:76
virtual std::string get_ast_type_name()
Returns the name of the type of the ast node.
Definition: function.cpp:26