summaryrefslogtreecommitdiff
path: root/trunk/CIAO/CIDLC/OperationHeaderEmitters.hpp
blob: 1f87e254e03229b47c3d589c4ca49eac3b9022e2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
// file      : CIDLC/OperationHeaderEmitters.hpp
// author    : Jeff Parsons <j.parsons@vanderbilt.edu>
// cvs-id    : $Id$

#ifndef OPERATIONHEADEREMITTERS_HPP
#define OPERATIONHEADEREMITTERS_HPP

#include "CCF/CIDL/SemanticGraph.hpp"
#include "CCF/CIDL/Traversal.hpp"

#include "EmitterBase.hpp"
#include "CorbaTypeNameEmitters.hpp"

using namespace CCF::CIDL;
using namespace CCF::CIDL::SemanticGraph;

struct OperationEmitter : Traversal::Operation,
                          EmitterBase
{
  OperationEmitter (Context& c);

  virtual void pre (Type&);

  virtual void name (Type&);

  virtual void receives_pre (Type&);

  virtual void receives_none (Type&);

  virtual void receives_post (Type&);

  virtual void raises (Type&);

  virtual void post (Type&);

  virtual void comma (Type&);
};

// HomeFactory and HomeFinder are tied to Operation in
// the front end. Since we want to treat them differently
// than regular operations in a home (we want to generate
// base class factory operations returning the base component,
// for example), we use this class for regular home operations
// that overrides HomeFactory and HomeFinder traversals
// to do nothing.
struct HomeOperationEmitter : OperationEmitter,
                              Traversal::HomeFactory,
                              Traversal::HomeFinder
{
  HomeOperationEmitter (Context& c);

  virtual void
  traverse (SemanticGraph::HomeFactory&);

  virtual void
  traverse (SemanticGraph::HomeFinder&);
};

struct FactoryOperationEmitter : Traversal::HomeFactory,
                                 EmitterBase
{
  FactoryOperationEmitter (Context& c, bool for_exec = false);

  virtual void
  pre (SemanticGraph::HomeFactory&);

  virtual void
  returns (SemanticGraph::HomeFactory&);

  virtual void
  name (SemanticGraph::HomeFactory&);

  virtual void
  receives_none (SemanticGraph::HomeFactory&);

  virtual void
  receives_pre (SemanticGraph::HomeFactory&);

  virtual void
  receives_post (SemanticGraph::HomeFactory&);

  virtual void
  raises (SemanticGraph::HomeFactory&);

  virtual void
  post (SemanticGraph::HomeFactory&);

  virtual void
  comma (SemanticGraph::HomeFactory&);

private:
  ReturnTypeNameEmitter returns_emitter_;
  Traversal::Returns returns_;
  bool for_exec_;
};

struct FinderOperationEmitter : Traversal::HomeFinder,
                                EmitterBase
{
  FinderOperationEmitter (Context& c, bool for_exec = false);

  virtual void pre (SemanticGraph::HomeFinder&);

  virtual void returns (SemanticGraph::HomeFinder&);

  virtual void name (SemanticGraph::HomeFinder&);

  virtual void receives_none (SemanticGraph::HomeFinder&);

  virtual void receives_pre (SemanticGraph::HomeFinder&);

  virtual void receives_post (SemanticGraph::HomeFinder&);

  virtual void raises (SemanticGraph::HomeFinder&);

  virtual void post (SemanticGraph::HomeFinder&);

  virtual void comma (SemanticGraph::HomeFinder&);

private:
  ReturnTypeNameEmitter returns_emitter_;
  Traversal::Returns returns_;
  bool for_exec_;
};

#endif  // OPERATIONHEADEREMITTERS_HPP