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