summaryrefslogtreecommitdiff
path: root/modules/TAO/TAO_IDL/be_include/be_visitor_home/home_svs.h
blob: c3fbcc394eaef803ee9b6b7545849db66f2a1778 (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
//
// $Id$
//
/* -*- c++ -*- */
// ============================================================================
//
// = LIBRARY
//    TAO IDL
//
// = FILENAME
//    home_svs.h
//
// = DESCRIPTION
//    Concrete visitor for the Home node.
//    This provides for code generation in the servant source
//
// = AUTHOR
//    Jeff Parsons
//
// ============================================================================

#ifndef _BE_HOME_HOME_SVS_H_
#define _BE_HOME_HOME_SVS_H_

class be_visitor_home_svs : public be_visitor_scope
{
  //
  // = TITLE
  //   be_visitor_home_svs
  //
  // = DESCRIPTION
  //   This is a concrete visitor to generate the servant header for component.
  //
  //
public:
  be_visitor_home_svs (be_visitor_context *ctx);
  
  ~be_visitor_home_svs (void);
  
  virtual int visit_home (be_home *node);
  virtual int visit_operation (be_operation *node);
  virtual int visit_attribute (be_attribute *node);
  virtual int visit_argument (be_argument *node);
  
private:
  int gen_servant_class (void);
  
  int gen_ops_attrs (void);
  
  int gen_factories (void);
  int gen_factories_r (AST_Home *node);
  
  int gen_finders (void);
  int gen_finders_r (AST_Home *node);
  
  int gen_init_ops (AST_Home::INIT_LIST & list,
                    bool finder_list);
  
  void gen_entrypoint (void);
  
  /// Helper method passed to traverse_inheritance_graph(),
  /// collects supported operations and attributes.
  static int op_attr_defn_helper (be_interface *,
                                  be_interface *,
                                  TAO_OutStream *);
                     
private:
  be_home *node_;
  AST_Component *comp_;
  TAO_OutStream &os_;
  ACE_CString export_macro_;
  bool swapping_;
};

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