00001
00002
00003
00004
00005
00006
00007
00008 #ifndef OPENDDS_IDL_BE_GLOBAL_H
00009 #define OPENDDS_IDL_BE_GLOBAL_H
00010
00011 #include "ace/SString.h"
00012
00013 #include <string>
00014 #include <sstream>
00015 #include <set>
00016
00017 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00018 # pragma once
00019 #endif
00020
00021 class AST_Generator;
00022
00023
00024
00025 class BE_GlobalData {
00026 public:
00027
00028
00029
00030
00031
00032
00033 BE_GlobalData();
00034
00035
00036 virtual ~BE_GlobalData();
00037
00038
00039
00040
00041 const char* holding_scope_name() const;
00042
00043 void destroy();
00044
00045
00046 const char* filename() const;
00047 void filename(const char* fname);
00048
00049
00050
00051 ACE_CString spawn_options();
00052
00053
00054
00055 void parse_args(long& i, char** av);
00056
00057
00058 void open_streams(const char* filename);
00059
00060 std::ostringstream header_, impl_, idl_, ws_config_, itl_, facets_header_, facets_impl_,
00061 lang_header_;
00062 ACE_CString header_name_, impl_name_, idl_name_, ws_config_name_, itl_name_,
00063 facets_header_name_, facets_impl_name_, lang_header_name_,
00064 output_dir_, tao_inc_pre_;
00065
00066
00067 void multicast(const char* message);
00068
00069 enum stream_enum_t {
00070 STREAM_H, STREAM_CPP, STREAM_IDL, STREAM_WS, STREAM_ITL,
00071 STREAM_FACETS_H, STREAM_FACETS_CPP,
00072 STREAM_LANG_H
00073 };
00074
00075 void reset_includes();
00076
00077 void add_include(const char* file, stream_enum_t which = STREAM_H);
00078
00079
00080
00081
00082
00083
00084 void add_referenced(const char* file);
00085
00086 void set_inc_paths(const char* cmdline);
00087 void add_inc_path(const char* path);
00088
00089 std::string get_include_block(stream_enum_t which);
00090
00091 ACE_CString export_macro() const;
00092 void export_macro(const ACE_CString& str);
00093
00094 ACE_CString export_include() const;
00095 void export_include(const ACE_CString& str);
00096
00097 ACE_CString pch_include() const;
00098 void pch_include(const ACE_CString& str);
00099
00100 bool java() const;
00101 void java(bool b);
00102
00103 bool v8() const;
00104 void v8(bool b);
00105
00106 bool face_ts() const;
00107 void face_ts(bool b);
00108
00109 ACE_CString java_arg() const;
00110 void java_arg(const ACE_CString& str);
00111
00112 enum LanguageMapping {
00113 LANGMAP_NONE,
00114 LANGMAP_FACE_CXX,
00115 LANGMAP_SP_CXX
00116 };
00117
00118 LanguageMapping language_mapping() const;
00119 void language_mapping(LanguageMapping lm);
00120
00121 ACE_CString sequence_suffix() const;
00122 void sequence_suffix(const ACE_CString& str);
00123
00124 bool suppress_idl() const { return suppress_idl_; }
00125 bool suppress_typecode() const { return suppress_typecode_; }
00126
00127 bool generate_wireshark() const { return generate_wireshark_; }
00128 bool generate_itl() const { return generate_itl_; }
00129
00130 static bool writeFile(const char* fileName, const std::string &content);
00131
00132 private:
00133 const char* filename_;
00134
00135
00136 bool java_, suppress_idl_, suppress_typecode_,
00137 generate_wireshark_, generate_itl_, v8_, face_ts_;
00138
00139 ACE_CString export_macro_, export_include_, pch_include_, java_arg_, seq_;
00140
00141 LanguageMapping language_mapping_;
00142 };
00143
00144 class BE_Comment_Guard {
00145 public:
00146
00147 BE_Comment_Guard(const char* type, const char* name);
00148 ~BE_Comment_Guard();
00149
00150 private:
00151 const char *type_, *name_;
00152 };
00153
00154 #endif