00001
00009 #ifndef EVENT_BASE_H_
00010 #define EVENT_BASE_H_
00011
00012
00013 #include "well_results_storage.h"
00014 #include "fip_results_storage.h"
00015 #include "data_storage_interface.h"
00016
00017 namespace blue_sky
00018 {
00019
00020 template <typename strategy_t>
00021 class reservoir;
00022
00023 template <typename strategy_t>
00024 class calc_model;
00025
00030 template <typename strategy_t>
00031 class BS_API_PLUGIN event_base : public objbase
00032 {
00033
00034
00035
00036 public:
00037
00038 typedef reservoir <strategy_t> reservoir_t;
00039 typedef rs_mesh_iface <strategy_t> mesh_iface_t;
00040 typedef calc_model <strategy_t> calc_model_t;
00041
00042 typedef smart_ptr <mesh_iface_t , true> sp_mesh_iface_t;
00043 typedef smart_ptr <reservoir_t, true> sp_top;
00044 typedef smart_ptr <calc_model_t, true> sp_calc_model_t;
00045 typedef smart_ptr <named_pbase, true> sp_named_pbase;
00046
00047 typedef event_base <strategy_t> self_t;
00048 typedef self_t this_t;
00049
00050 typedef named_pbase::ndt_t ndt_t;
00051 typedef named_pbase::named_pbase_idxs named_pbase_idxs;
00052
00053
00054 public:
00055
00056
00057
00058
00059 public:
00061 BLUE_SKY_TYPE_DECL(event_base);
00062
00063 public:
00065 virtual ~event_base ();
00066
00074 virtual void
00075 apply (const sp_top &top, const sp_mesh_iface_t &mesh,
00076 const sp_calc_model_t &calc_model) const;
00077
00083 void
00084 init (const std::string &event_name, const std::string ¶ms);
00085
00091 void
00092 add_next_line (const std::string &event_name, const std::string ¶ms);
00093
00098 virtual bool
00099 is_multi_line () const
00100 {
00101 return false;
00102 }
00103
00104 protected:
00105
00106
00107
00112 virtual sp_named_pbase
00113 main_params () const
00114 {
00115 return 0;
00116 }
00117
00122 virtual sp_named_pbase
00123 add_next_line_params ()
00124 {
00125 bs_throw_exception ("PURE CALL");
00126 }
00127
00133 void
00134 parse (const std::string ¶ms_str, const sp_named_pbase ¶ms);
00135
00141 void
00142 save_def (const sp_named_pbase ¶ms, const char c = '_');
00143
00150 void
00151 clear_num (const sp_named_pbase ¶ms, const char *begin = 0, const char *end = 0);
00152
00154
00160 void
00161 save_value (const sp_named_pbase ¶ms, char const* first, char const* last);
00162
00163
00164
00165
00166 private:
00167 #ifdef _DEBUG
00168
00172 struct debug_data
00173 {
00174 std::string params;
00175 std::list <std::string> next_line_params;
00176 };
00177
00178 debug_data debug_data_;
00179 #endif
00180
00181 int num;
00182 int index;
00183 bool no_error_;
00184 };
00185
00191 bool
00192 event_base_register_types (const plugin_descriptor &pd);
00193
00194 }
00195
00196 #endif//EVENT_BASE_H_
00197