2 //=============================================================================
4 * @file interface_ci.cpp
6 * Visitor generating code for Interfaces in the client inline file
8 * @author Aniruddha Gokhale
10 //=============================================================================
12 #include "interface.h"
14 be_visitor_interface_ci::be_visitor_interface_ci (be_visitor_context
*ctx
)
15 : be_visitor_interface (ctx
)
19 be_visitor_interface_ci::~be_visitor_interface_ci ()
24 be_visitor_interface_ci::visit_interface (be_interface
*node
)
26 if (node
->imported ())
31 // Generate inline methods for elements of our scope.
32 // This will always be done here for any non-imported node,
33 // whether the _var and _out code has been generated already
34 // at a forward declaration or not.
35 if (this->visit_scope (node
) == -1)
37 ACE_ERROR_RETURN ((LM_ERROR
,
38 "(%N:%l) be_visitor_interface_ci::"
40 "codegen for scope failed\n"), -1);
43 // Nothing to generate for a local interface except from it scope.
44 if (node
->is_local ())
46 node
->cli_inline_gen (true);
50 // A forward declared interface may have set this flag.
51 if (node
->cli_inline_gen ())
56 TAO_OutStream
*os
= this->ctx_
->stream ();
58 TAO_INSERT_COMMENT (os
);
60 if (node
->is_abstract ())
63 << "ACE_INLINE" << be_nl
64 << node
->name () << "::" << node
->local_name ()
68 *os
<< "ACE_INLINE" << be_nl
69 << node
->name () << "::" << node
->local_name ()
70 << " (const " << node
->local_name () << " &rhs)" << be_idt_nl
71 << ": ::CORBA::AbstractBase (rhs)" << be_uidt_nl
75 // Generate the constructor from stub and servant.
76 node
->gen_stub_ctor (os
);
78 if (!node
->is_local () && !node
->is_abstract ())
81 << "ACE_INLINE" << be_nl
;
82 *os
<< node
->name () << "::"
83 << node
->local_name () << " ("
84 << be_idt
<< be_idt_nl
85 << "::IOP::IOR *ior," << be_nl
86 << "TAO_ORB_Core *oc)" << be_uidt_nl
;
87 *os
<< ": ::CORBA::Object (ior, oc)";
94 node
->cli_inline_gen (true);
99 be_visitor_interface_ci::visit_component (be_component
*node
)
101 return this->visit_interface (node
);
105 be_visitor_interface_ci::visit_connector (be_connector
*node
)
107 return this->visit_interface (node
);