Merge pull request #2216 from jwillemsen/jwi-cxxversionchecks
[ACE_TAO.git] / TAO / TAO_IDL / be_include / be_visitor_operation / operation.h
blobb41e2adfe36a9b547c33b819fd7ad8e89628b182
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file operation.h
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 // ************************************************************
21 /**
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
30 public:
31 /// constructor
32 be_visitor_operation (be_visitor_context *ctx);
34 /// destructor
35 ~be_visitor_operation ();
37 // =helper
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
50 /// 0:false, 1:true
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);
57 /**
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 (
73 be_type *return_type,
74 const char *exception_name,
75 const char *exception_arguments
78 void gen_stub_body_arglist (be_operation *node,
79 TAO_OutStream *os,
80 bool ami = false);
82 void gen_arg_template_param_name (AST_Decl *scope,
83 AST_Type *bt,
84 TAO_OutStream *os);
87 #endif /* _BE_VISITOR_OPERATION_OPERATION_H_ */