summaryrefslogtreecommitdiff
path: root/modules/TAO/TAO_IDL/be_include/be_visitor_component/component_svs.h
blob: 7ab586b71110f573353dd152cac0166ea42d1e21 (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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
//
// $Id$
//
/* -*- c++ -*- */
// ============================================================================
//
// = LIBRARY
//    TAO IDL
//
// = FILENAME
//    component_svs.h
//
// = DESCRIPTION
//    Concrete visitor for the Component node.
//    This provides for code generation in the servant source
//
// = AUTHOR
//    Jeff Parsons
//
// ============================================================================

#ifndef _BE_COMPONENT_COMPONENT_SVS_H_
#define _BE_COMPONENT_COMPONENT_SVS_H_

class be_visitor_component_svs : public be_visitor_component
{
  //
  // = TITLE
  //   be_visitor_component_svs
  //
  // = DESCRIPTION
  //   This is a concrete visitor to generate the servant
  //   source for component.
  //
  //
public:
  be_visitor_component_svs (be_visitor_context *ctx);
  
  ~be_visitor_component_svs (void);
  
  virtual int visit_component (be_component *node);
  virtual int visit_operation (be_operation *node);
  virtual int visit_attribute (be_attribute *node);
  
private:
  int gen_facets (void);
  
  int gen_facet_ops_attrs (be_interface *node);
                           
  void gen_context_class (void);
                           
  int gen_servant_class (void);
  
  int gen_component_attrs_r (AST_Component *node);
  
  int gen_component_attrs (AST_Component *node);
                     
  void gen_provides_top (void);
  
  void gen_facet_executor_block (const char *port_name);
                  
  void gen_provides_r (AST_Component *node);
   
  void gen_provides (AST_Provides *p);
                     
  void gen_uses_context_r (AST_Component *node);
                                     
  void gen_uses_context (AST_Uses *u);
                         
  void gen_uses_context_simplex (AST_Type *obj,
                                 const char *port_name);
                
  void gen_uses_context_multiplex (AST_Type *obj,
                                   const char *port_name);
                                   
  void gen_uses_servant_top (void);
  
  void gen_connect_block (AST_Uses *u);
                          
  void gen_disconnect_block (AST_Uses *u);
                             
  void gen_uses_servant_r (AST_Component *node);
  
  void gen_uses_servant (AST_Uses *u);
                         
  void gen_receptacle_description (AST_Uses *u,
                                   ACE_CDR::ULong slot);
  
  void gen_publishes_context_r (AST_Component *node);
                
  void gen_publishes_context (AST_Publishes *p);
                              
  void gen_publishes_servant_top (void);
  
  void gen_subscribe_block (AST_Publishes *p);
                            
  void gen_unsubscribe_block (AST_Publishes *p);
                              
  void gen_event_source_description (AST_Publishes *p,
                                     ACE_CDR::ULong slot);
                                     
  void gen_publishes_servant_r (AST_Component *node);
                              
  void gen_publishes_servant (AST_Publishes *p);
                              
  void gen_consumes_r (AST_Component *node);
  
  void gen_consumes (AST_Consumes *c);
                     
  void gen_emits_context_r (AST_Component *node);
                                     
  void gen_emits_context (AST_Emits *e);
                          
  void gen_emits_servant_top (void);
  
  void gen_connect_consumer_block (AST_Emits *e);
  
  void gen_disconnect_consumer_block (AST_Emits *e);
                                      
  void gen_emitter_description (AST_Emits *e,
                                ACE_CDR::ULong slot);
  
  void gen_emits_servant_r (AST_Component *node);
  
  void gen_emits_servant (AST_Emits *e);
                          
  void gen_attr_set_r (AST_Component *node);
     
  void gen_populate_r (AST_Component *node);
  
  void gen_entrypoint (void);
  
  void gen_all_factory_registration (void);
  void gen_one_factory_registration (AST_Type *t);
  
  void gen_swapping_get_consumers_r (AST_Component *node);
  void gen_swapping_get_comsumer_block (const char *port_name);
  
  void compute_slots (AST_Component *node);
                  
private:
  be_component *node_;
  be_interface *op_scope_;
  TAO_OutStream &os_;
  ACE_CString export_macro_;
  static bool in_facets_;
  bool swapping_;
  ACE_CDR::ULong n_provides_;
  ACE_CDR::ULong n_uses_;
  ACE_CDR::ULong n_publishes_;
  ACE_CDR::ULong n_emits_;
  ACE_CDR::ULong n_consumes_;
};

/// Worker class passed to traverse_inheritance_graph(),
/// collects supported operations and attributes.
class Component_Op_Attr_Generator
  : public TAO_IDL_Inheritance_Hierarchy_Worker
{
public:
  Component_Op_Attr_Generator (be_visitor_scope * visitor);
  
  virtual int emit (be_interface * derived_interface,
                    TAO_OutStream * os,
                    be_interface * base_interface);

private:
  be_visitor_scope * visitor_;
};
                     
#endif /* _BE_COMPONENT_COMPONENT_SVS_H_ */