1 // This may look like C, but it's really -*- C++ -*-
6 Copyright 1992, 1993, 1994 Sun Microsystems, Inc. Printed in the United
7 States of America. All Rights Reserved.
9 This product is protected by copyright and distributed under the following
10 license restricting its use.
12 The Interface Definition Language Compiler Front End (CFE) is made
13 available for your use provided that you include this license and copyright
14 notice on all media and documentation and the software program in which
15 this product is incorporated in whole or part. You may copy and extend
16 functionality (but may not remove functionality) of the Interface
17 Definition Language CFE without charge, but you are not authorized to
18 license or distribute it to anyone else except as part of a product or
19 program developed by you or with the express written consent of Sun
20 Microsystems, Inc. ("Sun").
22 The names of Sun Microsystems, Inc. and any of its subsidiaries or
23 affiliates may not be used in advertising or publicity pertaining to
24 distribution of Interface Definition Language CFE as permitted herein.
26 This license is effective until terminated by Sun for failure to comply
27 with this license. Upon termination, you shall destroy or return all code
28 and documentation for the Interface Definition Language CFE.
30 INTERFACE DEFINITION LANGUAGE CFE IS PROVIDED AS IS WITH NO WARRANTIES OF
31 ANY KIND INCLUDING THE WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS
32 FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR ARISING FROM A COURSE OF
33 DEALING, USAGE OR TRADE PRACTICE.
35 INTERFACE DEFINITION LANGUAGE CFE IS PROVIDED WITH NO SUPPORT AND WITHOUT
36 ANY OBLIGATION ON THE PART OF Sun OR ANY OF ITS SUBSIDIARIES OR AFFILIATES
37 TO ASSIST IN ITS USE, CORRECTION, MODIFICATION OR ENHANCEMENT.
39 SUN OR ANY OF ITS SUBSIDIARIES OR AFFILIATES SHALL HAVE NO LIABILITY WITH
40 RESPECT TO THE INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY
41 INTERFACE DEFINITION LANGUAGE CFE OR ANY PART THEREOF.
43 IN NO EVENT WILL SUN OR ANY OF ITS SUBSIDIARIES OR AFFILIATES BE LIABLE FOR
44 ANY LOST REVENUE OR PROFITS OR OTHER SPECIAL, INDIRECT AND CONSEQUENTIAL
45 DAMAGES, EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
47 Use, duplication, or disclosure by the government is subject to
48 restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in
49 Technical Data and Computer Software clause at DFARS 252.227-7013 and FAR
52 Sun, Sun Microsystems and the Sun logo are trademarks or registered
53 trademarks of Sun Microsystems, Inc.
57 Mountain View, California 94043
61 SunOS, SunSoft, Sun, Solaris, Sun Microsystems or the Sun logo are
62 trademarks or registered trademarks of Sun Microsystems, Inc.
66 #ifndef _AST_OPERATION_AST_OPERATION_HH
67 #define _AST_OPERATION_AST_OPERATION_HH
70 #include "utl_scope.h"
75 class TAO_IDL_FE_Export AST_Operation
: public virtual AST_Decl
,
76 public virtual UTL_Scope
79 // Define enum with flags for operation attributes.
82 OP_noflags
// No flags present.
83 , OP_oneway
// Operation is oneway.
84 , OP_idempotent
// Operation is idempotent.
87 AST_Operation (AST_Type
*return_type
,
93 virtual ~AST_Operation (void);
97 AST_Type
*return_type (void);
101 UTL_StrList
*context (void);
103 UTL_ExceptList
*exceptions (void);
105 // Public operations.
107 bool void_return_type (void);
108 /// Returns 1 if the operation has a void return type.
110 /// Return the number of arguments
111 virtual int argument_count (void);
113 /// Return the flag indicating a request sends argument data
114 virtual bool has_in_arguments (void);
116 /// Count the number of arguments of a certain type.
118 * @param direction_mask limit the direction (IN, OUT or INOUT) of
119 * the arguments considered. Typically used as follows:
122 * ast_operation->count_arguments_with_direction
123 * (AST_Argument::dir_IN
124 * | AST_Argument::dir_OUT);
126 int count_arguments_with_direction (int direction_mask
);
128 virtual int has_native (void);
129 // Any of the arguments or the return value is a <native> type.
130 // This is important because in that case no code should be
131 // generated for the stubs.
135 DEF_NARROW_FROM_DECL(AST_Operation
);
136 DEF_NARROW_FROM_SCOPE(AST_Operation
);
139 virtual void dump (ACE_OSTREAM_TYPE
&o
);
142 virtual void destroy (void);
145 virtual int ast_accept (ast_visitor
*visitor
);
147 // Method to add exceptions
148 UTL_ExceptList
*be_add_exceptions (UTL_ExceptList
*t
);
150 static AST_Decl::NodeType
const NT
;
152 virtual bool annotatable () const;
157 AST_Type
*pd_return_type
;
163 UTL_StrList
*pd_context
;
166 UTL_ExceptList
*pd_exceptions
;
170 // Number of arguments.
172 bool has_in_arguments_
;
173 // True if any arguments are IN or INOUT
176 // Is any argument of type native.
180 int compute_argument_attr (void);
181 // Count the number of arguments.
183 // Scope Management Protocol.
185 friend int tao_yyparse (void);
186 virtual AST_Argument
*fe_add_argument (AST_Argument
*a
);
187 virtual UTL_StrList
*fe_add_context (UTL_StrList
*c
);
188 virtual UTL_NameList
*fe_add_exceptions (UTL_NameList
*e
);
191 #endif // _AST_OPERATION_AST_OPERATION_HH