Merge pull request #1844 from jrw972/monterey
[ACE_TAO.git] / TAO / TAO_IDL / be / be_operation.cpp
blob55a8c7ca7f79e4694e01c3bda6026f5d595ec6f1
2 //=============================================================================
3 /**
4 * @file be_operation.cpp
6 * Extension of class AST_Operation that provides additional means for C++
7 * mapping.
9 * @author Copyright 1994-1995 by Sun Microsystems
10 * @author Inc. and Aniruddha Gokhale
12 //=============================================================================
14 #include "be_operation.h"
15 #include "be_predefined_type.h"
16 #include "be_argument.h"
17 #include "be_visitor.h"
18 #include "be_util.h"
20 #include "ast_exception.h"
22 #include "utl_err.h"
23 #include "utl_exceptlist.h"
25 #include "global_extern.h"
27 be_operation::be_operation (AST_Type *rt,
28 AST_Operation::Flags fl,
29 UTL_ScopedName *n,
30 bool local,
31 bool abstract)
32 : COMMON_Base (local,
33 abstract),
34 AST_Decl (AST_Decl::NT_op,
35 n),
36 UTL_Scope (AST_Decl::NT_op),
37 AST_Operation (rt,
38 fl,
40 local,
41 abstract),
42 be_scope (AST_Decl::NT_op),
43 be_decl (AST_Decl::NT_op,
44 n),
45 is_sendc_ami_ (false),
46 is_excep_ami_ (false),
47 is_attr_op_ (false)
49 if (this->imported ())
51 return;
54 idl_global->operation_seen_ = true;
56 if (!this->is_local ())
58 be_type *bt = dynamic_cast<be_type*> (rt);
59 bt->seen_in_operation (true);
60 be_util::set_arg_seen_bit (bt);
61 idl_global->non_local_op_seen_ = true;
65 be_operation::~be_operation (void)
69 void
70 be_operation::destroy (void)
72 // Call the destroy methods of our base classes.
73 this->be_scope::destroy ();
74 this->be_decl::destroy ();
75 this->AST_Operation::destroy ();
78 int
79 be_operation::accept (be_visitor *visitor)
81 return visitor->visit_operation (this);
84 AST_Argument *
85 be_operation::be_add_argument (AST_Argument *arg)
87 this->add_to_scope (arg);
88 this->add_to_referenced (arg,
90 0);
91 return arg;
94 int
95 be_operation::be_insert_exception (AST_Exception *ex)
97 UTL_ExceptList *new_list = 0;
98 ACE_NEW_RETURN (new_list,
99 UTL_ExceptList (ex,
100 this->pd_exceptions),
101 -1);
102 this->pd_exceptions = new_list;
103 return 0;
106 bool
107 be_operation::is_sendc_ami (void) const
109 return this->is_sendc_ami_;
112 void
113 be_operation::is_sendc_ami (bool val)
115 this->is_sendc_ami_ = val;
118 bool
119 be_operation::is_excep_ami (void) const
121 return this->is_excep_ami_;
124 void
125 be_operation::is_excep_ami (bool val)
127 this->is_excep_ami_ = val;
130 bool
131 be_operation::is_attr_op (void) const
133 return this->is_attr_op_;
136 void
137 be_operation::is_attr_op (bool val)
139 this->is_attr_op_ = val;
142 IMPL_NARROW_FROM_DECL (be_operation)
143 IMPL_NARROW_FROM_SCOPE (be_operation)