00001
00009 #ifndef KEYWORD_MANAGER_H_
00010 #define KEYWORD_MANAGER_H_
00011
00012 #include BS_FORCE_PLUGIN_IMPORT ()
00013
00014 #include "main_def.h"
00015 #include "read_class.h"
00016 #include BS_STOP_PLUGIN_IMPORT ()
00017
00018 #include "keyword_manager_iface.h"
00019 #include "date_sim.h"
00020
00021 namespace blue_sky
00022 {
00023
00024 template <class strategy_t>
00025 class BS_API_PLUGIN keyword_info_base;
00026
00031 template <class strategy_t>
00032 class BS_API_PLUGIN keyword_manager: public keyword_manager_iface <strategy_t>
00033 {
00034 public:
00035
00036
00037
00038 typedef typename strategy_t::index_t index_t;
00039 typedef typename strategy_t::item_t item_t;
00040 typedef typename strategy_t::index_array_t index_array_t;
00041 typedef typename strategy_t::item_array_t item_array_t;
00042 typedef strategy_t strategy_type;
00043
00044 typedef keyword_manager <strategy_t> this_t;
00045 typedef keyword_manager_iface <strategy_t> base_t;
00046
00047 typedef idata idata_t;
00048 typedef rs_mesh_iface <strategy_t> mesh_iface_t;
00049 typedef rs_smesh_iface <strategy_t> smesh_iface_t;
00050 typedef keyword_info_base <strategy_t> keyword_info_base_t;
00051 typedef keyword_params <strategy_t> keyword_params_t;
00052
00053 typedef smart_ptr <this_t, true> sp_this_t;
00054 typedef smart_ptr <FRead, true> sp_reader_t;
00055 typedef smart_ptr <idata_t, true> sp_idata_t;
00056 typedef smart_ptr <mesh_iface_t, true > sp_mesh_iface_t;
00057 typedef smart_ptr <smesh_iface_t, true > sp_smesh_iface_t;
00058 typedef smart_ptr <keyword_info_base_t, true> sp_keyword_info_base_t;
00059 typedef smart_ptr <objbase, true> sp_objbase;
00060
00061
00062 typedef typename base_t::handler_t handler_t;
00063 typedef typename base_t::keyword_handler keyword_handler;
00064 typedef typename base_t::shared_handler_t shared_handler_t;
00065
00066
00067
00069 typedef std::map <std::string, keyword_handler> handlers_t;
00070 typedef std::map <std::string, std::list<std::string> > supported_keywords_t;
00071
00072
00073 public:
00074
00075
00076
00077 handlers_t handlers;
00078 supported_keywords_t supported_keywords;
00079
00080 boost::posix_time::ptime current_date;
00081 boost::posix_time::ptime starting_date;
00082
00083
00084
00085
00086 public:
00088 BLUE_SKY_TYPE_DECL_T(keyword_manager);
00089
00093 ~keyword_manager ();
00094
00095
00096 public:
00100 void
00101 init()
00102 {
00103 this->register_keywords();
00104 this->register_plugin_keywords();
00105 }
00106
00111 void
00112 handle_keyword (const std::string &keyword, keyword_params_t ¶ms);
00113
00119 void
00120 register_keyword (const std::string &keyword, keyword_handler handler);
00121
00128 void
00129 register_keyword (const std::string &keyword, const shared_handler_t &handler);
00130
00136 void
00137 register_supported_keyword(const std::string &keyword, const std::string &provider);
00138
00142 void
00143 register_keywords();
00144
00148 void
00149 register_plugin_keywords();
00150
00155 boost::posix_time::ptime
00156 get_starting_date () {return starting_date;}
00157
00164 bool
00165 is_keyword_supported (const std::string &keyword, keyword_params_t ¶ms) const;
00166
00173 bool
00174 is_keyword_activated (const std::string &keyword, keyword_params_t ¶ms) const;
00175
00176 private:
00179 static void int_array_handler (const std::string &keyword, keyword_params_t ¶ms);
00180 static void float_array_handler (const std::string &keyword, keyword_params_t ¶ms);
00182 static void event_handler (const std::string &keyword, keyword_params_t ¶ms);
00184 static void TITLE_handler (const std::string &keyword, keyword_params_t ¶ms);
00185 static void OIL_handler (const std::string &keyword, keyword_params_t ¶ms);
00186 static void WATER_handler (const std::string &keyword, keyword_params_t ¶ms);
00187 static void GAS_handler (const std::string &keyword, keyword_params_t ¶ms);
00188 static void PROCESS_PARAMS_handler (const std::string &keyword, keyword_params_t ¶ms);
00189 static void RESTART_handler (const std::string &, keyword_params_t &)
00190 {
00191 BOSOUT << "RESTART: NOT_IMPL_YET" << bs_end;
00192 }
00193 static void REPORTS_handler (const std::string &keyword, keyword_params_t ¶ms);
00194 static void REPORTFILE_handler (const std::string &keyword, keyword_params_t ¶ms);
00195 static void REPORTSCREEN_handler (const std::string &keyword, keyword_params_t ¶ms);
00196 static void ARITHMETIC_handler (const std::string &keyword, keyword_params_t ¶ms);
00197 static void STONE1_handler (const std::string &keyword, keyword_params_t ¶ms);
00198 static void STONE2_handler (const std::string &keyword, keyword_params_t ¶ms);
00199 static void RELATIVE_PERM_DEFAULT_handler (const std::string &keyword, keyword_params_t ¶ms);
00200 static void UNITS_handler (const std::string &keyword, keyword_params_t ¶ms);
00201 static void DIMENS_handler (const std::string &keyword, keyword_params_t ¶ms);
00202 static void ROCKCOMP_handler (const std::string &keyword, keyword_params_t ¶ms);
00203 static void REGDIMS_handler (const std::string &keyword, keyword_params_t ¶ms);
00204 static void REGNUM_handler (const std::string &keyword, keyword_params_t ¶ms);
00205 static void EQLDIMS_handler (const std::string &keyword, keyword_params_t ¶ms);
00206 static void TABDIMS_handler (const std::string &keyword, keyword_params_t ¶ms);
00207 static void COORD_handler (const std::string &keyword, keyword_params_t ¶ms);
00208 static void ZCORN_handler (const std::string &keyword, keyword_params_t ¶ms);
00209 static void MINPV_handler (const std::string &keyword, keyword_params_t ¶ms);
00210 static void MINSV_handler (const std::string &keyword, keyword_params_t ¶ms);
00211 static void DENSITY_handler (const std::string &keyword, keyword_params_t ¶ms);
00212 static void ROCKTAB_handler (const std::string &keyword, keyword_params_t ¶ms);
00213 static void PVTO_handler (const std::string &keyword, keyword_params_t ¶ms);
00214 static void PVDO_handler (const std::string &keyword, keyword_params_t ¶ms);
00215 static void PVTW_handler (const std::string &keyword, keyword_params_t ¶ms);
00216 static void PVDG_handler (const std::string &keyword, keyword_params_t ¶ms);
00217 static void ROCK_handler (const std::string &keyword, keyword_params_t ¶ms);
00218 static void SWOF_handler (const std::string &keyword, keyword_params_t ¶ms);
00219 static void SGOF_handler (const std::string &keyword, keyword_params_t ¶ms);
00220 static void SWFN_handler (const std::string &keyword, keyword_params_t ¶ms);
00221 static void SGFN_handler (const std::string &keyword, keyword_params_t ¶ms);
00222 static void SOF3_handler (const std::string &keyword, keyword_params_t ¶ms);
00223 static void SOF2_handler (const std::string &keyword, keyword_params_t ¶ms);
00224 static void EQUIL_handler (const std::string &keyword, keyword_params_t ¶ms);
00225 static void PRVD_handler (const std::string &keyword, keyword_params_t ¶ms);
00226 static void RSVD_handler (const std::string &keyword, keyword_params_t ¶ms);
00227 static void PBVD_handler (const std::string &keyword, keyword_params_t ¶ms);
00228 static void START_handler (const std::string &keyword, keyword_params_t ¶ms);
00229 static void DATE_handler (const std::string &keyword, keyword_params_t ¶ms);
00230 static void DATES_handler (const std::string &keyword, keyword_params_t ¶ms);
00231 static void TSTEP_handler (const std::string &keyword, keyword_params_t ¶ms);
00232 static void TSTEPS_handler (const std::string &keyword, keyword_params_t ¶ms);
00233 static void WELLDIMS_handler (const std::string &, keyword_params_t &)
00234 {
00235 BOSOUT << "WELLDIMS: NOT_IMPL_YET" << bs_end;
00236 }
00237 };
00238
00239 }
00240
00241 #endif //KEYWORD_MANAGER_H_
00242