summaryrefslogtreecommitdiff
path: root/TAO/TAO_IDL/be_include/be_visitor_component/component_exs.h
blob: f92b3fa6ed66f911afeb017e4f92c24b4e519973 (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
//
// $Id$
//
/* -*- c++ -*- */
// ============================================================================
//
// = LIBRARY
//    TAO_IDL_BE
//
// = FILENAME
//    component_exs.h
//
// = DESCRIPTION
//    Concrete visitor for the Component node.
//    This provides for code generation in the exec impl source
//
// = AUTHOR
//    Jeff Parsons
//
// ============================================================================

#ifndef _BE_COMPONENT_COMPONENT_EXS_H_
#define _BE_COMPONENT_COMPONENT_EXS_H_

class be_visitor_component_exs : public be_visitor_component
{
  //
  // = TITLE
  //   be_visitor_component_exs
  //
  // = DESCRIPTION
  //   This is a concrete visitor to generate the exec
  //   impl for component.
  //
  //
public:
  be_visitor_component_exs (be_visitor_context *ctx);
  
  ~be_visitor_component_exs (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);
                           
  int gen_exec_class (void);
  
  int gen_component_attrs_r (AST_Component *node);
                     
  void gen_provides_r (AST_Component *node);
   
  void gen_provides (AST_Type *obj,
                     Identifier *port_id);
                                     
  void gen_consumes_r (AST_Component *node);
  
  void gen_consumes (AST_Type *obj,
                     Identifier *port_id);
                                     
  /// Base class overrides and CIAO-specific code.                
  void gen_non_type_specific (void);
  
  void gen_entrypoint (void);
                  
private:
  be_component *node_;
  be_interface *op_scope_;
  TAO_OutStream &os_;
  const char *comment_border_;
  const char *your_code_here_;
  ACE_CString export_macro_;
};

/// Worker class passed to traverse_inheritance_graph(),
/// collects supported operations and attributes.
class Component_Exec_Op_Attr_Generator
  : public TAO_IDL_Inheritance_Hierarchy_Worker
{
public:
  Component_Exec_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_EXS_H_ */