~ubuntu-branches/ubuntu/breezy/ace/breezy

« back to all changes in this revision

Viewing changes to TAO/TAO_IDL/be/be_visitor_operation/operation_is.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad, Benjamin Montgomery, Adam Conrad
  • Date: 2005-09-18 22:51:38 UTC
  • mfrom: (1.2.1 upstream) (2.1.1 sarge) (0.1.2 woody)
  • Revision ID: james.westby@ubuntu.com-20050918225138-seav22q6fyylb536
Tags: 5.4.7-3ubuntu1
[ Benjamin Montgomery ]
* Added a patch for amd64 and powerpc that disables the compiler
  option -fvisibility-inlines-hidden

[ Adam Conrad ]
* Added DPATCH_OPTION_CPP=1 to debian/patches/00options to make
  Benjamin's above changes work correctly with dpatch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// operation_is.cpp,v 1.11 2003/06/09 18:58:19 parsons Exp
2
 
 
3
 
// ============================================================================
4
 
//
5
 
// = LIBRARY
6
 
//    TAO IDL
7
 
//
8
 
// = FILENAME
9
 
//    operation_is.cpp
10
 
//
11
 
// = DESCRIPTION
12
 
//    Visitor generating code for Operation in the implementation skeleton
13
 
//
14
 
// = AUTHOR
15
 
//   Yamuna Krishnamurthy (yamuna@cs.wustl.edu)
16
 
//
17
 
// ============================================================================
18
 
 
19
 
ACE_RCSID (be_visitor_operation, 
20
 
           operation_is, 
21
 
           "operation_is.cpp,v 1.11 2003/06/09 18:58:19 parsons Exp")
22
 
 
23
 
// ************************************************************
24
 
// Operation visitor for implementation skeleton
25
 
// ************************************************************
26
 
 
27
 
be_visitor_operation_is::be_visitor_operation_is (be_visitor_context *ctx)
28
 
  : be_visitor_operation (ctx)
29
 
{
30
 
}
31
 
 
32
 
be_visitor_operation_is::~be_visitor_operation_is (void)
33
 
{
34
 
}
35
 
 
36
 
int
37
 
be_visitor_operation_is::visit_operation (be_operation *node)
38
 
{
39
 
  TAO_OutStream *os = this->ctx_->stream ();
40
 
  be_interface *intf = this->ctx_->interface ();
41
 
 
42
 
  this->ctx_->node (node); // save the node
43
 
 
44
 
  // STEP I: generate the return type
45
 
  be_type *bt = be_type::narrow_from_decl (node->return_type ());
46
 
 
47
 
  if (!bt)
48
 
    {
49
 
      ACE_ERROR_RETURN ((LM_ERROR,
50
 
                         "(%N:%l) be_visitor_operation_is::"
51
 
                         "visit_operation - "
52
 
                         "Bad return type\n"),
53
 
                        -1);
54
 
    }
55
 
 
56
 
  *os << "// TAO_IDL - Generated from" << be_nl
57
 
      << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
58
 
 
59
 
  be_visitor_context ctx (*this->ctx_);
60
 
  be_visitor_operation_rettype oro_visitor (&ctx);
61
 
 
62
 
  if (bt->accept (&oro_visitor) == -1)
63
 
    {
64
 
      ACE_ERROR_RETURN ((LM_ERROR,
65
 
                         "(%N:%l) be_visitor_operation_is::"
66
 
                         "visit_operation - "
67
 
                         "codegen for return type failed\n"),
68
 
                        -1);
69
 
    }
70
 
 
71
 
  const char *classname = 0;
72
 
 
73
 
  if (intf)
74
 
    {
75
 
      // If derived class/
76
 
      classname = intf->flat_name ();
77
 
    }
78
 
  else
79
 
    {
80
 
      classname = ScopeAsDecl (node->defined_in ())->flat_name ();
81
 
    }
82
 
 
83
 
  // STEP 2: generate the operation name
84
 
  *os << " " << be_global->impl_class_prefix () << classname
85
 
      << be_global->impl_class_suffix () << "::" << node->local_name ();
86
 
 
87
 
  // STEP 3: generate the argument list with the appropriate mapping. For these
88
 
  // we grab a visitor that generates the parameter listing
89
 
  ctx = *this->ctx_;
90
 
  ctx.state (TAO_CodeGen::TAO_OPERATION_ARGLIST_IS);
91
 
  be_visitor_operation_arglist oa_visitor (&ctx);
92
 
 
93
 
  if (node->accept (&oa_visitor) == -1)
94
 
    {
95
 
      ACE_ERROR_RETURN ((LM_ERROR,
96
 
                         "(%N:%l) be_visitor_operation_is::"
97
 
                         "visit_operation - "
98
 
                         "codegen for argument list failed\n"),
99
 
                        -1);
100
 
    }
101
 
 
102
 
  *os << be_nl << "{" << be_idt_nl;
103
 
  *os << "// Add your implementation here" << be_uidt_nl;
104
 
  *os << "}" << be_nl << be_nl;
105
 
 
106
 
  return 0;
107
 
}
108