summaryrefslogtreecommitdiff
path: root/modules/TAO/TAO_IDL/be/be_visitor_home/home_cs.cpp
blob: d57f034cc09c3fc312b3acb54dc4e7da76fa91bd (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
//
// $Id$
//

// ============================================================================
//
// = LIBRARY
//    TAO IDL
//
// = FILENAME
//    home_cs.cpp
//
// = DESCRIPTION
//    Visitor generating code for Component Home node in the client source.
//
// = AUTHOR
//    Jeff Parsons
//
// ============================================================================

ACE_RCSID (be_visitor_home, 
           home_cs, 
           "$Id$")

be_visitor_home_cs::be_visitor_home_cs (
    be_visitor_context *ctx
  )
  : be_visitor_decl (ctx)
{
}

be_visitor_home_cs::~be_visitor_home_cs (void)
{
}

int
be_visitor_home_cs::visit_home (be_home *node)
{
  if (node->cli_stub_gen () || node->imported ())
    {
      return 0;
    }

    if (be_global->tc_support ())
      {
        be_visitor_context ctx (*this->ctx_);
        ctx.node (node);
        TAO::be_visitor_objref_typecode tc_visitor (&ctx);

        // No double dispatch here so the objref_typecode visitor
        // can dynamic_cast the node to tell it's a home.
        if (tc_visitor.visit_interface (node) == -1)
          {
            ACE_ERROR_RETURN ((LM_ERROR,
                              "(%N:%l) be_visitor_home_cs::"
                              "visit_home - "
                              "TypeCode definition failed\n"),
                              -1);
          }
      }

  node->cli_stub_gen (true);
  return 0;
}