diff options
author | William R. Otte <wotte@dre.vanderbilt.edu> | 2009-07-14 12:13:54 +0000 |
---|---|---|
committer | William R. Otte <wotte@dre.vanderbilt.edu> | 2009-07-14 12:13:54 +0000 |
commit | 00a6d3c7a315423e1e584b3c7a445be1f20ebf41 (patch) | |
tree | 06d38b591fa8a01631a2d64ccf9038f12ed5d48b /TAO/TAO_IDL/be_include | |
parent | 618d7a1736bbc5a5f7a07c56cba9a26a5ed8548a (diff) | |
download | ATCD-00a6d3c7a315423e1e584b3c7a445be1f20ebf41.tar.gz |
Tue Jul 14 11:12:09 UTC 2009 William R. Otte <wotte@dre.vanderbilt.edu>
Diffstat (limited to 'TAO/TAO_IDL/be_include')
45 files changed, 2277 insertions, 236 deletions
diff --git a/TAO/TAO_IDL/be_include/be_codegen.h b/TAO/TAO_IDL/be_include/be_codegen.h index c2d2158ea23..523dc31a67a 100644 --- a/TAO/TAO_IDL/be_include/be_codegen.h +++ b/TAO/TAO_IDL/be_include/be_codegen.h @@ -98,8 +98,6 @@ public: TAO_OPERATION_ARGLIST_SH, // ... for server header TAO_TIE_OPERATION_ARGLIST_SH, // ... for TIE class header - TAO_OPERATION_ARGLIST_PROXY_IMPL_XH, // Proxy impl arg list generation - // in client/server header TAO_OPERATION_ARGLIST_PROXY_IMPL_XS, @@ -145,6 +143,11 @@ public: TAO_ROOT_TIE_SS, TAO_ROOT_IH, TAO_ROOT_IS, + TAO_ROOT_SVH, + TAO_ROOT_SVS, + TAO_ROOT_EXH, + TAO_ROOT_EXS, + TAO_ROOT_EX_IDL, TAO_ROOT_ANY_OP_CH, TAO_ROOT_ANY_OP_CS, TAO_ROOT_CDR_OP_CH, @@ -268,6 +271,12 @@ public: int start_anyop_source (const char *fname); // Set the anyop source stream. + + int start_ciao_svnt_header (const char *fname); + int start_ciao_svnt_source (const char *fname); + int start_ciao_exec_header (const char *fname); + int start_ciao_exec_source (const char *fname); + int start_ciao_exec_idl (const char *fname); int end_client_header (void); // Generate code at the end such as the <<= and >>= operators along @@ -305,6 +314,12 @@ public: int end_anyop_source (void); // Make sure we end with a newline. + + int end_ciao_svnt_header (void); + int end_ciao_svnt_source (void); + int end_ciao_exec_header (void); + int end_ciao_exec_source (void); + int end_ciao_exec_idl (void); TAO_OutStream *client_header (void); // Get the client header stream. @@ -345,6 +360,21 @@ public: TAO_OutStream *anyop_source (void); // Get the anyop source stream. + TAO_OutStream *ciao_svnt_header (void); + // Get the CIAO servant header stream. + + TAO_OutStream *ciao_svnt_source (void); + // Get the CIAO servant source stream. + + TAO_OutStream *ciao_exec_header (void); + // Get the CIAO executor impl header stream. + + TAO_OutStream *ciao_exec_source (void); + // Get the CIAO executor impl source stream. + + TAO_OutStream *ciao_exec_idl (void); + // Get the CIAO executor impl source stream. + void gperf_input_stream (TAO_OutStream *gperf_input); // Set the gperf input file stream. @@ -382,6 +412,9 @@ public: void gen_ident_string (TAO_OutStream *stream) const; // Pass along the #ident string, if any, from the IDL file. + + void gen_export_files (void); + // Generates the export files selected on the command line. void destroy (void); // Cleanup. @@ -394,9 +427,9 @@ private: void gen_standard_include (TAO_OutStream *stream, const char *included_file, - bool add_comment=false); + bool add_comment = false); - // Utility methods for generating ORB file includes. + /// Utility methods for generating file includes. void gen_stub_hdr_includes (void); void gen_stub_src_includes (void); void gen_skel_src_includes (void); @@ -409,6 +442,17 @@ private: const char *filepath, TAO_OutStream *stream); void gen_typecode_includes (TAO_OutStream * stream); + + /// Used if one or both of the CIAO code gen flags are set. + void gen_svnt_hdr_includes (void); + void gen_svnt_src_includes (void); + void gen_exec_hdr_includes (void); + void gen_exec_src_includes (void); + void gen_exec_idl_includes (void); + + void gen_export_file (const char *filename, + const char *macro, + const char *msg); private: TAO_OutStream *client_header_; @@ -450,14 +494,29 @@ private: TAO_OutStream *gperf_input_stream_; // TAO_OutStream to collect the input for gperf program. + TAO_OutStream *ciao_svnt_header_; + // Component servant header file. + + TAO_OutStream *ciao_svnt_source_; + // Component servant source file. + + TAO_OutStream *ciao_exec_header_; + // Component executor impl header file. + + TAO_OutStream *ciao_exec_source_; + // Component executor impl source file. + + TAO_OutStream *ciao_exec_idl_; + // Component executor impl source file. + + TAO_OutStream *curr_os_; + // Currently used out stream. + char *gperf_input_filename_; // Name of the temp file used to collect the input for gperf // program. This is needed coz I do ACE_OS::open on this when I need // ACE_HANDLE for the file instead FILE*. - TAO_OutStream *curr_os_; - // Currently used out stream. - be_decl *node_; // Save current node in this. diff --git a/TAO/TAO_IDL/be_include/be_decl.h b/TAO/TAO_IDL/be_include/be_decl.h index 397dbd1cf3d..194fc347963 100644 --- a/TAO/TAO_IDL/be_include/be_decl.h +++ b/TAO/TAO_IDL/be_include/be_decl.h @@ -119,6 +119,9 @@ public: bool srv_retarg_tmpl_class_gen (void); bool srv_retarg_pragma_inst_gen (void); bool ccm_pre_proc_gen (void); + bool ex_idl_facet_gen (void); + bool svnt_hdr_facet_gen (void); + bool svnt_src_facet_gen (void); // Set the flag indicating that code generation is done. void cli_hdr_gen (bool); @@ -165,6 +168,9 @@ public: void srv_retarg_tmpl_class_gen (bool); void srv_retarg_pragma_inst_gen (bool); void ccm_pre_proc_gen (bool); + void ex_idl_facet_gen (bool); + void svnt_hdr_facet_gen (bool); + void svnt_src_facet_gen (bool); // Narrowing @@ -221,6 +227,9 @@ private: bool srv_retarg_tmpl_class_gen_; bool srv_retarg_pragma_inst_gen_; bool ccm_pre_proc_gen_; + bool ex_idl_facet_gen_; + bool svnt_hdr_facet_gen_; + bool svnt_src_facet_gen_; }; #endif // if !defined diff --git a/TAO/TAO_IDL/be_include/be_global.h b/TAO/TAO_IDL/be_include/be_global.h index 0c0fe0eaa8e..b6d9f7348aa 100644 --- a/TAO/TAO_IDL/be_include/be_global.h +++ b/TAO/TAO_IDL/be_include/be_global.h @@ -72,158 +72,253 @@ public: // name with output dir path, is useful, when I just want just the // base name to use in #include's etc. static const char *be_get_client_hdr_fname ( - bool base_name_only = 0 - ); + bool base_name_only = false); + static const char *be_get_client_stub_fname (void); + static const char *be_get_client_inline_fname ( - bool base_name_only = 0 - ); + bool base_name_only = false); + static const char *be_get_server_hdr_fname ( - bool base_name_only = 0 - ); + bool base_name_only = false); + static const char *be_get_implementation_hdr_fname ( - bool base_name_only = 0 - ); + bool base_name_only = false); + static const char *be_get_implementation_skel_fname ( - bool base_name_only = 0 - ); + bool base_name_only = false); + static const char *be_get_server_template_hdr_fname ( - bool base_name_only = 0 - ); + bool base_name_only = false); + static const char *be_get_server_skeleton_fname (void); + static const char *be_get_implementation_skeleton_fname (void); + static const char *be_get_server_template_skeleton_fname ( - bool base_name_only = 0 - ); + bool base_name_only = false); + static const char *be_get_server_inline_fname ( - bool base_name_only = 0 - ); + bool base_name_only = false); + static const char *be_get_anyop_source_fname ( - bool base_name_only = 0 - ); + bool base_name_only = false); + static const char *be_get_anyop_header_fname ( - bool base_name_only = 0 - ); + bool base_name_only = false); + + static const char *be_get_ciao_svnt_hdr_fname ( + bool base_name_only = false); + + static const char *be_get_ciao_svnt_src_fname ( + bool base_name_only = false); + + static const char *be_get_ciao_exec_hdr_fname ( + bool base_name_only = false); + + static const char *be_get_ciao_exec_src_fname ( + bool base_name_only = false); + + static const char *be_get_ciao_exec_stub_hdr_fname ( + bool base_name_only = false); + + static const char *be_get_ciao_exec_idl_fname ( + bool base_name_only = false); // Helper functions: obtain the names of each generated file given // the IDL file name. // The parameter <base_name_only> set to 0 (no base name, but full // name with output dir path, is useful, when I want just the // base name to use in #include's etc. - static const char *be_get_client_hdr (UTL_String *idl_file_name, - bool base_name_only = 0); - static const char *be_get_client_stub (UTL_String *idl_file_name); - static const char *be_get_client_inline (UTL_String *idl_file_name, - bool base_name_only = 0); - static const char *be_get_server_hdr (UTL_String *idl_file_name, - bool base_name_only = 0); - static const char *be_get_implementation_hdr (UTL_String *idl_file_name, - bool base_name_only = 0); - static const char *be_get_implementation_skel (UTL_String *idl_file_name, - bool base_name_only = 0); - static const char *be_get_server_template_hdr (UTL_String *idl_file_name, - bool base_name_only = 0); - static const char *be_get_server_skeleton (UTL_String *idl_file_name); + static const char *be_get_client_hdr ( + UTL_String *idl_file_name, + bool base_name_only = false); + + static const char *be_get_client_stub ( + UTL_String *idl_file_name); + + static const char *be_get_client_inline ( + UTL_String *idl_file_name, + bool base_name_only = false); + + static const char *be_get_server_hdr ( + UTL_String *idl_file_name, + bool base_name_only = false); + + static const char *be_get_implementation_hdr ( + UTL_String *idl_file_name, + bool base_name_only = false); + + static const char *be_get_implementation_skel ( + UTL_String *idl_file_name, + bool base_name_only = false); + + static const char *be_get_server_template_hdr ( + UTL_String *idl_file_name, + bool base_name_only = false); + + static const char *be_get_server_skeleton ( + UTL_String *idl_file_name); + static const char *be_get_server_template_skeleton ( UTL_String *idl_file_name, - bool base_name_only = 0 - ); - static const char *be_get_server_inline (UTL_String *idl_file_name, - bool base_name_only = 0); - static const char *be_get_anyop_header (UTL_String *idl_file_name, - bool base_name_only = 0); - static const char *be_get_anyop_source (UTL_String *idl_file_name, - bool base_name_only = 0); + bool base_name_only = false); + + static const char *be_get_server_inline ( + UTL_String *idl_file_name, + bool base_name_only = false); + + static const char *be_get_anyop_header ( + UTL_String *idl_file_name, + bool base_name_only = false); + + static const char *be_get_anyop_source ( + UTL_String *idl_file_name, + bool base_name_only = false); + + static const char *be_get_ciao_svnt_header ( + UTL_String *idl_file_name, + bool base_name_only = false); + + static const char *be_get_ciao_svnt_source ( + UTL_String *idl_file_name, + bool base_name_only = false); + + static const char *be_get_ciao_exec_header ( + UTL_String *idl_file_name, + bool base_name_only = false); + + static const char *be_get_ciao_exec_source ( + UTL_String *idl_file_name, + bool base_name_only = false); + + static const char *be_get_ciao_exec_stub_header ( + UTL_String *idl_file_name, + bool base_name_only = false); + + static const char *be_get_ciao_exec_idl ( + UTL_String *idl_file_name, + bool base_name_only = false); const char* skel_export_macro (void) const; - // returns the macro name for exporting server side classes in Win32 - // DLL. + /// Returns the macro name for exporting server side classes in Win32 + /// DLL. void skel_export_macro (const char* s); - // set the macro name for export server side classes in Win32 DLL. + /// Set the macro name for export server side classes in Win32 DLL. const char* skel_export_include (void) const; - // returns the name of the include file that contains the server - // side export macro definition. + /// Returns the name of the include file that contains the server + /// side export macro definition. void skel_export_include (const char* s); - // set the name of the include file that contains the server side - // export macro definition. + /// Set the name of the include file that contains the server side + /// export macro definition. const char* stub_export_macro (void) const; - // returns the macro name for exporting client side classes in Win32 - // DLL. + /// Returns the macro name for exporting client side classes in Win32 + /// DLL. void stub_export_macro (const char* s); - // set the macro name for export client side classes in Win32 DLL. + /// Set the macro name for export client side classes in Win32 DLL. const char* stub_export_include (void) const; - // returns the name of the include file that contains the client - // side export macro definition. + /// Returns the name of the include file that contains the client + /// side export macro definition. void stub_export_include (const char* s); - // set the name of the include file that contains the client side - // export macro definition. + /// Set the name of the include file that contains the client side + /// export macro definition. const char* anyop_export_macro (void) const; - // returns the macro name for exporting client side classes in Win32 - // DLL. + /// Returns the macro name for exporting *A.h file classes in Win32 + /// DLL. void anyop_export_macro (const char* s); - // set the macro name for export client side classes in Win32 DLL. + /// Set the macro name for export *A.h file classes in Win32 DLL. const char* anyop_export_include (void) const; - // returns the name of the include file that contains the client - // side export macro definition. + /// Returns the name of the include file that contains the *A.h + /// file export macro definition. void anyop_export_include (const char* s); - // set the name of the include file that contains the client side - // export macro definition. + /// Set the name of the include file that contains the *A.h file + /// export macro definition. + + const char* exec_export_macro (void) const; + /// Returns the macro name for exporting exec impl classes in Win32 + /// DLL. + + void exec_export_macro (const char* s); + /// Set the macro name for export exec impl classes in Win32 DLL. + + const char* exec_export_include (void) const; + /// Returns the name of the include file that contains the exec + /// impl export macro definition. + + void exec_export_include (const char* s); + /// Set the name of the include file that contains the exec impl + /// export macro definition. + + const char* svnt_export_macro (void) const; + /// Returns the macro name for exporting CIAO svnt classes in Win32 + /// DLL. + + void svnt_export_macro (const char* s); + /// Set the macro name for export CIAO svnt classes in Win32 DLL. + + const char* svnt_export_include (void) const; + /// Returns the name of the include file that contains the CIAO + /// svnt export macro definition. + + void svnt_export_include (const char* s); + /// Set the name of the include file that contains the CIAO svnt + /// export macro definition. const char* pch_include (void) const; - // returns the name of the include file to be used for precompiled - // header support. + /// Returns the name of the include file to be used for precompiled + /// header support. void pch_include (const char* s); - // set the name of the include file to be used for precompiled - // header support. + /// Set the name of the include file to be used for precompiled + /// header support. const char* pre_include (void) const; - // returns the name of the include file to be put at the top of - // every header file. + /// Returns the name of the include file to be put at the top of + /// every header file. void pre_include (const char* s); - // set the name of the include file to be put at the top of every - // header file. + /// Set the name of the include file to be put at the top of every + /// header file. const char* post_include (void) const; - // returns the name of the include file to be put at the bottom of - // every header file. + /// Returns the name of the include file to be put at the bottom of + /// every header file. void post_include (const char* s); - // set the name of the include file to be put at the bottom of every - // header file. + /// Set the name of the include file to be put at the bottom of every + /// header file. const char* include_guard (void) const; - // returns the guard that is placed in the client header file + /// Returns the guard that is placed in the client header file void include_guard (const char* s); - // set the guard that is placed in the client header file + /// Set the guard that is placed in the client header file const char* safe_include (void) const; - // returns the name of the include file that is used instead of the own - // generated client header file + /// Returns the name of the include file that is used instead of the own + /// generated client header file void safe_include (const char* s); - // set the name of the include file that is used instead of the own - // generated client header file + /// set the name of the include file that is used instead of the own + /// generated client header file const char* unique_include (void) const; - // returns the name of the include file that should on get - // generated in the client header file + /// Returns the name of the include file that should on get + /// generated in the client header file void unique_include (const char* s); - // set the name of the include file that should on get + // Set the name of the include file that should on get // generated in the client header file /// Set text that opens a "versioned" namespace. @@ -323,6 +418,30 @@ public: void anyop_header_ending (const char* s); // Set the anyop_header_ending. + const char* anyop_header_ending (void) const; + // Get the anyop_header_ending. + + void anyop_source_ending (const char* s); + // Set the anyop_source_ending. + + const char* anyop_source_ending (void) const; + // Get the anyop_source_ending. + + void ciao_svnt_header_ending (const char* s); + const char* ciao_svnt_header_ending (void) const; + void ciao_svnt_source_ending (const char* s); + const char* ciao_svnt_source_ending (void) const; + void ciao_exec_header_ending (const char* s); + const char* ciao_exec_header_ending (void) const; + void ciao_exec_source_ending (const char* s); + const char* ciao_exec_source_ending (void) const; + void ciao_exec_stub_header_ending (const char* s); + const char* ciao_exec_stub_header_ending (void) const; + void ciao_exec_idl_ending (const char* s); + const char* ciao_exec_idl_ending (void) const; + // Similar to above, but for CIAO servant and executor + // impl and executor IDL files, if generated. + void use_clonable_in_args (bool clonable); // Set the clonable_in_args. @@ -341,15 +460,6 @@ public: void gen_ostream_operators (bool val); // Set the gen_ostream_operators_ member. - const char* anyop_header_ending (void) const; - // Get the anyop_header_ending. - - void anyop_source_ending (const char* s); - // Set the anyop_source_ending. - - const char* anyop_source_ending (void) const; - // Get the anyop_source_ending. - void output_dir (const char* s); // Set the directory where all the IDL-Compiler-Generated files are // to be kept. Default is current directory from which the @@ -577,6 +687,38 @@ public: bool gen_custom_ending (void) const; void gen_custom_ending (bool val); // Accessors for the member gen_custom_ending_. + + bool gen_ciao_svnt (void) const; + void gen_ciao_svnt (bool val); + bool gen_ciao_exec_idl (void) const; + void gen_ciao_exec_idl (bool val); + bool gen_ciao_exec_impl (void) const; + void gen_ciao_exec_impl (bool val); + // Accessors for the corresponding members. + + bool gen_component_swapping (void) const; + void gen_component_swapping (bool val); + + bool gen_ciao_static_config (void) const; + void gen_ciao_static_config (bool val); + + bool gen_ciao_valuefactory_reg (void) const; + void gen_ciao_valuefactory_reg (bool val); + + bool gen_stub_export_hdr_file (void) const; + void gen_stub_export_hdr_file (bool val); + + bool gen_skel_export_hdr_file (void) const; + void gen_skel_export_hdr_file (bool val); + + bool gen_svnt_export_hdr_file (void) const; + void gen_svnt_export_hdr_file (bool val); + + bool gen_exec_export_hdr_file (void) const; + void gen_exec_export_hdr_file (bool val); + + bool gen_lem_force_all (void) const; + void gen_lem_force_all (bool val); ACE_CString spawn_options (void); // Command line passed to ACE_Process::spawn. Different @@ -614,6 +756,11 @@ private: char* anyop_export_macro_; char* anyop_export_include_; + char* exec_export_macro_; + char* exec_export_include_; + char* svnt_export_macro_; + char* svnt_export_include_; + char* pch_include_; char* pre_include_; char* post_include_; @@ -677,6 +824,24 @@ private: // Anyop source file name ending. Default is "A.cpp". char* anyop_src_ending_; + + // CIAO servant header file name ending. Default is "_svnt.h". + char* ciao_svnt_hdr_ending_; + + // CIAO servant source file name ending. Default is "_svnt.cpp". + char* ciao_svnt_src_ending_; + + // CIAO executor impl header file name ending. Default is "_exec.h". + char* ciao_exec_hdr_ending_; + + // CIAO executor impl source file name ending. Default is "_exec.cpp". + char* ciao_exec_src_ending_; + + // CIAO executor stub header file name ending. Default is "EC.h". + char* ciao_exec_stub_hdr_ending_; + + // CIAO executor IDL file name ending. Default is "E.idl". + char* ciao_exec_idl_ending_; char* output_dir_; // Directory where all the IDL-Compiler-Generated files are to be @@ -821,12 +986,38 @@ private: bool gen_ostream_operators_; // Generate ostream operators for each type declaration, for - // debuggin or logging. + // debugging or logging. bool gen_custom_ending_; // True by default, but a command line option can turn this off so // custom ending will not be applied to files in $TAO_ROOT/, // $TAO_ROOT/tao, $TAO_ROOT/orbsvcs, $TAO_ROOT/CIAO, $TAO_ROOT/CIAO/ciao. + + bool gen_ciao_svnt_; + bool gen_ciao_exec_idl_; + bool gen_ciao_exec_impl_; + // False by default, these flags trigger code generation + // formerly done by the CIAO CIDL compiler. + + bool gen_component_swapping_; + // Different container #includes, modified servant code. + + bool gen_ciao_static_config_; + // Suppresses generation of table guards in CIAO servants. + + bool gen_ciao_valuefactory_reg_; + // Generate automatic valuetype factory registration in + // CIAO servants. + + bool gen_stub_export_hdr_file_; + bool gen_skel_export_hdr_file_; + bool gen_svnt_export_hdr_file_; + bool gen_exec_export_hdr_file_; + // Flags to generate the various export header files. + + bool gen_lem_force_all_; + // Generate facet code for all visited interfaces, instead + // of navigating to them from provides ports. }; #endif /* _BE_GLOBAL_H */ diff --git a/TAO/TAO_IDL/be_include/be_helper.h b/TAO/TAO_IDL/be_include/be_helper.h index e0d7253e035..07e42a54096 100644 --- a/TAO/TAO_IDL/be_include/be_helper.h +++ b/TAO/TAO_IDL/be_include/be_helper.h @@ -108,7 +108,12 @@ public: TAO_SVR_TMPL_INL, TAO_SVR_IMPL, TAO_SVR_TMPL_IMPL, - TAO_GPERF_INPUT + TAO_GPERF_INPUT, + CIAO_SVNT_HDR, + CIAO_SVNT_IMPL, + CIAO_EXEC_HDR, + CIAO_EXEC_IMPL, + CIAO_EXEC_IDL }; TAO_OutStream (void); @@ -191,12 +196,11 @@ public: TAO_OutStream &operator<< (AST_Expression *expr); // output an AST_Expression node - // provided by specialized classes - virtual TAO_OutStream &print (Identifier *id) = 0; + TAO_OutStream &print (Identifier *id); - virtual TAO_OutStream &print (UTL_IdList *idl) = 0; + TAO_OutStream &print (UTL_IdList *idl); - virtual TAO_OutStream &print (AST_Expression *idl) = 0; + TAO_OutStream &print (AST_Expression *idl); protected: FILE *fp_; diff --git a/TAO/TAO_IDL/be_include/be_identifier_helper.h b/TAO/TAO_IDL/be_include/be_identifier_helper.h new file mode 100644 index 00000000000..171071f1026 --- /dev/null +++ b/TAO/TAO_IDL/be_include/be_identifier_helper.h @@ -0,0 +1,73 @@ +// $Id$ + +/* -*- c++ -*- */ +// ============================================================================ +// +// = LIBRARY +// TAO_IDL_BE_DLL +// +// = FILENAME +// be_identifier_helper.h +// +// = DESCRIPTION +// Utilities associated with UTL_Identifier. +// +// = AUTHOR +// Jeff Parsons <j.parsons@vanderbilt.edu> +// +// ============================================================================ + +#ifndef BE_IDENTIFIER_HELPER_H +#define BE_IDENTIFIER_HELPER_H + +#include "utl_scoped_name.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "TAO_IDL_BE_Export.h" +#include "ace/SString.h" + +class Identifier; +class be_type; +class be_visitor; + +struct TAO_IDL_BE_Export IdentifierHelper +{ + // + // = TITLE + // IdentifierHelper. + // + // = DESCRIPTION + // 1) keeps escape (leading underscore character in generated + // identifier in IDL + // 2) removes the '_' escape character when the identifier is + // part of another identifier such as in provides_XXX + // 3) removes any '_cxx_' in generated IDL + + static const char * + type_name (be_type *t, be_visitor *visitor); + + static Identifier * + original_local_name (Identifier * local_name); + + // Removes '_cxx_ from segments of a scoped name, and optionally + // de-escape the last segment, if it's to be appended to. + static ACE_CString + orig_sn (UTL_ScopedName * scoped_name, bool for_idl = true); + + // Detects case-insensitive match with IDL keyword. + static bool + is_idl_keyword (Identifier * local_name); + + // Preserves the 'escape' (leading underscore) in a + // generated identifier if necessary. + static ACE_CString + try_escape (Identifier * local_name); + + static ACE_CString tmp_retval_; +}; + +#endif /* BE_IDENTIFIER_HELPER_H */ + diff --git a/TAO/TAO_IDL/be_include/be_interface.h b/TAO/TAO_IDL/be_include/be_interface.h index 7b1e1209dc8..ed9d04fcd13 100644 --- a/TAO/TAO_IDL/be_include/be_interface.h +++ b/TAO/TAO_IDL/be_include/be_interface.h @@ -185,19 +185,25 @@ public: /// Iterate over the inheritance hierarchy and call the /// worker->emit() method for each interface on it. + /// CCMObject is traversed only for components regardless + /// of the flag, it is there to disable this traversal for + /// component servant and executor code generation. int traverse_inheritance_graph ( - TAO_IDL_Inheritance_Hierarchy_Worker &worker, - TAO_OutStream *os, - bool abstract_paths_only = false - ); + TAO_IDL_Inheritance_Hierarchy_Worker &worker, + TAO_OutStream *os, + bool abstract_paths_only = false, + bool add_ccm_object = true); /// Wrap the @c gen parameter and call the generic version of - /// traverse_inheritance_graph() + /// traverse_inheritance_graph(). + /// CCMObject is traversed only for components regardless + /// of the flag, it is there to disable this traversal for + /// component servant and executor code generation. int traverse_inheritance_graph ( - tao_code_emitter gen, - TAO_OutStream *os, - bool abstract_paths_only = false - ); + tao_code_emitter gen, + TAO_OutStream *os, + bool abstract_paths_only = false, + bool add_ccm_object = true); int in_mult_inheritance (void); // Am I in some form of multiple inheritance @@ -340,6 +346,19 @@ public: bool is_event_consumer (void); // Is EventConsumerBase our parent? + + void gen_facet_idl (TAO_OutStream &os); + int gen_facet_svnt_hdr (be_visitor *visitor, + TAO_OutStream &os); + int gen_facet_svnt_src (be_visitor *visitor, + TAO_OutStream &os); + // Common code for facet generation, whether we are + // navigating from the component port or forcing + // facet generation for all interfaces. + + void gen_nesting_open (TAO_OutStream &os); + void gen_nesting_close (TAO_OutStream &os); + // Helper function called from visitors and used internally. private: void gen_gperf_input_header (TAO_OutStream *ss); diff --git a/TAO/TAO_IDL/be_include/be_null_return_emitter.h b/TAO/TAO_IDL/be_include/be_null_return_emitter.h new file mode 100644 index 00000000000..47bd41a96c6 --- /dev/null +++ b/TAO/TAO_IDL/be_include/be_null_return_emitter.h @@ -0,0 +1,43 @@ +/* -*- c++ -*- */ +// $Id$ + +// ============================================================================ +// +// = LIBRARY +// TAO_IDL_BE +// +// = FILENAME +// be_null_return_emitter.h +// +// = DESCRIPTION +// Emits 'return x;' for all CORBA types and ACE-supported +// platforms. +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +#ifndef TAO_BE_NULL_RETURN_EMITTER_H +#define TAO_BE_NULL_RETURN_EMITTER_H + +class be_visitor_context; +class be_type; +class TAO_OutStream; + +class be_null_return_emitter +{ +public: + be_null_return_emitter (be_visitor_context *ctx); + ~be_null_return_emitter (void); + + int emit (be_type *node); + +private: + be_visitor_context *ctx_; + TAO_OutStream &os_; +}; + + +#endif // if !defined + diff --git a/TAO/TAO_IDL/be_include/be_stream_factory.h b/TAO/TAO_IDL/be_include/be_stream_factory.h deleted file mode 100644 index 661342632c5..00000000000 --- a/TAO/TAO_IDL/be_include/be_stream_factory.h +++ /dev/null @@ -1,61 +0,0 @@ -// $Id$ - -/* -*- c++ -*- */ -// ============================================================================ -// -// = LIBRARY -// TAO IDL Backend -// -// = FILENAME -// be_factory.h -// -// = DESCRIPTION -// Defines a factory that returns a specialized output stream object that -// understands a specific Front End -// -// = AUTHOR -// Aniruddha Gokhale -// -// ============================================================================ - -#ifndef TAO_BE_FACTORY_H -#define TAO_BE_FACTORY_H - -#include "ace/Singleton.h" -#include "ace/Synch_Traits.h" - -class TAO_OutStream; - -class TAO_OutStream_Factory -{ - // =TITLE - // TAO_OutStream_Factory - // =DESCRIPTION - // factory to produce specialized instances of the output stream objects -public: - enum TAO_OutStream_Type - { - TAO_SUNSOFT, - TAO_FLICK - }; - - TAO_OutStream_Factory (void); - // constructor - - ~TAO_OutStream_Factory (void); - // destructor - - TAO_OutStream *make_outstream (void); - // make the specialized out stream class - - int set_stream_type (TAO_OutStream_Type t); - // set the stream type - -private: - TAO_OutStream_Type strm_type_; -}; - -typedef ACE_Singleton<TAO_OutStream_Factory, ACE_SYNCH_RECURSIVE_MUTEX> TAO_OUTSTREAM_FACTORY; -// Singleton instance of the OutStream factory - -#endif /* if !defined _TAO_BE_FACTORY_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_sunsoft.h b/TAO/TAO_IDL/be_include/be_sunsoft.h deleted file mode 100644 index a44633f5395..00000000000 --- a/TAO/TAO_IDL/be_include/be_sunsoft.h +++ /dev/null @@ -1,49 +0,0 @@ -/* -*- c++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// TAO IDL -// -// = FILENAME -// be_sunsoft.h -// -// = DESCRIPTION -// SunSoft specific backend output generation -// -// = AUTHOR -// Aniruddha Gokhale -// -// ============================================================================ - -#ifndef TAO_BE_HELPER_H -#define TAO_BE_HELPER_H - -#include "be_helper.h" - -class TAO_SunSoft_OutStream : public TAO_OutStream -{ - // =TITLE - // TAO_SunSoft_OutStream - // =DESCRIPTION - // Backend specific to SunSoft AST nodes -public: - TAO_SunSoft_OutStream (void); - // constructor - - ~TAO_SunSoft_OutStream (void); - // destuctor - - virtual TAO_OutStream &print (Identifier *id); - // output the SunSoft IDL Identifier Node - - virtual TAO_OutStream &print (UTL_IdList *idl); - // output the SunSoft IDL UTL_IdList Node which is usually used to maintain a - // scoped name - - virtual TAO_OutStream &print (AST_Expression *expr); - // output the contents of the AST_Expression node -}; - -#endif // if !defined diff --git a/TAO/TAO_IDL/be_include/be_util.h b/TAO/TAO_IDL/be_include/be_util.h index f1ccf03a08f..66610d1c0b4 100644 --- a/TAO/TAO_IDL/be_include/be_util.h +++ b/TAO/TAO_IDL/be_include/be_util.h @@ -4,7 +4,7 @@ // ============================================================================ // // = LIBRARY -// TAO IDL +// TAO_IDL_BE // // = FILENAME // be_util.h @@ -25,11 +25,12 @@ class be_util { - public: - static void gen_nested_namespace_begin (TAO_OutStream *os, be_module *node); - - static void gen_nested_namespace_end (TAO_OutStream *os, be_module *node); +public: + static void + gen_nested_namespace_begin (TAO_OutStream *os, be_module *node); + static void + gen_nested_namespace_end (TAO_OutStream *os, be_module *node); }; diff --git a/TAO/TAO_IDL/be_include/be_visitor_any_extracted_type_decl.h b/TAO/TAO_IDL/be_include/be_visitor_any_extracted_type_decl.h new file mode 100644 index 00000000000..d7028dfc6d6 --- /dev/null +++ b/TAO/TAO_IDL/be_include/be_visitor_any_extracted_type_decl.h @@ -0,0 +1,66 @@ +// +// $Id$ +// +/* -*- c++ -*- */ +// ============================================================================ +// +// = LIBRARY +// TAO_IDL_BE +// +// = FILENAME +// be_visitor_any_extracted_type_decl.h +// +// = DESCRIPTION +// Encapsulation of rules for declaring variables +// for Any extraction +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +#ifndef BE_VISITOR_ANY_EXTRACTED_TYPE_DECL_H +#define BE_VISITOR_ANY_EXTRACTED_TYPE_DECL_H + +#include "be_visitor_decl.h" + +class TAO_OutStream; + +class be_visitor_any_extracted_type_decl : public be_visitor_decl +{ + // + // = TITLE + // be_visitor_any_extracted_type_decl + // + // = DESCRIPTION + // Contains overloaded methods that generate declarations of + // CORBA typenames for Any extraction + // + // +public: + be_visitor_any_extracted_type_decl (be_visitor_context *ctx); + virtual ~be_visitor_any_extracted_type_decl (void); + + virtual int visit_array (be_array *); + virtual int visit_component (be_component *); + virtual int visit_enum (be_enum *); + virtual int visit_eventtype (be_eventtype *); + virtual int visit_home (be_home *); + virtual int visit_interface (be_interface *); + virtual int visit_predefined_type (be_predefined_type *); + virtual int visit_sequence (be_sequence *); + virtual int visit_string (be_string *); + virtual int visit_structure (be_structure *); + virtual int visit_typedef (be_typedef *); + virtual int visit_union (be_union *); + virtual int visit_valuebox (be_valuebox *); + virtual int visit_valuetype (be_valuetype *); + +protected: + TAO_OutStream & os_; + const char * var_name_; + const char * tmp_name_; +}; + +#endif /* BE_VISITOR_ANY_EXTRACTED_TYPE_DECL_H */ + diff --git a/TAO/TAO_IDL/be_include/be_visitor_argument/arglist.h b/TAO/TAO_IDL/be_include/be_visitor_argument/arglist.h index 6aa736fd7b7..9bedb11fc1b 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_argument/arglist.h +++ b/TAO/TAO_IDL/be_include/be_visitor_argument/arglist.h @@ -106,9 +106,15 @@ public: virtual int visit_valuebox (be_valuebox *node); // visit valuebox + + void unused (bool val); + // Set the member. - private: +private: int emit_common (be_type *node); + +private: + bool unused_; }; #endif /* _BE_VISITOR_ARGUMENT_ARGLIST_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_attribute.h b/TAO/TAO_IDL/be_include/be_visitor_attribute.h index 66ba0d3c30b..b8849a25864 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_attribute.h +++ b/TAO/TAO_IDL/be_include/be_visitor_attribute.h @@ -22,7 +22,9 @@ #ifndef TAO_BE_VISITOR_ATTRIBUTE_H #define TAO_BE_VISITOR_ATTRIBUTE_H -#include "be_visitor_decl.h" +#include "be_visitor_any_extracted_type_decl.h" #include "be_visitor_attribute/attribute.h" +#include "be_visitor_attribute/component_init.h" +#include "be_visitor_attribute/set_from_extracted.h" #endif diff --git a/TAO/TAO_IDL/be_include/be_visitor_attribute/attribute.h b/TAO/TAO_IDL/be_include/be_visitor_attribute/attribute.h index 39e0f8f08c8..43214555ca7 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_attribute/attribute.h +++ b/TAO/TAO_IDL/be_include/be_visitor_attribute/attribute.h @@ -46,6 +46,13 @@ public: virtual int visit_attribute (be_attribute *node); // visit attribute. We provide code for this method in the derived class + + void for_facets (bool val); + void op_scope (be_interface *node); + +private: + bool for_facets_; + be_interface *op_scope_; }; #endif /* _BE_VISITOR_ATTRIBUTE_ATTRIBUTE_H*/ diff --git a/TAO/TAO_IDL/be_include/be_visitor_attribute/component_init.h b/TAO/TAO_IDL/be_include/be_visitor_attribute/component_init.h new file mode 100644 index 00000000000..25a099d9c50 --- /dev/null +++ b/TAO/TAO_IDL/be_include/be_visitor_attribute/component_init.h @@ -0,0 +1,69 @@ +// +// $Id$ +// +/* -*- c++ -*- */ +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// component_init.h +// +// = DESCRIPTION +// Visitor generating a block of code to initialize +// each of a component's read/write attributes +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +#ifndef BE_VISITOR_ATTRIBUTE_COMPONENT_INIT_H +#define BE_VISITOR_ATTRIBUTE_COMPONENT_INIT_H + +class be_visitor_attribute_component_init + : public be_visitor_any_extracted_type_decl +{ + // + // = TITLE + // be_visitor_attribute_component_init + // + // = DESCRIPTION + // Generates the body of a + // CIAO component's set_attributes() method. + // + // +public: + be_visitor_attribute_component_init (be_visitor_context *ctx); + ~be_visitor_attribute_component_init (void); + + virtual int visit_attribute (be_attribute *node); + + virtual int visit_array (be_array *node); + virtual int visit_component (be_component *node); + virtual int visit_enum (be_enum *node); + virtual int visit_eventtype (be_eventtype *node); + virtual int visit_home (be_home *node); + virtual int visit_interface (be_interface *node); + virtual int visit_predefined_type (be_predefined_type *node); + virtual int visit_sequence (be_sequence *node); + virtual int visit_string (be_string *node); + virtual int visit_structure (be_structure *node); + virtual int visit_typedef (be_typedef *node); + virtual int visit_union (be_union *node); + virtual int visit_valuebox (be_valuebox *node); + virtual int visit_valuetype (be_valuetype *node); + +private: + void emit_init_block (void); + void emit_error (const char *); + void open_if_block (void); + void close_if_block (void); + +private: + be_attribute *attr_; +}; + +#endif /* BE_VISITOR_ATTRIBUTE_COMPONENT_INIT_H */ + diff --git a/TAO/TAO_IDL/be_include/be_visitor_attribute/set_from_extracted.h b/TAO/TAO_IDL/be_include/be_visitor_attribute/set_from_extracted.h new file mode 100644 index 00000000000..878a6679108 --- /dev/null +++ b/TAO/TAO_IDL/be_include/be_visitor_attribute/set_from_extracted.h @@ -0,0 +1,58 @@ +// +// $Id$ +// +/* -*- c++ -*- */ +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// set_from_extracted.h +// +// = DESCRIPTION +// Encapsulation the variations in setting read/write +// attributes from values extracted from an Any +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +#ifndef BE_VISITOR_ATTRIBUTE_SET_FROM_EXTRACTED_H +#define BE_VISITOR_ATTRIBUTE_SET_FROM_EXTRACTED_H + +class be_visitor_attribute_set_from_extracted + : public be_visitor_any_extracted_type_decl +{ + // + // = TITLE + // be_visitor_attribute_set_from_extracted + // + // = DESCRIPTION + // Contains overloaded methods that emit arg values to be + // passed to an attribute mutator + // + // +public: + be_visitor_attribute_set_from_extracted (be_visitor_context *ctx); + virtual ~be_visitor_attribute_set_from_extracted (void); + + virtual int visit_array (be_array *); + virtual int visit_component (be_component *); + virtual int visit_enum (be_enum *); + virtual int visit_eventtype (be_eventtype *); + virtual int visit_home (be_home *); + virtual int visit_interface (be_interface *); + virtual int visit_predefined_type (be_predefined_type *); + virtual int visit_sequence (be_sequence *); + virtual int visit_string (be_string *); + virtual int visit_structure (be_structure *); + virtual int visit_typedef (be_typedef *); + virtual int visit_union (be_union *); + virtual int visit_valuebox (be_valuebox *); + virtual int visit_valuetype (be_valuetype *); +}; + +#endif /* BE_VISITOR_ATTRIBUTE_SET_FROM_EXTRACTED_H */ + diff --git a/TAO/TAO_IDL/be_include/be_visitor_component.h b/TAO/TAO_IDL/be_include/be_visitor_component.h index c3c0b2d0db4..80c678dcd27 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_component.h +++ b/TAO/TAO_IDL/be_include/be_visitor_component.h @@ -33,6 +33,11 @@ #include "be_visitor_component/component_ss.h" #include "be_visitor_component/component_ih.h" #include "be_visitor_component/component_is.h" +#include "be_visitor_component/component_svh.h" +#include "be_visitor_component/component_svs.h" +#include "be_visitor_component/component_ex_idl.h" +#include "be_visitor_component/component_exh.h" +#include "be_visitor_component/component_exs.h" #include "be_visitor_component/any_op_ch.h" #include "be_visitor_component/any_op_cs.h" #include "be_visitor_component/cdr_op_ch.h" diff --git a/TAO/TAO_IDL/be_include/be_visitor_component/component_ch.h b/TAO/TAO_IDL/be_include/be_visitor_component/component_ch.h index bdfc0a964a0..4c5ae91b20e 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_component/component_ch.h +++ b/TAO/TAO_IDL/be_include/be_visitor_component/component_ch.h @@ -26,7 +26,7 @@ class be_visitor_component_ch : public be_visitor_component { // // = TITLE - // be_visitor_interface_ch + // be_visitor_component_ch // // = DESCRIPTION // This is a concrete visitor to generate the client header for component. diff --git a/TAO/TAO_IDL/be_include/be_visitor_component/component_ex_idl.h b/TAO/TAO_IDL/be_include/be_visitor_component/component_ex_idl.h new file mode 100644 index 00000000000..767cc3e069c --- /dev/null +++ b/TAO/TAO_IDL/be_include/be_visitor_component/component_ex_idl.h @@ -0,0 +1,77 @@ +// +// $Id$ +// +/* -*- c++ -*- */ +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// component_ex_idl.h +// +// = DESCRIPTION +// Concrete visitor for the Component node. +// Provides code generation for components in the CIAO executor IDL +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +#ifndef _BE_COMPONENT_COMPONENT_EX_IDL_H_ +#define _BE_COMPONENT_COMPONENT_EX_IDL_H_ + +class be_visitor_component_ex_idl : public be_visitor_scope +{ + // + // = TITLE + // be_visitor_component_ex_idl + // + // = DESCRIPTION + // This is a concrete visitor to generate the + // CIAO executor IDL for component. + // + // +public: + be_visitor_component_ex_idl (be_visitor_context *ctx); + + ~be_visitor_component_ex_idl (void); + + virtual int visit_component (be_component *node); + + /// To regenerate attribute declarations. + virtual int visit_attribute (be_attribute *node); + + /// To regenerate the name of the attribute's referenced + /// (anonymous) type. Anonymous arrays are not allowed. + virtual int visit_string (be_string *node); + virtual int visit_sequence (be_sequence *node); + +private: + void gen_facets (void); + + void gen_component (void); + void gen_executor_base (void); + void gen_supported (void); + void gen_executor_contents (void); + void gen_facet_ops (void); + void gen_consumer_ops (void); + + void gen_exception_list (UTL_ExceptList *exceptions, + const char *prefix = "", + bool closed = true); + + void gen_context (void); + void gen_publisher_ops (void); + void gen_emitter_ops (void); + void gen_receptacle_ops (void); + + void gen_executor_derived (void); + +private: + be_component *node_; + TAO_OutStream &os_; +}; + +#endif /* _BE_COMPONENT_COMPONENT_EX_IDL_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_component/component_exh.h b/TAO/TAO_IDL/be_include/be_visitor_component/component_exh.h new file mode 100644 index 00000000000..6f97ad9725f --- /dev/null +++ b/TAO/TAO_IDL/be_include/be_visitor_component/component_exh.h @@ -0,0 +1,81 @@ +// +// $Id$ +// +/* -*- c++ -*- */ +// ============================================================================ +// +// = LIBRARY +// TAO_IDL_BE +// +// = FILENAME +// component_exh.h +// +// = DESCRIPTION +// Concrete visitor for the Component node. +// This provides for code generation in the exec impl header +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +#ifndef _BE_COMPONENT_COMPONENT_EXH_H_ +#define _BE_COMPONENT_COMPONENT_EXH_H_ + +class be_visitor_component_exh : public be_visitor_component +{ + // + // = TITLE + // be_visitor_component_exh + // + // = DESCRIPTION + // This is a concrete visitor to generate the servant header for component. + // + // +public: + be_visitor_component_exh (be_visitor_context *ctx); + + ~be_visitor_component_exh (void); + + virtual int visit_component (be_component *node); + virtual int visit_operation (be_operation *node); + virtual int visit_attribute (be_attribute *node); + +private: + int gen_facets (void); + + int gen_facet_ops_attrs (be_interface *node); + + int gen_exec_class (void); + + int gen_component_attrs_r (AST_Component *node); + + void gen_provides_r (AST_Component *node); + + void gen_provides (AST_Type *obj, + const char *port_name); + + void gen_consumes_r (AST_Component *node); + + void gen_consumes (const char *obj_name, + const char *port_name); + + /// Base class overrides and CIAO-specific code. + void gen_non_type_specific (void); + + void gen_entrypoint (void); + + /// Helper method passed to traverse_inheritance_graph(), + /// collects supported operations and attributes. + static int op_attr_decl_helper (be_interface *, + be_interface *, + TAO_OutStream *); + +private: + be_component *node_; + TAO_OutStream &os_; + ACE_CString export_macro_; +}; + +#endif /* _BE_COMPONENT_COMPONENT_EXH_H_ */ + diff --git a/TAO/TAO_IDL/be_include/be_visitor_component/component_exs.h b/TAO/TAO_IDL/be_include/be_visitor_component/component_exs.h new file mode 100644 index 00000000000..f92b3fa6ed6 --- /dev/null +++ b/TAO/TAO_IDL/be_include/be_visitor_component/component_exs.h @@ -0,0 +1,95 @@ +// +// $Id$ +// +/* -*- c++ -*- */ +// ============================================================================ +// +// = LIBRARY +// TAO_IDL_BE +// +// = FILENAME +// component_exs.h +// +// = DESCRIPTION +// Concrete visitor for the Component node. +// This provides for code generation in the exec impl source +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +#ifndef _BE_COMPONENT_COMPONENT_EXS_H_ +#define _BE_COMPONENT_COMPONENT_EXS_H_ + +class be_visitor_component_exs : public be_visitor_component +{ + // + // = TITLE + // be_visitor_component_exs + // + // = DESCRIPTION + // This is a concrete visitor to generate the exec + // impl for component. + // + // +public: + be_visitor_component_exs (be_visitor_context *ctx); + + ~be_visitor_component_exs (void); + + virtual int visit_component (be_component *node); + virtual int visit_operation (be_operation *node); + virtual int visit_attribute (be_attribute *node); + +private: + int gen_facets (void); + + int gen_facet_ops_attrs (be_interface *node); + + int gen_exec_class (void); + + int gen_component_attrs_r (AST_Component *node); + + void gen_provides_r (AST_Component *node); + + void gen_provides (AST_Type *obj, + Identifier *port_id); + + void gen_consumes_r (AST_Component *node); + + void gen_consumes (AST_Type *obj, + Identifier *port_id); + + /// Base class overrides and CIAO-specific code. + void gen_non_type_specific (void); + + void gen_entrypoint (void); + +private: + be_component *node_; + be_interface *op_scope_; + TAO_OutStream &os_; + const char *comment_border_; + const char *your_code_here_; + ACE_CString export_macro_; +}; + +/// Worker class passed to traverse_inheritance_graph(), +/// collects supported operations and attributes. +class Component_Exec_Op_Attr_Generator + : public TAO_IDL_Inheritance_Hierarchy_Worker +{ +public: + Component_Exec_Op_Attr_Generator (be_visitor_scope * visitor); + + virtual int emit (be_interface * derived_interface, + TAO_OutStream * os, + be_interface * base_interface); + +private: + be_visitor_scope * visitor_; +}; + +#endif /* _BE_COMPONENT_COMPONENT_EXS_H_ */ + diff --git a/TAO/TAO_IDL/be_include/be_visitor_component/component_svh.h b/TAO/TAO_IDL/be_include/be_visitor_component/component_svh.h new file mode 100644 index 00000000000..7f0972b38b9 --- /dev/null +++ b/TAO/TAO_IDL/be_include/be_visitor_component/component_svh.h @@ -0,0 +1,106 @@ +// +// $Id$ +// +/* -*- c++ -*- */ +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// component_svh.h +// +// = DESCRIPTION +// Concrete visitor for the Component node. +// This provides for code generation in the servant header +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +#ifndef _BE_COMPONENT_COMPONENT_SVH_H_ +#define _BE_COMPONENT_COMPONENT_SVH_H_ + +class be_visitor_component_svh : public be_visitor_component +{ + // + // = TITLE + // be_visitor_component_svh + // + // = DESCRIPTION + // This is a concrete visitor to generate the servant header for component. + // + // +public: + be_visitor_component_svh (be_visitor_context *ctx); + + ~be_visitor_component_svh (void); + + virtual int visit_component (be_component *node); + virtual int visit_operation (be_operation *node); + virtual int visit_attribute (be_attribute *node); + +private: + enum port_kind + { + PROVIDES, + USES, + PUBLISHES, + CONSUMES, + EMITS, + NUM_PORT_KINDS + }; + + int gen_facets (void); + + void gen_context_class (void); + + void gen_context_r (AST_Component *node); + + int gen_servant_class (void); + + int gen_servant_r (AST_Component *node); + + int gen_component_attrs (AST_Component *node); + + void gen_ports (AST_Component *node, + port_kind kind, + bool in_servant); + + void gen_provides (AST_Component::port_description *pd); + + void gen_uses (AST_Component::port_description *pd, + bool in_servant); + + void gen_publishes (const char *obj_name, + const char *port_name, + bool in_servant); + + void gen_consumes (const char *obj_name, + const char *port_name); + + void gen_emits (const char *obj_name, + const char *port_name, + bool in_servant); + + /// Base class overrides and CIAO-specific code. + void gen_non_type_specific (void); + + void gen_entrypoint (void); + + /// Helper method passed to traverse_inheritance_graph(), + /// collects supported operations and attributes. + static int op_attr_decl_helper (be_interface *, + be_interface *, + TAO_OutStream *); + +private: + be_component *node_; + TAO_OutStream &os_; + ACE_CString export_macro_; + bool in_ancestor_; +}; + +#endif /* _BE_COMPONENT_COMPONENT_SVH_H_ */ + diff --git a/TAO/TAO_IDL/be_include/be_visitor_component/component_svs.h b/TAO/TAO_IDL/be_include/be_visitor_component/component_svs.h new file mode 100644 index 00000000000..de3a7477142 --- /dev/null +++ b/TAO/TAO_IDL/be_include/be_visitor_component/component_svs.h @@ -0,0 +1,182 @@ +// +// $Id$ +// +/* -*- c++ -*- */ +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// component_svs.h +// +// = DESCRIPTION +// Concrete visitor for the Component node. +// This provides for code generation in the servant source +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +#ifndef _BE_COMPONENT_COMPONENT_SVS_H_ +#define _BE_COMPONENT_COMPONENT_SVS_H_ + +class be_visitor_component_svs : public be_visitor_component +{ + // + // = TITLE + // be_visitor_component_svs + // + // = DESCRIPTION + // This is a concrete visitor to generate the servant + // source for component. + // + // +public: + be_visitor_component_svs (be_visitor_context *ctx); + + ~be_visitor_component_svs (void); + + virtual int visit_component (be_component *node); + virtual int visit_operation (be_operation *node); + virtual int visit_attribute (be_attribute *node); + +private: + int gen_facets (void); + + void gen_context_class (void); + + int gen_servant_class (void); + + int gen_component_attrs_r (AST_Component *node); + + int gen_component_attrs (AST_Component *node); + + void gen_provides_top (void); + + void gen_facet_executor_block (const char *port_name); + + void gen_provides_r (AST_Component *node); + + void gen_provides (AST_Type *obj, + const char *port_name); + + void gen_uses_context_r (AST_Component *node); + + void gen_uses_context (AST_Type *obj, + const char *port_name, + bool is_multiple); + + void gen_uses_context_simplex (AST_Type *obj, + const char *port_name); + + void gen_uses_context_multiplex (AST_Type *obj, + const char *port_name); + + void gen_uses_servant_top (void); + + void gen_connect_block (const char *obj_name, + const char *port_name, + bool is_multiple); + + void gen_disconnect_block (const char *port_name, + bool is_multiple); + + void gen_uses_servant_r (AST_Component *node); + + void gen_uses_servant (const char *obj_name, + const char *port_name, + bool is_multiple); + + void gen_receptacle_description (AST_Type *obj, + const char *port_name, + bool is_multiple, + ACE_CDR::ULong slot); + + void gen_publishes_context_r (AST_Component *node); + + void gen_publishes_context (AST_Type *obj, + const char *port_name); + + void gen_publishes_servant_top (void); + + void gen_subscribe_block (const char *obj_name, + const char *port_name); + + void gen_unsubscribe_block (const char *port_name); + + void gen_event_source_description (AST_Type *obj, + const char *port_name, + ACE_CDR::ULong slot); + + void gen_publishes_servant_r (AST_Component *node); + + void gen_publishes_servant (const char *obj_name, + const char *port_name); + + void gen_consumes_r (AST_Component *node); + + void gen_consumes (AST_Type *obj, + const char *port_name); + + void gen_emits_context_r (AST_Component *node); + + void gen_emits_context (AST_Type *obj, + const char *port_name); + + void gen_emits_servant_top (void); + + void gen_connect_consumer_block (const char *obj_name, + const char *port_name); + + void gen_disconnect_consumer_block (const char *port_name); + + void gen_emitter_description (AST_Type *obj, + const char *port_name, + ACE_CDR::ULong slot); + + void gen_emits_servant_r (AST_Component *node); + + void gen_emits_servant (const char *obj_name, + const char *port_name); + + void gen_attr_set_r (AST_Component *node); + + void gen_populate_r (AST_Component *node); + + void gen_entrypoint (void); + + void gen_all_factory_registration (void); + void gen_one_factory_registration (AST_Type *t); + + void gen_swapping_get_consumers_r (AST_Component *node); + void gen_swapping_get_comsumer_block (const char *port_name); + +private: + be_component *node_; + be_interface *op_scope_; + TAO_OutStream &os_; + ACE_CString export_macro_; + static bool in_facets_; + bool swapping_; +}; + +/// Worker class passed to traverse_inheritance_graph(), +/// collects supported operations and attributes. +class Component_Op_Attr_Generator + : public TAO_IDL_Inheritance_Hierarchy_Worker +{ +public: + Component_Op_Attr_Generator (be_visitor_scope * visitor); + + virtual int emit (be_interface * derived_interface, + TAO_OutStream * os, + be_interface * base_interface); + +private: + be_visitor_scope * visitor_; +}; + +#endif /* _BE_COMPONENT_COMPONENT_SVS_H_ */ + diff --git a/TAO/TAO_IDL/be_include/be_visitor_home.h b/TAO/TAO_IDL/be_include/be_visitor_home.h index f8fa355bcdd..9c4d117bdf2 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_home.h +++ b/TAO/TAO_IDL/be_include/be_visitor_home.h @@ -6,7 +6,7 @@ // ============================================================================ // // = LIBRARY -// TAO IDL +// TAO_IDL_BE // // = FILENAME // be_visitor_home.h @@ -22,10 +22,19 @@ #ifndef TAO_BE_VISITOR_HOME_H #define TAO_BE_VISITOR_HOME_H -#include "be_visitor_decl.h" +#include "ast_argument.h" + +#include "be_visitor_scope.h" #include "be_visitor_typecode/typecode_decl.h" +#include "be_visitor_operation/operation.h" +#include "be_visitor_operation/arglist.h" #include "be_visitor_home/home_ch.h" #include "be_visitor_home/home_cs.h" +#include "be_visitor_home/home_svh.h" +#include "be_visitor_home/home_svs.h" +#include "be_visitor_home/home_ex_idl.h" +#include "be_visitor_home/home_exh.h" +#include "be_visitor_home/home_exs.h" #endif diff --git a/TAO/TAO_IDL/be_include/be_visitor_home/home_ex_idl.h b/TAO/TAO_IDL/be_include/be_visitor_home/home_ex_idl.h new file mode 100644 index 00000000000..d47d19c42c8 --- /dev/null +++ b/TAO/TAO_IDL/be_include/be_visitor_home/home_ex_idl.h @@ -0,0 +1,85 @@ +// +// $Id$ +// +/* -*- c++ -*- */ +// ============================================================================ +// +// = LIBRARY +// TAO_IDL_BE +// +// = FILENAME +// home_ex_idl.h +// +// = DESCRIPTION +// Concrete visitor for the Home node. +// Provides code generation for homes in the CIAO executor IDL +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +#ifndef _BE_HOME_HOME_EX_IDL_H_ +#define _BE_HOME_HOME_EX_IDL_H_ + +class be_visitor_home_ex_idl : public be_visitor_scope +{ + // + // = TITLE + // be_visitor_home_ex_idl + // + // = DESCRIPTION + // This is a concrete visitor to generate the + // CIAO executor IDL for home. + // + // +public: + be_visitor_home_ex_idl (be_visitor_context *ctx); + + ~be_visitor_home_ex_idl (void); + + virtual int visit_home (be_home *node); + + /// To regenerate attribute & operation declarations. + virtual int visit_attribute (be_attribute *node); + virtual int visit_operation (be_operation *node); + virtual int visit_argument (be_argument *node); + + /// To regenerate the name of an anonymous type. + /// Anonymous arrays are not allowed. + virtual int visit_sequence (be_sequence *node); + virtual int visit_string (be_string *node); + +private: + void gen_nesting_open (AST_Decl *node); + void gen_nesting_close (AST_Decl *node); + + void gen_implicit (void); + void gen_explicit (void); + void gen_derived (void); + + void gen_supported (void); + + void gen_exception_list (UTL_ExceptList *exceptions, + const char *prefix = "", + bool init_op = false); + + void gen_factories (void); + void gen_finders (void); + void gen_init_ops (AST_Home::INIT_LIST & list); + + void gen_home_executor (void); + + /// The CCM preproc visitor changed the scoped name and the + /// defined_in() for the home's members to the implied + /// *Explicit interface, which isn't a problem unless + /// they include exceptions raised by a contained operation. + /// factory or finder. So we restore the members just in case. + void restore_scope (void); + +private: + be_home *node_; + TAO_OutStream &os_; +}; + +#endif /* _BE_HOME_HOME_EX_IDL_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_home/home_exh.h b/TAO/TAO_IDL/be_include/be_visitor_home/home_exh.h new file mode 100644 index 00000000000..781d77779b7 --- /dev/null +++ b/TAO/TAO_IDL/be_include/be_visitor_home/home_exh.h @@ -0,0 +1,74 @@ +// +// $Id$ +// +/* -*- c++ -*- */ +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// home_exh.h +// +// = DESCRIPTION +// Concrete visitor for the Home node. +// This provides for code generation in the exec impl header +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +#ifndef _BE_HOME_HOME_EXH_H_ +#define _BE_HOME_HOME_EXH_H_ + +class be_visitor_home_exh : public be_visitor_scope +{ + // + // = TITLE + // be_visitor_home_exh + // + // = DESCRIPTION + // This is a concrete visitor to generate the + // exec impl header for home. + // + // +public: + be_visitor_home_exh (be_visitor_context *ctx); + + ~be_visitor_home_exh (void); + + virtual int visit_home (be_home *node); + virtual int visit_operation (be_operation *node); + virtual int visit_attribute (be_attribute *node); + +private: + int gen_exec_class (void); + + int gen_ops_attrs (void); + + int gen_factories (void); + int gen_factories_r (AST_Home *node); + + int gen_finders (void); + int gen_finders_r (AST_Home *node); + + int gen_init_ops_i (AST_Home::INIT_LIST & list); + + void gen_entrypoint (void); + + /// Helper method passed to traverse_inheritance_graph(), + /// collects supported operations and attributes. + static int op_attr_decl_helper (be_interface *, + be_interface *, + TAO_OutStream *); + +private: + be_home *node_; + AST_Component *comp_; + TAO_OutStream &os_; + ACE_CString export_macro_; +}; + +#endif /* _BE_HOME_HOME_EXH_H_ */ + diff --git a/TAO/TAO_IDL/be_include/be_visitor_home/home_exs.h b/TAO/TAO_IDL/be_include/be_visitor_home/home_exs.h new file mode 100644 index 00000000000..7e97dd71af7 --- /dev/null +++ b/TAO/TAO_IDL/be_include/be_visitor_home/home_exs.h @@ -0,0 +1,86 @@ +// +// $Id$ +// +/* -*- c++ -*- */ +// ============================================================================ +// +// = LIBRARY +// TAO_IDL_BE +// +// = FILENAME +// home_exs.h +// +// = DESCRIPTION +// Concrete visitor for the Home node. +// This provides for code generation in the exec impl source +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +#ifndef _BE_HOME_HOME_EXS_H_ +#define _BE_HOME_HOME_EXS_H_ + +class be_visitor_home_exs : public be_visitor_scope +{ + // + // = TITLE + // be_visitor_home_exs + // + // = DESCRIPTION + // This is a concrete visitor to generate the + // exec impl source for home. + // + // +public: + be_visitor_home_exs (be_visitor_context *ctx); + + ~be_visitor_home_exs (void); + + virtual int visit_home (be_home *node); + virtual int visit_operation (be_operation *node); + virtual int visit_attribute (be_attribute *node); + +private: + int gen_exec_class (void); + + int gen_ops_attrs (void); + + int gen_factories (void); + int gen_factories_r (AST_Home *node); + + int gen_finders (void); + int gen_finders_r (AST_Home *node); + + int gen_init_ops_i (AST_Home::INIT_LIST & list); + + void gen_entrypoint (void); + +private: + be_home *node_; + AST_Component *comp_; + TAO_OutStream &os_; + const char *comment_border_; + const char *your_code_here_; + ACE_CString export_macro_; +}; + +/// Worker class passed to traverse_inheritance_graph(), +/// collects supported operations and attributes. +class Home_Exec_Op_Attr_Generator + : public TAO_IDL_Inheritance_Hierarchy_Worker +{ +public: + Home_Exec_Op_Attr_Generator (be_visitor_scope * visitor); + + virtual int emit (be_interface * derived_interface, + TAO_OutStream * os, + be_interface * base_interface); + +private: + be_visitor_scope * visitor_; +}; + +#endif /* _BE_HOME_HOME_EXS_H_ */ + diff --git a/TAO/TAO_IDL/be_include/be_visitor_home/home_svh.h b/TAO/TAO_IDL/be_include/be_visitor_home/home_svh.h new file mode 100644 index 00000000000..af922537a57 --- /dev/null +++ b/TAO/TAO_IDL/be_include/be_visitor_home/home_svh.h @@ -0,0 +1,73 @@ +// +// $Id$ +// +/* -*- c++ -*- */ +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// home_svh.h +// +// = DESCRIPTION +// Concrete visitor for the Home node. +// This provides for code generation in the servant header +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +#ifndef _BE_HOME_HOME_SVH_H_ +#define _BE_HOME_HOME_SVH_H_ + +class be_visitor_home_svh : public be_visitor_scope +{ + // + // = TITLE + // be_visitor_home_svh + // + // = DESCRIPTION + // This is a concrete visitor to generate the servant header for component. + // + // +public: + be_visitor_home_svh (be_visitor_context *ctx); + + ~be_visitor_home_svh (void); + + virtual int visit_home (be_home *node); + virtual int visit_operation (be_operation *node); + virtual int visit_attribute (be_attribute *node); + +private: + int gen_servant_class (void); + + int gen_ops_attrs (void); + + int gen_factories (void); + int gen_factories_r (AST_Home *node); + + int gen_finders (void); + int gen_finders_r (AST_Home *node); + + int gen_init_ops_i (AST_Home::INIT_LIST & list); + + void gen_entrypoint (void); + + /// Helper method passed to traverse_inheritance_graph(), + /// collects supported operations and attributes. + static int op_attr_decl_helper (be_interface *, + be_interface *, + TAO_OutStream *); + +private: + be_home *node_; + AST_Component *comp_; + TAO_OutStream &os_; + ACE_CString export_macro_; +}; + +#endif /* _BE_HOME_HOME_SVH_H_ */ + diff --git a/TAO/TAO_IDL/be_include/be_visitor_home/home_svs.h b/TAO/TAO_IDL/be_include/be_visitor_home/home_svs.h new file mode 100644 index 00000000000..c3fbcc394ea --- /dev/null +++ b/TAO/TAO_IDL/be_include/be_visitor_home/home_svs.h @@ -0,0 +1,92 @@ +// +// $Id$ +// +/* -*- c++ -*- */ +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// home_svs.h +// +// = DESCRIPTION +// Concrete visitor for the Home node. +// This provides for code generation in the servant source +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +#ifndef _BE_HOME_HOME_SVS_H_ +#define _BE_HOME_HOME_SVS_H_ + +class be_visitor_home_svs : public be_visitor_scope +{ + // + // = TITLE + // be_visitor_home_svs + // + // = DESCRIPTION + // This is a concrete visitor to generate the servant header for component. + // + // +public: + be_visitor_home_svs (be_visitor_context *ctx); + + ~be_visitor_home_svs (void); + + virtual int visit_home (be_home *node); + virtual int visit_operation (be_operation *node); + virtual int visit_attribute (be_attribute *node); + virtual int visit_argument (be_argument *node); + +private: + int gen_servant_class (void); + + int gen_ops_attrs (void); + + int gen_factories (void); + int gen_factories_r (AST_Home *node); + + int gen_finders (void); + int gen_finders_r (AST_Home *node); + + int gen_init_ops (AST_Home::INIT_LIST & list, + bool finder_list); + + void gen_entrypoint (void); + + /// Helper method passed to traverse_inheritance_graph(), + /// collects supported operations and attributes. + static int op_attr_defn_helper (be_interface *, + be_interface *, + TAO_OutStream *); + +private: + be_home *node_; + AST_Component *comp_; + TAO_OutStream &os_; + ACE_CString export_macro_; + bool swapping_; +}; + +/// Worker class passed to traverse_inheritance_graph(), +/// collects supported operations and attributes. +class Home_Op_Attr_Generator + : public TAO_IDL_Inheritance_Hierarchy_Worker +{ +public: + Home_Op_Attr_Generator (be_visitor_scope * visitor); + + virtual int emit (be_interface * derived_interface, + TAO_OutStream * os, + be_interface * base_interface); + +private: + be_visitor_scope * visitor_; +}; + +#endif /* _BE_HOME_HOME_SVS_H_ */ + diff --git a/TAO/TAO_IDL/be_include/be_visitor_interface.h b/TAO/TAO_IDL/be_include/be_visitor_interface.h index 926331cabf7..c56e2b24594 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_interface.h +++ b/TAO/TAO_IDL/be_include/be_visitor_interface.h @@ -34,6 +34,9 @@ #include "be_visitor_interface/interface_si.h" #include "be_visitor_interface/interface_ss.h" #include "be_visitor_interface/interface_is.h" +#include "be_visitor_interface/interface_ex_idl.h" +#include "be_visitor_interface/interface_svh.h" +#include "be_visitor_interface/interface_svs.h" #include "be_visitor_interface/any_op_ch.h" #include "be_visitor_interface/any_op_cs.h" #include "be_visitor_interface/cdr_op_ch.h" diff --git a/TAO/TAO_IDL/be_include/be_visitor_interface/interface_ex_idl.h b/TAO/TAO_IDL/be_include/be_visitor_interface/interface_ex_idl.h new file mode 100644 index 00000000000..faa8c3f1ef4 --- /dev/null +++ b/TAO/TAO_IDL/be_include/be_visitor_interface/interface_ex_idl.h @@ -0,0 +1,43 @@ +// $Id$ + +// ============================================================================ +// +// = LIBRARY +// TAO_IDL_BE +// +// = FILENAME +// interface_ex_idl.h +// +// = DESCRIPTION +// Concrete visitor for the Interface node. +// This provides for code generation in the CIAO +// executor IDL +// +// = AUTHOR +// Jeff Parsons <j.parsons@vanderbilt.edu> +// +// ============================================================================ + +#ifndef _BE_INTERFACE_INTERFACE_EX_IDL_H_ +#define _BE_INTERFACE_INTERFACE_EX_IDL_H_ + +class be_visitor_interface_ex_idl : public be_visitor_interface +{ + // + // = TITLE + // be_visitor_interface_ex_idl + // + // = DESCRIPTION + // This is a concrete visitor to generate the + // CIAO executor IDL for interface + // + // +public: + be_visitor_interface_ex_idl (be_visitor_context *ctx); + + ~be_visitor_interface_ex_idl (void); + + virtual int visit_interface (be_interface *node); +}; + +#endif /* _BE_INTERFACE_INTERFACE_EX_IDL_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_interface/interface_svh.h b/TAO/TAO_IDL/be_include/be_visitor_interface/interface_svh.h new file mode 100644 index 00000000000..7697f515ce5 --- /dev/null +++ b/TAO/TAO_IDL/be_include/be_visitor_interface/interface_svh.h @@ -0,0 +1,45 @@ +// $Id$ + +// ============================================================================ +// +// = LIBRARY +// TAO_IDL_BE +// +// = FILENAME +// interface_svh.h +// +// = DESCRIPTION +// Concrete visitor for the Interface node. +// This provides for code generation in the CIAO +// servant header +// +// = AUTHOR +// Jeff Parsons <j.parsons@vanderbilt.edu> +// +// ============================================================================ + +#ifndef _BE_INTERFACE_INTERFACE_SVH_H_ +#define _BE_INTERFACE_INTERFACE_SVH_H_ + +class be_visitor_interface_svh : public be_visitor_interface +{ + // + // = TITLE + // be_visitor_interface_svh + // + // = DESCRIPTION + // This is a concrete visitor to generate the + // CIAO servant header for interface + // + // +public: + be_visitor_interface_svh (be_visitor_context *ctx); + + ~be_visitor_interface_svh (void); + + virtual int visit_interface (be_interface *node); + virtual int visit_operation (be_operation *node); + virtual int visit_attribute (be_attribute *node); +}; + +#endif /* _BE_INTERFACE_INTERFACE_SVH_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_interface/interface_svs.h b/TAO/TAO_IDL/be_include/be_visitor_interface/interface_svs.h new file mode 100644 index 00000000000..933735e3624 --- /dev/null +++ b/TAO/TAO_IDL/be_include/be_visitor_interface/interface_svs.h @@ -0,0 +1,45 @@ +// $Id$ + +// ============================================================================ +// +// = LIBRARY +// TAO_IDL_BE +// +// = FILENAME +// interface_svs.h +// +// = DESCRIPTION +// Concrete visitor for the Interface node. +// This provides for code generation in the CIAO +// servant sourc e +// +// = AUTHOR +// Jeff Parsons <j.parsons@vanderbilt.edu> +// +// ============================================================================ + +#ifndef _BE_INTERFACE_INTERFACE_SVS_H_ +#define _BE_INTERFACE_INTERFACE_SVS_H_ + +class be_visitor_interface_svs : public be_visitor_interface +{ + // + // = TITLE + // be_visitor_interface_svs + // + // = DESCRIPTION + // This is a concrete visitor to generate the + // CIAO servant source for interface + // + // +public: + be_visitor_interface_svs (be_visitor_context *ctx); + + ~be_visitor_interface_svs (void); + + virtual int visit_interface (be_interface *node); + virtual int visit_operation (be_operation *node); + virtual int visit_attribute (be_attribute *node); +}; + +#endif /* _BE_INTERFACE_INTERFACE_SVS_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_null_return_value.h b/TAO/TAO_IDL/be_include/be_visitor_null_return_value.h new file mode 100644 index 00000000000..883582526ca --- /dev/null +++ b/TAO/TAO_IDL/be_include/be_visitor_null_return_value.h @@ -0,0 +1,64 @@ +// +// $Id$ +// +/* -*- c++ -*- */ +// ============================================================================ +// +// = LIBRARY +// TAO_IDL_BE +// +// = FILENAME +// be_visitor_null_return_value.h +// +// = DESCRIPTION +// Encapsulation of rules for generating null return values +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +#ifndef BE_VISITOR_NULL_RETURN_VALUE_H +#define BE_VISITOR_NULL_RETURN_VALUE_H + +#include "be_visitor_decl.h" + +class TAO_OutStream; + +class be_visitor_null_return_value : public be_visitor_decl +{ + // + // = TITLE + // be_visitor_null_return_value + // + // = DESCRIPTION + // Contains overloaded methods that generate null return + // values, compliant with the CORBA IDL C++ mapping, and + // portable to all platforms supported by ACE. + // + // +public: + be_visitor_null_return_value (be_visitor_context *ctx); + virtual ~be_visitor_null_return_value (void); + + virtual int visit_array (be_array *); + virtual int visit_component (be_component *); + virtual int visit_enum (be_enum *); + virtual int visit_eventtype (be_eventtype *); + virtual int visit_home (be_home *); + virtual int visit_interface (be_interface *); + virtual int visit_predefined_type (be_predefined_type *); + virtual int visit_sequence (be_sequence *); + virtual int visit_string (be_string *); + virtual int visit_structure (be_structure *); + virtual int visit_typedef (be_typedef *); + virtual int visit_union (be_union *); + virtual int visit_valuebox (be_valuebox *); + virtual int visit_valuetype (be_valuetype *); + +protected: + TAO_OutStream & os_; +}; + +#endif /* BE_VISITOR_NULL_RETURN_VALUE_H */ + diff --git a/TAO/TAO_IDL/be_include/be_visitor_operation.h b/TAO/TAO_IDL/be_include/be_visitor_operation.h index 3ac422ee3a1..4197c19e942 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_operation.h +++ b/TAO/TAO_IDL/be_include/be_visitor_operation.h @@ -24,6 +24,8 @@ #include "idl_defines.h" +#include "be_null_return_emitter.h" + #include "be_visitor_scope.h" #include "be_visitor_operation/operation.h" #include "be_visitor_operation/operation_ch.h" @@ -32,6 +34,8 @@ #include "be_visitor_operation/operation_ih.h" #include "be_visitor_operation/operation_ss.h" #include "be_visitor_operation/operation_is.h" +#include "be_visitor_operation/operation_svs.h" +#include "be_visitor_operation/operation_exs.h" #include "be_visitor_operation/tie_sh.h" #include "be_visitor_operation/tie_ss.h" #include "be_visitor_operation/arglist.h" diff --git a/TAO/TAO_IDL/be_include/be_visitor_operation/arglist.h b/TAO/TAO_IDL/be_include/be_visitor_operation/arglist.h index a37510cca05..ee03504ded5 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_operation/arglist.h +++ b/TAO/TAO_IDL/be_include/be_visitor_operation/arglist.h @@ -50,7 +50,13 @@ public: // visit each argument virtual int post_process (be_decl *); - // stuff to o/p after each element of the scope is handled + // stuff to o/p after each element of the scope is handled. + + void unused (bool val); + // Set the member. + +private: + bool unused_; }; #endif /* _BE_VISITOR_OPERATION_ARGLIST_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_operation/operation_exs.h b/TAO/TAO_IDL/be_include/be_visitor_operation/operation_exs.h new file mode 100644 index 00000000000..0e85352fffa --- /dev/null +++ b/TAO/TAO_IDL/be_include/be_visitor_operation/operation_exs.h @@ -0,0 +1,61 @@ +// +// $Id$ +// + +// ============================================================================ +// +// = LIBRARY +// TAO_IDL_BE +// +// = FILENAME +// operation_exs.h +// +// = DESCRIPTION +// Visitor for generating code for IDL operations in +// CIAO executor implementations +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +#ifndef _BE_VISITOR_OPERATION_OPERATION_EXS_H_ +#define _BE_VISITOR_OPERATION_OPERATION_EXS_H_ + +// ************************************************************ +// Operation visitor for CIAO executor implementations +// ************************************************************ + +class be_visitor_operation_exs : public be_visitor_scope +{ + // + // = TITLE + // be_visitor_operation_exs + // + // = DESCRIPTION + // This is a concrete visitor to generate the CIAO executor + // implementations for operation + // + // +public: + be_visitor_operation_exs (be_visitor_context *ctx); + + ~be_visitor_operation_exs (void); + + virtual int visit_operation (be_operation *node); + virtual int visit_argument (be_argument *node); + + virtual int post_process (be_decl *bd); + + void scope (be_interface *node); + +private: + int gen_op_body (be_type *return_type); + +private: + TAO_OutStream &os_; + be_interface *scope_; + const char *your_code_here_; +}; + +#endif /* _BE_VISITOR_OPERATION_OPERATION_EXS_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_operation/operation_svs.h b/TAO/TAO_IDL/be_include/be_visitor_operation/operation_svs.h new file mode 100644 index 00000000000..7a75ecf2b39 --- /dev/null +++ b/TAO/TAO_IDL/be_include/be_visitor_operation/operation_svs.h @@ -0,0 +1,62 @@ +// +// $Id$ +// + +// ============================================================================ +// +// = LIBRARY +// TAO_IDL_BE +// +// = FILENAME +// operation_svs.h +// +// = DESCRIPTION +// Visitor for generating code for IDL operations in +// CIAO servant implementations +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +#ifndef _BE_VISITOR_OPERATION_OPERATION_SVS_H_ +#define _BE_VISITOR_OPERATION_OPERATION_SVS_H_ + +// ************************************************************ +// Operation visitor for CIAO servant implementations +// ************************************************************ + +class be_visitor_operation_svs : public be_visitor_scope +{ + // + // = TITLE + // be_visitor_operation_svs + // + // = DESCRIPTION + // This is a concrete visitor to generate the CIAO servant + // implementations for operation + // + // +public: + be_visitor_operation_svs (be_visitor_context *ctx); + + ~be_visitor_operation_svs (void); + + virtual int visit_operation (be_operation *node); + virtual int visit_argument (be_argument *node); + + virtual int post_process (be_decl *bd); + + void for_facets (bool val); + void scope (be_interface *node); + +private: + int gen_op_body (be_operation *node); + +private: + be_interface *scope_; + bool for_facets_; + bool swapping_; +}; + +#endif /* _BE_VISITOR_OPERATION_OPERATION_SVS_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_operation/rettype.h b/TAO/TAO_IDL/be_include/be_visitor_operation/rettype.h index 056b90f6498..b842a0b9dbd 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_operation/rettype.h +++ b/TAO/TAO_IDL/be_include/be_visitor_operation/rettype.h @@ -99,6 +99,12 @@ public: int visit_valuebox (be_valuebox *node); // visit a valuebox node + +private: + const char *type_name (be_type *node); + +private: + TAO_OutStream *os; }; #endif /* _BE_VISITOR_OPERATION_RETTYPE_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_root.h b/TAO/TAO_IDL/be_include/be_visitor_root.h index 3ab0e4f4448..f43ac2ccb9a 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_root.h +++ b/TAO/TAO_IDL/be_include/be_visitor_root.h @@ -33,6 +33,11 @@ #include "be_visitor_root/root_sth.h" #include "be_visitor_root/root_is.h" #include "be_visitor_root/root_ih.h" +#include "be_visitor_root/root_svh.h" +#include "be_visitor_root/root_svs.h" +#include "be_visitor_root/root_ex_idl.h" +#include "be_visitor_root/root_exh.h" +#include "be_visitor_root/root_exs.h" #include "be_visitor_root/any_op.h" #include "be_visitor_root/cdr_op.h" #include "be_visitor_root/serializer_op.h" diff --git a/TAO/TAO_IDL/be_include/be_visitor_root/root_ex_idl.h b/TAO/TAO_IDL/be_include/be_visitor_root/root_ex_idl.h new file mode 100644 index 00000000000..2911e462353 --- /dev/null +++ b/TAO/TAO_IDL/be_include/be_visitor_root/root_ex_idl.h @@ -0,0 +1,47 @@ +/* -*- c++ -*- */ +// +// $Id$ +// + +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// root_ex_idl.h +// +// = DESCRIPTION +// Concrete visitor for the Root class +// This one provides code generation for elements of the Root node in the +// CIAO executor IDL. +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +#ifndef _BE_VISITOR_ROOT_ROOT_EX_IDL_H_ +#define _BE_VISITOR_ROOT_ROOT_EX_IDL_H_ + +class be_visitor_root_ex_idl : public be_visitor_root +{ + // + // = TITLE + // be_visitor_root_ex_idl + // + // = DESCRIPTION + // This is a concrete visitor to generate the CIAO executor + // IDL for root + // + // +public: + be_visitor_root_ex_idl (be_visitor_context *ctx); + + ~be_visitor_root_ex_idl (void); + + virtual int init (void); + // Set the right context and make a visitor. +}; + +#endif /* _BE_VISITOR_ROOT_ROOT_EX_IDL_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_root/root_exh.h b/TAO/TAO_IDL/be_include/be_visitor_root/root_exh.h new file mode 100644 index 00000000000..21a4e5f5ee9 --- /dev/null +++ b/TAO/TAO_IDL/be_include/be_visitor_root/root_exh.h @@ -0,0 +1,47 @@ +/* -*- c++ -*- */ +// +// $Id$ +// + +// ============================================================================ +// +// = LIBRARY +// TAO_IDL_BE +// +// = FILENAME +// root_exh.h +// +// = DESCRIPTION +// Concrete visitor for the Root class +// This one provides code generation for elements of the Root node in the +// CIAO exec impl header. +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +#ifndef _BE_VISITOR_ROOT_ROOT_EXH_H_ +#define _BE_VISITOR_ROOT_ROOT_EXH_H_ + +class be_visitor_root_exh : public be_visitor_root +{ + // + // = TITLE + // be_visitor_root_exh + // + // = DESCRIPTION + // This is a concrete visitor to generate the CIAO servant + // header for root + // + // +public: + be_visitor_root_exh (be_visitor_context *ctx); + + ~be_visitor_root_exh (void); + + virtual int init (void); + // Set the right context and make a visitor. +}; + +#endif /* _BE_VISITOR_ROOT_ROOT_EXH_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_root/root_exs.h b/TAO/TAO_IDL/be_include/be_visitor_root/root_exs.h new file mode 100644 index 00000000000..cd4ccb444a2 --- /dev/null +++ b/TAO/TAO_IDL/be_include/be_visitor_root/root_exs.h @@ -0,0 +1,47 @@ +/* -*- c++ -*- */ +// +// $Id$ +// + +// ============================================================================ +// +// = LIBRARY +// TAO_IDL_BE +// +// = FILENAME +// root_exs.h +// +// = DESCRIPTION +// Concrete visitor for the Root class +// This one provides code generation for elements of the Root node in the +// CIAO exec impl source. +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +#ifndef _BE_VISITOR_ROOT_ROOT_EXS_H_ +#define _BE_VISITOR_ROOT_ROOT_EXS_H_ + +class be_visitor_root_exs : public be_visitor_root +{ + // + // = TITLE + // be_visitor_root_exs + // + // = DESCRIPTION + // This is a concrete visitor to generate the CIAO servant + // header for root + // + // +public: + be_visitor_root_exs (be_visitor_context *ctx); + + ~be_visitor_root_exs (void); + + virtual int init (void); + // Set the right context and make a visitor. +}; + +#endif /* _BE_VISITOR_ROOT_ROOT_EXS_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_root/root_svh.h b/TAO/TAO_IDL/be_include/be_visitor_root/root_svh.h new file mode 100644 index 00000000000..e79d387b685 --- /dev/null +++ b/TAO/TAO_IDL/be_include/be_visitor_root/root_svh.h @@ -0,0 +1,47 @@ +/* -*- c++ -*- */ +// +// $Id$ +// + +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// root_svh.h +// +// = DESCRIPTION +// Concrete visitor for the Root class +// This one provides code generation for elements of the Root node in the +// CIAO servant header. +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +#ifndef _BE_VISITOR_ROOT_ROOT_SVH_H_ +#define _BE_VISITOR_ROOT_ROOT_SVH_H_ + +class be_visitor_root_svh : public be_visitor_root +{ + // + // = TITLE + // be_visitor_root_svh + // + // = DESCRIPTION + // This is a concrete visitor to generate the CIAO servant + // header for root + // + // +public: + be_visitor_root_svh (be_visitor_context *ctx); + + ~be_visitor_root_svh (void); + + virtual int init (void); + // Set the right context and make a visitor. +}; + +#endif /* _BE_VISITOR_ROOT_ROOT_SVH_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_root/root_svs.h b/TAO/TAO_IDL/be_include/be_visitor_root/root_svs.h new file mode 100644 index 00000000000..1272ac79696 --- /dev/null +++ b/TAO/TAO_IDL/be_include/be_visitor_root/root_svs.h @@ -0,0 +1,47 @@ +/* -*- c++ -*- */ +// +// $Id$ +// + +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// root_svs.h +// +// = DESCRIPTION +// Concrete visitor for the Root class +// This one provides code generation for elements of the Root node in the +// CIAO servant source. +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +#ifndef _BE_VISITOR_ROOT_ROOT_SVS_H_ +#define _BE_VISITOR_ROOT_ROOT_SVS_H_ + +class be_visitor_root_svs : public be_visitor_root +{ + // + // = TITLE + // be_visitor_root_svs + // + // = DESCRIPTION + // This is a concrete visitor to generate the CIAO servant + // source for root + // + // +public: + be_visitor_root_svs (be_visitor_context *ctx); + + ~be_visitor_root_svs (void); + + virtual int init (void); + // Set the right context and make a visitor. +}; + +#endif /* _BE_VISITOR_ROOT_ROOT_SVS_H_ */ |