summaryrefslogtreecommitdiff
path: root/TAO_IDL/be/be_operation.cpp
blob: 14fe829e7ec203b9a5379480c9ddcc2bf0e638ee (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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145

//=============================================================================
/**
 *  @file    be_operation.cpp
 *
 *  $Id$
 *
 *  Extension of class AST_Operation that provides additional means for C++
 *  mapping.
 *
 *
 *  @author Copyright 1994-1995 by Sun Microsystems
 *  @author Inc. and Aniruddha Gokhale
 */
//=============================================================================

#include "be_operation.h"
#include "be_predefined_type.h"
#include "be_argument.h"
#include "be_visitor.h"

#include "ast_exception.h"

#include "utl_err.h"
#include "utl_exceptlist.h"

#include "global_extern.h"

be_operation::be_operation (AST_Type *rt,
                            AST_Operation::Flags fl,
                            UTL_ScopedName *n,
                            bool local,
                            bool abstract)
  : COMMON_Base (local,
                 abstract),
    AST_Decl (AST_Decl::NT_op,
              n),
    UTL_Scope (AST_Decl::NT_op),
    AST_Operation (rt,
                   fl,
                   n,
                   local,
                   abstract),
    be_scope (AST_Decl::NT_op),
    be_decl (AST_Decl::NT_op,
             n),
    is_sendc_ami_ (false),
    is_excep_ami_ (false),
    is_attr_op_ (false)
{
  if (this->imported ())
    {
      return;
    }

  idl_global->operation_seen_ = true;

  if (!this->is_local ())
    {
      be_type *bt = be_type::narrow_from_decl (rt);
      bt->seen_in_operation (true);
      this->set_arg_seen_bit (bt);
      idl_global->non_local_op_seen_ = true;
    }
}

be_operation::~be_operation (void)
{
}

void
be_operation::destroy (void)
{
  // Call the destroy methods of our base classes.
  this->be_scope::destroy ();
  this->be_decl::destroy ();
  this->AST_Operation::destroy ();
}

int
be_operation::accept (be_visitor *visitor)
{
  return visitor->visit_operation (this);
}

AST_Argument *
be_operation::be_add_argument (AST_Argument *arg)
{
  this->add_to_scope (arg);
  this->add_to_referenced (arg,
                           0,
                           0);
  return arg;
}

int
be_operation::be_insert_exception (AST_Exception *ex)
{
  UTL_ExceptList *new_list = 0;
  ACE_NEW_RETURN (new_list,
                  UTL_ExceptList (ex,
                                  this->pd_exceptions),
                  -1);
  this->pd_exceptions = new_list;
  return 0;
}

bool
be_operation::is_sendc_ami (void) const
{
  return this->is_sendc_ami_;
}

void
be_operation::is_sendc_ami (bool val)
{
  this->is_sendc_ami_ = val;
}

bool
be_operation::is_excep_ami (void) const
{
  return this->is_excep_ami_;
}

void
be_operation::is_excep_ami (bool val)
{
  this->is_excep_ami_ = val;
}

bool
be_operation::is_attr_op (void) const
{
  return this->is_attr_op_;
}

void
be_operation::is_attr_op (bool val)
{
  this->is_attr_op_ = val;
}

IMPL_NARROW_FROM_DECL (be_operation)
IMPL_NARROW_FROM_SCOPE (be_operation)