Merge pull request #1844 from jrw972/monterey
[ACE_TAO.git] / TAO / TAO_IDL / be_include / be_visitor_argument / argument.h
blob0985975fce0798355d6d795085ba2d1bc1337414
2 //=============================================================================
3 /**
4 * @file argument.h
6 * Visitors for generation of code for Arguments
8 * @author Aniruddha Gokhale
9 */
10 //=============================================================================
13 #ifndef _BE_VISITOR_ARGUMENT_ARGUMENT_H_
14 #define _BE_VISITOR_ARGUMENT_ARGUMENT_H_
16 #include "ast_argument.h"
18 /**
19 * @class be_visitor_args
21 * @brief Generates the code for arguments output.
23 * At several stages in the code generation a node of type
24 * "be_operation" is visited, and the code for its arguments must
25 * be generated.
26 * Sometimes the argument declarations must be generated (such as
27 * in the class declaration), other the arguments names (such as
28 * in method invocations).
29 * This class implements some common functionality required across all
30 * argument visitors
32 class be_visitor_args : public be_visitor_decl
34 public:
35 /// constructor
36 be_visitor_args (be_visitor_context *ctx);
38 /// destructor
39 virtual ~be_visitor_args (void);
41 //= helper
42 /// helper that produces either a nested name for
43 /// header files or full name for others.
44 virtual const char *type_name (be_type *type,
45 const char *suffix = 0);
47 /// return the direction of the argument node
48 virtual AST_Argument::Direction direction (void);
50 /// must be overridden by derived classes
51 virtual int visit_argument (be_argument *node);
53 void set_fixed_direction (AST_Argument::Direction direction);
55 protected:
56 /// Consolidation of common code from invoke_cs and marshal_ss
57 /// for predefined type args.
58 int gen_pd_arg (be_predefined_type *node,
59 bool for_stub);
61 private:
62 int fixed_direction_;
65 #endif /* _BE_VISITOR_ARGUMENT_ARGUMENT_H_ */