C++ main module for gpm Package  1.0
GPM_Function.h
Go to the documentation of this file.
1 #ifndef GPM_Function_H
2 #define GPM_Function_H
3 
4 #include "GPM_Object.h"
5 
6 #include "CORE_Exception.h"
7 #include "CORE_Out.h"
8 
9 
10 #include "GPM_PortGraph.h"
11 
19 
20 class GPM_Function : public GPM_Object {
21  SP_OBJECT(GPM_Function);
22 
23 
24 private:
25  // ATTRIBUTES
26  // ASSOCIATIONS
27 
28  SP::GPM_PortGraph mPatternGraph;
29  SP::GPM_PortGraph mTransformerGraph;
30 
31 protected:
32  // METHODS
33 
34  // CONSTRUCTORS
35 
37  GPM_Function(void);
38 
39 
40 
41  // DESTRUCTORS
42 
43 
46  virtual ~GPM_Function(void);
47 
48 
49 
50 protected:
53  virtual void toDoAfterThisSetting() {
54  mPatternGraph=GPM_PortGraph::New();
55  mTransformerGraph=GPM_PortGraph::New();
56 
57  }
58 public:
59  // SET & GET methods
62  virtual void copy(const GPM_Function& rule);
65  virtual void clear() {
66  if (mPatternGraph.get()!=null) mPatternGraph->clear();
67  if (mTransformerGraph.get()!=null) mTransformerGraph->clear();
68  }
71  inline void setPatternGraph(SP::GPM_PortGraph f) {
72  mPatternGraph=f;
73  }
76  inline const GPM_PortGraph& getPatternGraph() const {
77  if ((mPatternGraph.get()==null))
78  throw CORE_Exception("gpm/core","GPM_Function::getPatternGraph","impossible to get a pattern graph from a null shared pointer !!");
79  return *mPatternGraph.get();
80  }
84  if ((mPatternGraph.get()==null))
85  throw CORE_Exception("gpm/core","GPM_Function::getPatternGraph","impossible to get a pattern graph from a null shared pointer !!");
86  return *mPatternGraph.get();
87  }
90  inline void setTransformerGraph(SP::GPM_PortGraph f) {
91  mTransformerGraph=f;
92  }
95  inline const GPM_PortGraph& getTransformerGraph() const {
96  if ((mTransformerGraph.get()==null))
97  throw CORE_Exception("gpm/core","GPM_Function::getTransformerGraph","impossible to get a pattern graph from a null shared pointer !!");
98  return *mTransformerGraph.get();
99  }
103  if ((mTransformerGraph.get()==null))
104  throw CORE_Exception("gpm/core","GPM_Function::getTransformerGraph","impossible to get a pattern graph from a null shared pointer !!");
105  return *mTransformerGraph.get();
106  }
107 
108 
109 public:
115  virtual tBoolean apply(GPM_Graph& largeGraph,
116  const vector<tVertexIID>& mappingP2L,CORE_Out& io)=0;
117 };
118 
119 #endif
void setPatternGraph(SP::GPM_PortGraph f)
set the pattern graph
Definition: GPM_Function.h:71
const GPM_PortGraph & getTransformerGraph() const
get the transformer graph for reading
Definition: GPM_Function.h:95
virtual void toDoAfterThisSetting()
method called after this setting
Definition: GPM_Function.h:53
This class describes a patten function.
Definition: GPM_Function.h:20
static SP::GPM_PortGraph New()
create a graph
Definition: GPM_PortGraph.h:75
#define tBoolean
Definition: types.h:35
GPM_PortGraph & getTransformerGraph()
get the transformer graph for writing
Definition: GPM_Function.h:102
#define null
Definition: types.h:13
GPM_PortGraph & getPatternGraph()
get the pattern graph for writing
Definition: GPM_Function.h:83
virtual void clear()
clear
Definition: GPM_Function.h:65
virtual tBoolean apply(GPM_Graph &largeGraph, const vector< tVertexIID > &mappingP2L, CORE_Out &io)=0
apply
const GPM_PortGraph & getPatternGraph() const
get the pattern graph for reading
Definition: GPM_Function.h:76
virtual void copy(const GPM_Function &rule)
copy
Definition: GPM_Function.cpp:14
this class describes the exceptions raised for CORE package
Definition: CORE_Exception.h:15
virtual ~GPM_Function(void)
destroy an object.
Definition: GPM_Function.cpp:10
DEFINE_SPTR(GPM_Function)
GPM_Function(void)
create an object
Definition: GPM_Function.cpp:4
DEFINE_SVPTR(GPM_Function)
This class describes a graph which is a list of vertices, ports & edges.
Definition: GPM_PortGraph.h:22
this class describes the output by default write on standart output
Definition: CORE_Out.h:21
void setTransformerGraph(SP::GPM_PortGraph f)
set the transformer graph
Definition: GPM_Function.h:90
This class is the base class of all graph classes.
Definition: GPM_Object.h:17
This class describes a graph which is a list of nodes & ports.
Definition: GPM_Graph.h:19