00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00028 #ifndef __CONTROL_DATA_HPP__
00029 #define __CONTROL_DATA_HPP__
00030 #include <api_exception.h>
00031
00032 namespace coco {
00033
00034 inline void control_data::service(const std::string& __s) { _service = __s; }
00035
00036 inline void control_data::service(const char* __s)
00037 {
00038 service(std::string(__s));
00039 }
00040
00041 inline const std::string& control_data::service() const throw(api_exception)
00042 {
00043 if(_service == std::string())
00044 {
00045 throw api_exception(apiee_communication_data, "no service defined!");
00046 }
00047 return _service;
00048 }
00049
00050 inline bool control_data::check_service(const std::string& __n) const
00051 {
00052 return _service == __n;
00053 }
00054
00055 inline bool control_data::check_service(const char* __n) const
00056 {
00057 return check_service(std::string(__n));
00058 }
00059
00060 inline void control_data::list(std::vector<std::string>& v) const
00061 {
00062 datamap::list(v);
00063 }
00064
00065 template <class _TS>
00066 inline void control_data::assign(const std::string& __s,
00067 const std::vector<_TS>*& __b) const
00068 throw(api_exception)
00069 {
00070 if(!retrieve(__s, __b))
00071 {
00072 throw api_exception(apiee_communication_data,
00073 std::string("required control data entry '")+__s+
00074 "' is missing");
00075 }
00076 }
00077
00078 template <class _TS>
00079 inline void control_data::assign(const std::string& __s,
00080 const linalg::matrix<_TS>*& __b) const
00081 throw(api_exception)
00082 {
00083 if(!retrieve(__s, __b))
00084 {
00085 throw api_exception(apiee_communication_data,
00086 std::string("required control data entry '")+__s+
00087 "' is missing");
00088 }
00089 }
00090
00091 template <class _TS>
00092 inline void control_data::assign(const std::string& __s, _TS& __b) const
00093 throw(api_exception)
00094 {
00095 if(!retrieve(__s, __b))
00096 {
00097 throw api_exception(apiee_communication_data,
00098 std::string("required control data entry '")+__s+
00099 "' is missing");
00100 }
00101 }
00102
00103 inline void control_data::assign(const std::string& __s, std::string& __b,
00104 const char* __def) const
00105 {
00106 retrieve(__s, __b, std::string(__def));
00107 }
00108
00109 template <class _TS>
00110 inline void control_data::assign(const std::string& __s,
00111 const std::vector<_TS>*& __b,
00112 const std::vector<_TS>* __def) const
00113 {
00114 retrieve(__s, __b, __def);
00115 }
00116
00117 template <class _TS>
00118 inline void control_data::assign(const std::string& __s, const linalg::matrix<_TS>*& __b,
00119 const linalg::matrix<_TS>* __def) const
00120 {
00121 retrieve(__s, __b, __def);
00122 }
00123
00124 template <class _TS>
00125 inline void control_data::assign(const std::string& __s, _TS& __b,
00126 _TS __def) const
00127 {
00128 retrieve(__s, __b, __def);
00129 }
00130
00131 template <class _TS>
00132 inline void control_data::assign(const char* __s,
00133 const std::vector<_TS>*& __b) const
00134 throw(api_exception)
00135 {
00136 assign(std::string(__s), __b);
00137 }
00138
00139 template <class _TS>
00140 inline void control_data::assign(const char* __s, const linalg::matrix<_TS>*& __b) const
00141 throw(api_exception)
00142 {
00143 assign(std::string(__s), __b);
00144 }
00145
00146 template <class _TS>
00147 inline void control_data::assign(const char* __s, _TS& __b) const
00148 throw(api_exception)
00149 {
00150 assign(std::string(__s), __b);
00151 }
00152
00153 inline void control_data::assign(const char* __s, std::string& __b,
00154 const char* __def) const
00155 {
00156 assign(std::string(__s), __b, __def);
00157 }
00158
00159 template <class _TS>
00160 inline void control_data::assign(const char* __s, const std::vector<_TS>*& __b,
00161 const std::vector<_TS>* __def) const
00162 {
00163 assign(std::string(__s), __b, __def);
00164 }
00165
00166 template <class _TS>
00167 inline void control_data::assign(const char* __s, const linalg::matrix<_TS>*& __b,
00168 const linalg::matrix<_TS>* __def) const
00169 {
00170 assign(std::string(__s), __b, __def);
00171 }
00172
00173 template <class _TS>
00174 inline void control_data::assign(const char* __s, _TS& __b,
00175 _TS __def) const
00176 {
00177 assign(std::string(__s), __b, __def);
00178 }
00179
00180 template <class _TS>
00181 inline void control_data::assign_i(const std::string& __s, int i,
00182 const std::vector<_TS>*& __b) const
00183 throw(api_exception)
00184 {
00185 if(!retrieve_i(__s, i, __b))
00186 {
00187 throw api_exception(apiee_communication_data,
00188 std::string("required control data entry '")+__s+
00189 "' with index "+convert_to_str(i)+" is missing");
00190 }
00191 }
00192
00193 template <class _TS>
00194 inline void control_data::assign_i(const std::string& __s, int i,
00195 const linalg::matrix<_TS>*& __b) const
00196 throw(api_exception)
00197 {
00198 if(!retrieve_i(__s, i, __b))
00199 {
00200 throw api_exception(apiee_communication_data,
00201 std::string("required control data entry '")+__s+
00202 "' with index "+convert_to_str(i)+" is missing");
00203 }
00204 }
00205
00206 template <class _TS>
00207 inline void control_data::assign_i(const std::string& __s, int i, _TS& __b) const
00208 throw(api_exception)
00209 {
00210 if(!retrieve_i(__s, i, __b))
00211 {
00212 throw api_exception(apiee_communication_data,
00213 std::string("required control data entry '")+__s+
00214 "' with index "+convert_to_str(i)+" is missing");
00215 }
00216 }
00217
00218 inline void control_data::assign_i(const std::string& __s, int i,
00219 std::string& __b, const char* __def) const
00220 {
00221 retrieve_i(__s, i, __b, std::string(__def));
00222 }
00223
00224 template <class _TS>
00225 inline void control_data::assign_i(const std::string& __s, int i,
00226 const std::vector<_TS>*& __b,
00227 const std::vector<_TS>* __def) const
00228 {
00229 retrieve_i(__s, i, __b, __def);
00230 }
00231
00232 template <class _TS>
00233 inline void control_data::assign_i(const std::string& __s, int i,
00234 const linalg::matrix<_TS>*& __b,
00235 const linalg::matrix<_TS>* __def) const
00236 {
00237 retrieve_i(__s, i, __b, __def);
00238 }
00239
00240 template <class _TS>
00241 inline void control_data::assign_i(const std::string& __s, int i, _TS& __b,
00242 _TS __def) const
00243 {
00244 retrieve_i(__s, i, __b, __def);
00245 }
00246
00247 template <class _TS>
00248 inline void control_data::assign_i(const char* __s, int i,
00249 const std::vector<_TS>*& __b) const
00250 throw(api_exception)
00251 {
00252 assign_i(std::string(__s), i, __b);
00253 }
00254
00255 template <class _TS>
00256 inline void control_data::assign_i(const char* __s, int i,
00257 const linalg::matrix<_TS>*& __b) const
00258 throw(api_exception)
00259 {
00260 assign_i(std::string(__s), i, __b);
00261 }
00262
00263 template <class _TS>
00264 inline void control_data::assign_i(const char* __s, int i, _TS& __b) const
00265 throw(api_exception)
00266 {
00267 assign_i(std::string(__s), i, __b);
00268 }
00269
00270 inline void control_data::assign_i(const char* __s, int i, std::string& __b,
00271 const char* __def) const
00272 {
00273 assign_i(std::string(__s), i, __b, __def);
00274 }
00275
00276 template <class _TS>
00277 inline void control_data::assign_i(const char* __s, int i,
00278 const std::vector<_TS>*& __b,
00279 const std::vector<_TS>* __def) const
00280 {
00281 assign_i(std::string(__s), i, __b, __def);
00282 }
00283
00284 template <class _TS>
00285 inline void control_data::assign_i(const char* __s, int i,
00286 const linalg::matrix<_TS>*& __b,
00287 const linalg::matrix<_TS>* __def) const
00288 {
00289 assign_i(std::string(__s), i, __b, __def);
00290 }
00291
00292 template <class _TS>
00293 inline void control_data::assign_i(const char* __s, int i, _TS& __b,
00294 _TS __def) const
00295 {
00296 assign_i(std::string(__s), i, __b, __def);
00297 }
00298
00299 }
00300
00301 #endif