3 //=============================================================================
7 * Visitor for generating code for IDL operations in client stubs
9 * @author Aniruddha Gokhale
11 //=============================================================================
14 #ifndef _BE_VISITOR_OPERATION_OPERATION_H_
15 #define _BE_VISITOR_OPERATION_OPERATION_H_
17 // ************************************************************
18 // Generic Operation visitor with some helper methods
19 // ************************************************************
22 * @class be_visitor_operation
24 * @brief be_visitor_operation
26 * This is a base helper visitor for operation node
28 class be_visitor_operation
: public be_visitor_scope
32 be_visitor_operation (be_visitor_context
*ctx
);
35 ~be_visitor_operation ();
39 /// is my return type void?
40 virtual int void_return_type (be_type
*);
42 /// does any of the argument node have the specified direction
43 virtual int has_param_type (be_operation
*,
44 AST_Argument::Direction
);
46 /// Count the number of "in" and "inout" parameters.
47 virtual size_t count_non_out_parameters (be_operation
*node
);
49 /// Special generation of throw_spec if it is an AMH ExceptionHolder
51 virtual int is_amh_exception_holder (be_interface
*node
);
53 /// helper that generates code for raising an exception
54 virtual int gen_raise_exception (const char *exception_name
,
55 const char *exception_arguments
);
58 * Generates the code from opening brace to closing brace for
59 * stub operations. Also called (for now)
60 * from be_visitor_operation_cs, to generate operation stub
61 * bodies for abstract interfaces (unless and until abstract
62 * interfaces are made to interoperate with collocatino).
64 virtual int gen_stub_operation_body (be_operation
*node
,
65 be_type
*return_type
);
67 /// generate any info before the actual code for the stub is generated
68 int gen_pre_stub_info (be_operation
*node
);
70 /// helper that generates code for raising an exception within
71 /// interceptor's try block
72 virtual int gen_raise_interceptor_exception (
74 const char *exception_name
,
75 const char *exception_arguments
78 void gen_stub_body_arglist (be_operation
*node
,
82 void gen_arg_template_param_name (AST_Decl
*scope
,
87 #endif /* _BE_VISITOR_OPERATION_OPERATION_H_ */