summaryrefslogtreecommitdiff
path: root/TAO/TAO_IDL/be/be_visitor_interface/amh_ss.cpp
blob: 0bb05a544bb5cab86f7574b107395212e6778240 (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
//=============================================================================
/**
 *  @file   amh_ss.cpp
 *
 *  $Id$
 *
 *  Specialized interface visitor for AMH.
 *
 *  @author Darrell Brunsch <brunsch@cs.wustl.edu>
 */
//=============================================================================

#include        "idl.h"
#include        "idl_extern.h"
#include        "be.h"

#include "be_visitor_interface.h"

be_visitor_amh_interface_ss::be_visitor_amh_interface_ss (be_visitor_context *ctx)
  : be_visitor_interface_ss (ctx)
{
}

be_visitor_amh_interface_ss::~be_visitor_amh_interface_ss (void)
{
}

void
be_visitor_amh_interface_ss::this_method (be_interface *node)
{
  TAO_OutStream *os = this->ctx_->stream ();

  // the _this () operation
  const char *non_amh_name = node->full_name () + 4;

  *os << non_amh_name << "*" << be_nl
      << node->full_skel_name ()
      << "::_this (TAO_ENV_SINGLE_ARG_DECL)" << be_nl
      << "{" << be_idt_nl // idt = 1
      << "TAO_Stub *stub = this->_create_stub (TAO_ENV_SINGLE_ARG_PARAMETER);"
      << be_nl
      << "ACE_CHECK_RETURN (0);" << be_nl << be_nl;
}

void
be_visitor_amh_interface_ss::dispatch_method (be_interface *node)
{
  TAO_OutStream *os = this->ctx_->stream ();

  // now the dispatch method
  *os << "void " << node->full_skel_name () <<
    "::_dispatch (TAO_ServerRequest &req, " <<
    "void *context TAO_ENV_ARG_DECL)" << be_nl;
  *os << "{" << be_idt_nl;
  // @todo ACE_TRY_ENV without check;
  *os << "this->asynchronous_upcall_dispatch" << be_idt_nl
      << " (req, context, this TAO_ENV_ARG_PARAMETER);" << be_uidt_nl;
  *os << "this->asynchronous_upcall_reply (req);" << be_uidt_nl;
  *os << "}" << be_nl;
}