summaryrefslogtreecommitdiff
path: root/TAO/TAO_IDL/be/be_visitor_root/root_ch.cpp
blob: 4eb2af89c379f49794e2ad79a4b6f13d0d348942 (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
//
// $Id$
//

// ============================================================================
//
// = LIBRARY
//    TAO IDL
//
// = FILENAME
//    root_ch.cpp
//
// = DESCRIPTION
//    Visitor generating code for Root in the client header
//
// = AUTHOR
//    Aniruddha Gokhale
//
// ============================================================================

ACE_RCSID (be_visitor_root, 
           root_ch, 
           "$Id$")

// ********************************
// Root visitor for client header
// ********************************

be_visitor_root_ch::be_visitor_root_ch (be_visitor_context *ctx)
  : be_visitor_root (ctx)
{
}

be_visitor_root_ch::~be_visitor_root_ch (void)
{
}

int
be_visitor_root_ch::init (void)
{
  // First open the client-side header file for writing
  if (tao_cg->start_client_header (be_global->be_get_client_hdr_fname ())
        == -1)
    {
      ACE_ERROR_RETURN ((LM_ERROR,
                         "(%N:%l) be_visitor_root_ch::init - "
                         "Error opening client header file\n"),
                        -1);
    }

  // Initialize the stream.
  this->ctx_->stream (tao_cg->client_header ());

  // If this IDL file contains an interface declaration, generated a
  // forward declaration of the proxy broker for a possible collocated call.
  if (ACE_BIT_ENABLED (idl_global->decls_seen_info_,
                       idl_global->decls_seen_masks.interface_seen_))
    {
      TAO_OutStream *os = this->ctx_->stream ();

      *os << be_nl << be_nl 
          << "// TAO_IDL - Generated from " << be_nl 
          << "// " << __FILE__ << ":" << __LINE__;

      *os << be_nl << be_nl
          << "namespace TAO" << be_nl
          << "{" << be_idt_nl
          << "class Collocation_Proxy_Broker;" << be_uidt_nl
          << "}";
    }

  return 0;
}