b2api
B2000++ API Reference Manual, VERSION 4.6
 
Loading...
Searching...
No Matches
b2case_database.H
1//------------------------------------------------------------------------
2// b2case_database.H --
3//
4//
5// written by Mathias Doreille
6// Harald Klimach <harald.klimach@dlr.de>
7// Thomas Blome <thomas.blome@dlr.de>
8//
9// (c) 2004-2012,2017 SMR Engineering & Development SA
10// 2502 Bienne, Switzerland
11//
12// (c) 2023 Deutsches Zentrum für Luft- und Raumfahrt (DLR) e.V.
13// Linder Höhe, 51147 Köln
14//
15// All Rights Reserved. Proprietary source code. The contents of
16// this file may not be disclosed to third parties, copied or
17// duplicated in any form, in whole or in part, without the prior
18// written permission of SMR.
19//------------------------------------------------------------------------
20
21#ifndef B2CASE_DATABASE_H_
22#define B2CASE_DATABASE_H_
23
24#include <list>
25#include <string>
26#include <vector>
27
28#include "b2model_database.H"
29#include "b2ppconfig.h"
30#include "model/b2case.H"
31#include "model_imp/b2case_component.H"
32#include "muParser.h"
33#include "utils/b2allocator.H"
34#include "utils/b2dictionary.H"
35#include "utils/b2logging.H"
36#include "utils/b2splines.H"
37#include "utils/b2threading.H"
38
39namespace b2000::b2dbv3 {
40
46class CaseAttributeList : public b2000::CaseComponent {
47public:
49
50 std::string get_stage_id(int stage = -1) const override = 0;
51
52 void push_rtable(const RTable& rtable) { rtable_list.push_back(&rtable); }
53
54 void set_case_rtable(const RTable& rtable) { case_rtable = &rtable; }
55
56 const RTable& get_case_rtable() { return *case_rtable; }
57
58 void set_stage_rtable(const RTable& rtable) { stage_rtable = &rtable; }
59
60 const RTable& top_rtable() { return *rtable_list.back(); }
61
62 void pop_rtable() { rtable_list.pop_back(); }
63
64 void set_cmdline_opt(Dictionary* cmdline_set_) { cmdline_set = cmdline_set_; }
65
66 void copy(const CaseAttributeList& case_) {
67 rtable_list = case_.rtable_list;
68 cmdline_set = case_.cmdline_set;
69 }
70
71 bool has_key(const std::string& key) const override {
72 if (cmdline_set && cmdline_set->has_key(key)) { return true; }
73 std::string case_key("CASE");
74 case_key += get_id();
75 case_key += '.';
76 std::string stage_key = case_key + "STAGE" + get_stage_id() + '.' + key;
77 case_key += key;
78 if (cmdline_set && (cmdline_set->has_key(case_key) || cmdline_set->has_key(stage_key))) {
79 return true;
80 }
81 if (stage_rtable && stage_rtable->has_key(key)) { return true; }
82 if (case_rtable && case_rtable->has_key(key)) { return true; }
83 if (key_value.has_key(key)) { return true; }
84 for (std::vector<const RTable*>::const_reverse_iterator i = rtable_list.rbegin();
85 i != rtable_list.rend(); ++i) {
86 if ((*i)->has_key(key)) { return true; }
87 }
88 keys_conversion_t::const_iterator res = keys_conversion.find(key);
89 if (res != keys_conversion.end()) { return has_key(res->second); }
90 return false;
91 }
92
93 template <typename T>
94 T get(const std::string& key) const {
95 std::string case_key("CASE");
96 case_key += get_id();
97 case_key += '.';
98 std::string stage_key = case_key + "STAGE" + get_stage_id() + '.' + key;
99 case_key += key;
100 if (cmdline_set && cmdline_set->has_key(stage_key)) {
101 try {
102 T r = cmdline_set->get<T>(stage_key);
103 const_cast<RTable&>(solution_rtable).set(key, r);
104 return r;
105 } catch (Exception& e) {
106 logging::get_logger("command_line")
107 << logging::warning << "Cannot parse the command line directive adir: " << e
108 << logging::LOGFLUSH;
109 }
110 }
111 if (key_value.has_key(key)) {
112 T r = key_value.get<T>(key);
113 const_cast<RTable&>(solution_rtable).set(key, r);
114 return r;
115 }
116 if (stage_rtable && stage_rtable->has_key(key)) {
117 T r = stage_rtable->get<T>(key);
118 const_cast<RTable&>(solution_rtable).set(key, r);
119 return r;
120 }
121 if (cmdline_set && cmdline_set->has_key(case_key)) {
122 try {
123 T r = cmdline_set->get<T>(case_key);
124 const_cast<RTable&>(solution_rtable).set(key, r);
125 return r;
126 } catch (Exception& e) {
127 logging::get_logger("command_line")
128 << logging::warning << "Cannot parse the command line directive adir: " << e
129 << logging::LOGFLUSH;
130 }
131 }
132 if (case_rtable && case_rtable->has_key(key)) {
133 T r = case_rtable->get<T>(key);
134 const_cast<RTable&>(solution_rtable).set(key, r);
135 return r;
136 }
137 if (cmdline_set && cmdline_set->has_key(key)) {
138 try {
139 T r = cmdline_set->get<T>(key);
140 const_cast<RTable&>(solution_rtable).set(key, r);
141 return r;
142 } catch (Exception& e) {
143 logging::get_logger("command_line")
144 << logging::warning << "Cannot parse the command line directive adir: " << e
145 << logging::LOGFLUSH;
146 }
147 }
148 for (std::vector<const RTable*>::const_reverse_iterator ii = rtable_list.rbegin();
149 ii != rtable_list.rend(); ++ii) {
150 if ((*ii)->has_key(key)) {
151 T r = (*ii)->get<T>(key);
152 const_cast<RTable&>(solution_rtable).set(key, r);
153 return r;
154 }
155 }
156 keys_conversion_t::const_iterator res = keys_conversion.find(key);
157 if (res != keys_conversion.end()) {
158 T r = get<T>(res->second);
159 const_cast<RTable&>(solution_rtable).set(key, r);
160 return r;
161 }
162 Exception() << "The key " << key << " of type " << typeid(T)
163 << " is needed but not defined for "
164 "the case "
165 << get_id() << "." << THROW;
166 return T();
167 }
168
169 template <typename T>
170 T get(const std::string& key, const T& default_) const {
171 if (!has_key(key)) { return default_; }
172 return get<T>(key);
173 }
174
175 std::string get_string(const std::string& key) const override { return get<std::string>(key); }
176
177 bool get_bool(const std::string& key) const override { return get<bool>(key); }
178
179 int get_int(const std::string& key) const override { return get<int>(key); }
180
181 double get_double(const std::string& key) const override { return get<double>(key); }
182
183 b2000::csda<double> get_csda_double(const std::string& key) const override {
184 return get<b2000::csda<double>>(key);
185 }
186
187 std::complex<double> get_complex_double(const std::string& key) const override {
188 return get<std::complex<double>>(key);
189 }
190
191 std::string get_string(const std::string& key, const std::string& default_) const override {
192 return get<std::string>(key, default_);
193 }
194
195 bool get_bool(const std::string& key, const bool& default_) const {
196 return get<bool>(key, default_);
197 }
198
199 int get_int(const std::string& key, const int& default_) const {
200 return get<int>(key, default_);
201 }
202
203 double get_double(const std::string& key, const double& default_) const {
204 return get<double>(key, default_);
205 }
206
207 b2000::csda<double> get_csda_double(
208 const std::string& key, const b2000::csda<double>& default_) const {
209 return get<b2000::csda<double>>(key, default_);
210 }
211
212 std::complex<double> get_complex_double(
213 const std::string& key, const std::complex<double>& default_) const {
214 return get<std::complex<double>>(key, default_);
215 }
216
217 template <typename T>
218 void get(const std::string& key, std::vector<T>& v) const {
219 std::string case_key("CASE");
220 case_key += get_id();
221 case_key += '.';
222 std::string stage_key = case_key + "STAGE" + get_stage_id() + '.' + key;
223 case_key += key;
224 if (cmdline_set && cmdline_set->has_key(stage_key)) {
225 try {
226 cmdline_set->get(stage_key, v);
227 const_cast<RTable&>(solution_rtable).set(key, v);
228 return;
229 } catch (Exception& e) {
230 logging::get_logger("command_line")
231 << logging::warning << "Cannot parse the command line directive adir: " << e
232 << logging::LOGFLUSH;
233 }
234 }
235 if (stage_rtable && stage_rtable->has_key(key)) {
236 stage_rtable->get(key, v);
237 const_cast<RTable&>(solution_rtable).set(key, v);
238 return;
239 }
240 if (cmdline_set && cmdline_set->has_key(case_key)) {
241 try {
242 cmdline_set->get(case_key, v);
243 const_cast<RTable&>(solution_rtable).set(key, v);
244 return;
245 } catch (Exception& e) {
246 logging::get_logger("command_line")
247 << logging::warning << "Cannot parse the command line directive adir: " << e
248 << logging::LOGFLUSH;
249 }
250 }
251 if (case_rtable && case_rtable->has_key(key)) {
252 case_rtable->get(key, v);
253 const_cast<RTable&>(solution_rtable).set(key, v);
254 return;
255 }
256 if (cmdline_set && cmdline_set->has_key(key)) {
257 try {
258 cmdline_set->get(key, v);
259 const_cast<RTable&>(solution_rtable).set(key, v);
260 return;
261 } catch (Exception& e) {
262 logging::get_logger("command_line")
263 << logging::warning << "Cannot parse the command line directive adir: " << e
264 << logging::LOGFLUSH;
265 }
266 }
267 for (std::vector<const RTable*>::const_reverse_iterator i = rtable_list.rbegin();
268 i != rtable_list.rend(); ++i) {
269 if ((*i)->has_key(key)) {
270 (*i)->get(key, v);
271 const_cast<RTable&>(solution_rtable).set(key, v);
272 return;
273 }
274 }
275 keys_conversion_t::const_iterator res = keys_conversion.find(key);
276 if (res != keys_conversion.end()) {
277 get(res->second, v);
278 const_cast<RTable&>(solution_rtable).set(key, v);
279 return;
280 }
281 Exception() << "The key " << key << " of type array of " << typeid(T)
282 << " is needed but not "
283 "defined for the case "
284 << get_id() << "." << THROW;
285 }
286
287 void set(const std::string& key, int value) override { key_value.set(key, value); }
288
289 void set(const std::string& key, double value) override { key_value.set(key, value); }
290
291 void set(const std::string& key, b2000::csda<double> value) override {
292 key_value.set(key, value);
293 }
294
295 void set(const std::string& key, std::complex<double> value) override {
296 key_value.set(key, value);
297 }
298
299 void set(const std::string& key, const std::string& value) override {
300 key_value.set(key, value);
301 }
302
303 void get(const std::string& key, std::vector<int>& v) const override { get<int>(key, v); }
304
305 void get(const std::string& key, std::vector<double>& v) const override { get<double>(key, v); }
306
307 void get(const std::string& key, std::vector<b2000::csda<double>>& v) const override {
308 get<b2000::csda<double>>(key, v);
309 }
310
311 void get(const std::string& key, std::vector<std::complex<double>>& v) const override {
312 get<std::complex<double>>(key, v);
313 }
314
315 void warn_on_non_used_key() const override {
316 if (cmdline_set) { cmdline_set->warn_on_non_used_key(); }
317 }
318
319 RTable& get_solution_rtable() { return solution_rtable; }
320
321private:
322 std::vector<const RTable*> rtable_list;
323 const RTable* case_rtable;
324 const RTable* stage_rtable;
325 Dictionary* cmdline_set;
326 using keys_conversion_t = std::map<std::string, std::string>;
327 keys_conversion_t keys_conversion;
328 RTable key_value;
329 RTable solution_rtable;
330};
331
332class Case : public CaseAttributeList {
333public:
334 ~Case() override {
335 for (auto& comp : list_comp) { comp->decref_or_free(); }
336 for (auto& time_func : list_time_function) { delete time_func; }
337 }
338 void init(Model& model, const std::string& db_id, Allocator& allocator);
339
340 // Add component to list_comp with information from RTable and subtype_name
341 void set_component(
342 Model& model, const std::string& case_id, const RTable& rt,
343 const std::string& subtype_name, double scalef, Allocator& allocator);
344
345 // Get component from list_comp using component id
346 Component& get_component(const std::string& comp_id);
347
348 std::string get_id() const override { return id; }
349
350 void get_subcase_ids(std::set<int>& subcase_ids_) const override { subcase_ids_ = subcase_ids; }
351
352 size_t get_number_of_stage() const override { return 1; }
353
354 std::string get_stage_id(int stage = -1) const override { return id; }
355
356 int get_stage_number() const override { return 0; }
357
358 double get_stage_size(int stage = -1) const override {
359 double pamax = get_double("PAMAX", 1.0);
360 if (pamax == 0.0) { pamax = 1.0; }
361 return pamax;
362 }
363
364 bool next_stage() override { return false; }
365
366 void set_stage(int stage) override { return; }
367
368 class CaseComponentIterator : public ComponentIterator {
369 public:
370 Component* next() override {
371 ensure_matching_subcase_id();
372 if (begin == end) { return nullptr; }
373 return *begin++;
374 }
375
376 private:
377 friend class b2dbv3::Case;
378 CaseComponentIterator(Component** begin_, Component** end_, const int subcase_id_)
379 : begin(begin_), end(end_), subcase_id(subcase_id_) {
380 ensure_matching_subcase_id();
381 }
382
383 void ensure_matching_subcase_id() {
384 if (subcase_id < 0) { return; }
385 for (; begin != end; ++begin) {
386 if (*begin != nullptr && (*begin)->get_subcase_id() == subcase_id) { break; }
387 }
388 }
389
390 using list_comp_t = std::vector<Component*>;
391 Component** begin;
392 Component** end;
393 int subcase_id;
394 };
395
396 component_iterator get_component_iterator() override {
397 return component_iterator(
398 new CaseComponentIterator(&list_comp.front(), &list_comp.back() + 1, -1));
399 }
400
401 component_iterator get_component_iterator_for_stage(size_t stage) override {
402 return get_component_iterator();
403 }
404
405 component_iterator get_component_iterator_for_stage_and_subcase(
406 size_t stage_, int subcase_id_) override {
407 if (stage_ != 0 && subcase_id_ != 0) {
408 UnimplementedError() << "Stages and subcases cannot be "
409 "combined."
410 << THROW;
411 }
412 return component_iterator(
413 new CaseComponentIterator(&list_comp.front(), &list_comp.back() + 1, subcase_id_));
414 }
415
416 using type_t = ObjectTypeComplete<Case>;
417 static type_t type;
418
419protected:
420 class TimeFunction : public b2000::TimeFunction {
421 public:
422 TimeFunction(double scale_) : scale(scale_) {}
423
424 double d_value(double t, int order) override {
425 // Numerical computation of the derivative of the
426 // expression.
427 static const int binomial_coefficient[7][7] = {
428 {1},
429 {1, -1},
430 {1, -2, 1},
431 {1, -3, 3, -1},
432 {1, -4, 6, -4, 1},
433 {1, -5, 10, -10, 5, -1},
434 {1, -6, 15, -20, 15, -6, 1}};
435 if (order > 6) { UnimplementedError() << THROW; }
436 double h = 0.0001;
437 double vt = value(t);
438 if (vt != vt) {
439 // The evaluation of the python expression is
440 // not a number.
441 return vt;
442 }
443 double r = 0;
444 while (1) {
445 double new_r = 0;
446 for (int i = 0; i <= order; ++i) {
447 new_r += binomial_coefficient[order][i] * value(t + (order / 2.0 - i) * h);
448 }
449 for (int i = 0; i != order; ++i) { new_r /= h; }
450 if (std::abs(new_r - r) < 0.0000001) { return new_r; }
451 r = new_r;
452 h /= 100;
453 }
454 return -1;
455 }
456
457 protected:
458 double scale;
459 };
460
461 class TimeFunctionIdentity : public TimeFunction {
462 public:
463 TimeFunctionIdentity(double scale_) : TimeFunction(scale_) {}
464
465 double value(double t) override { return scale * t; }
466
467 double d_value(double t, int order) override {
468 if (order == 1) { return scale; }
469 if (order > 1) { return 0; }
470 Exception() << THROW;
471 return 0;
472 }
473 };
474
475 class TimeFunctionExpression : public TimeFunction {
476 public:
477 TimeFunctionExpression(double scale_, const std::string& expression_string)
478 : TimeFunction(scale_) {
479 expression.SetExpr(expression_string);
480 expression.DefineVar("t", &var_t);
481 expression.SetVarFactory(AddVariable, this);
482 }
483
484 void set_case(b2000::Case& case_) override {
485 expression.ClearConst();
486 expression.DefineConst("s", case_.get_stage_number() + 1);
487 expression.DefineStrConst("sid", case_.get_stage_id());
488 expression.DefineConst("ssize", case_.get_stage_size());
489 }
490
491 double value(double t) override {
492 try {
493 b2spin_rw_mutex::scoped_lock lock(mutex);
494
495 var_t = t;
496 return scale * expression.Eval();
497 } catch (mu::Parser::exception_type& e) {
498 Exception() << "In the expression \"" << expression.GetExpr()
499 << "\": " << e.GetMsg() << THROW;
500 }
501 return 0;
502 }
503
504 private:
505 b2spin_rw_mutex mutex;
506
507 static double* AddVariable(const char* a_szName, void* pUserData) {
508 TimeFunctionExpression* this_ = static_cast<TimeFunctionExpression*>(pUserData);
509 std::deque<double>& dyn_var = this_->dyn_var;
510
511 b2spin_rw_mutex::scoped_lock lock(this_->mutex);
512
513 dyn_var.push_back(0);
514 return &(dyn_var.back());
515 }
516 double var_t;
517 mu::Parser expression;
518 std::deque<double> dyn_var;
519 };
520
521 class TimeFunctionTabulated : public TimeFunction {
522 public:
523 TimeFunctionTabulated(double scale_, const std::vector<double>& tabulated_vector)
524 : TimeFunction(scale_),
525 spline(tabulated_vector.begin(), tabulated_vector.end(), true) {}
526
527 double value(double t) override { return scale * spline(t); }
528
529 private:
530 CubicSpline spline;
531 };
532
533 RTable rtable;
534 std::string id;
535 using list_comp_t = std::vector<Component*>;
536 list_comp_t list_comp;
537
538 using list_time_function_t = std::vector<TimeFunction*>;
539 list_time_function_t list_time_function;
540 std::set<int> subcase_ids;
541
542 void add_case(Model& model, const std::string& set_id, double scalef, Allocator& allocator);
543};
544
545class CaseStage : public Case {
546public:
547 void init(Model& model, const std::string& db_id, Allocator& allocator);
548
549 size_t get_number_of_stage() const override { return list_stage.size(); }
550
551 std::string get_stage_id(int stage_ = -1) const override {
552 if (stage_ == -1) {
553 return stage->first.get_id();
554 } else {
555 return get_stage(stage_)->first.get_id();
556 }
557 }
558
559 int get_stage_number() const override { return stage_number; }
560
561 double get_stage_size(int stage_ = -1) const override {
562 if (stage_ == -1) {
563 return stage->second;
564 } else {
565 return get_stage(stage_)->second;
566 }
567 }
568
569 bool next_stage() override;
570
571 void set_stage(int stage_) override;
572
573 component_iterator get_component_iterator() override {
574 return stage->first.get_component_iterator();
575 }
576
577 component_iterator get_component_iterator_for_stage(size_t stage_) override {
578 return get_stage(stage_)->first.get_component_iterator();
579 }
580
581 component_iterator get_component_iterator_for_stage_and_subcase(
582 size_t stage_, int subcase_id_) override {
583 if (stage_ != 0 && subcase_id_ != 0) {
584 UnimplementedError() << "Stages and subcases cannot be "
585 "combined."
586 << THROW;
587 }
588 return get_stage(stage_)->first.get_component_iterator();
589 }
590
591 using type_t = ObjectTypeComplete<CaseStage>;
592 static type_t type;
593
594private:
595 void add_stage(Model& model, const std::string& set_id, double scalef, Allocator& allocator);
596
597 using list_stage_t = std::list<std::pair<Case, double>>;
598 list_stage_t list_stage;
599 list_stage_t::iterator stage;
600 int stage_number;
601
602 list_stage_t::const_iterator get_stage(int stage_) const {
603 if (stage_ < 0 || size_t(stage_) >= list_stage.size()) { Exception() << THROW; }
604 list_stage_t::const_iterator i = list_stage.begin();
605 while (stage_--) { ++i; }
606 return i;
607 }
608
609 list_stage_t::iterator get_stage(int stage_) {
610 if (stage_ < 0 || size_t(stage_) >= list_stage.size()) { Exception() << THROW; }
611 list_stage_t::iterator i = list_stage.begin();
612 while (stage_--) { ++i; }
613 return i;
614 }
615};
616
617class CaseList : public b2000::CaseList, protected std::vector<Case*> {
618public:
619 void set_model(b2000::Model& model) override {}
620
621 size_t get_number_of_case() const override { return size(); }
622
623 class CaseIterator : public b2000::CaseList::CaseIterator {
624 public:
625 Case* next() override {
626 if (begin != end) { return *begin++; }
627 return nullptr;
628 }
629 size_t get_number_of_case() const override { return end - begin; }
630
631 private:
632 friend class b2dbv3::CaseList;
633 CaseIterator(std::vector<Case*>& cl) : begin(cl.begin()), end(cl.end()) {}
634 std::vector<Case*>::iterator begin;
635 std::vector<Case*>::iterator end;
636 };
637
638 b2000::CaseList::case_iterator get_case_iterator() override {
639 return case_iterator(new CaseIterator(*this));
640 }
641
642 b2000::CaseList::case_list_iterator get_case_sublist_iterator(
643 const b2000::Domain* domain, b2000::CaseList::SortType st) override {
644 return case_list_iterator(new CaseListIterator(*this, std::less<Case*>()));
645 }
646
647 b2000::CaseList::case_list_iterator get_case_sublist_iterator(
648 const NaturalBoundaryCondition* nbc, b2000::CaseList::SortType st) override {
649 return case_list_iterator(new CaseListIterator(*this, std::less<Case*>()));
650 }
651
652 b2000::CaseList::case_list_iterator get_case_sublist_iterator(
653 const EssentialBoundaryCondition* ebc, b2000::CaseList::SortType st) override {
654 return case_list_iterator(new CaseListIterator(*this, std::less<Case*>()));
655 }
656
657 b2000::CaseList::case_list_iterator get_case_sublist_iterator(
658 const ModelReductionBoundaryCondition* mrbc, b2000::CaseList::SortType st) override {
659 return case_list_iterator(new CaseListIterator(*this, std::less<Case*>()));
660 }
661
662 case_list_iterator get_case_sublist_iterator(
663 const InitialCondition* ic, b2000::CaseList::SortType st) override {
664 return case_list_iterator(new CaseListIterator(*this, std::less<Case*>()));
665 }
666
667 class CaseListIterator : public b2000::CaseList::CaseListIterator {
668 public:
669 CaseList* next() override {
670 if (iter != list_of_case_list.end()) { return &(*(iter++)); }
671 return nullptr;
672 }
673 size_t get_number_of_case_list() const override { return list_of_case_list.size(); }
674
675 private:
676 friend class b2dbv3::CaseList;
677
678 template <typename CASE_COMP>
679 CaseListIterator(std::vector<Case*>& clist, const CASE_COMP& comp) {
680 std::vector<Case*> tmp(clist);
681 std::vector<Case*>::iterator i = tmp.begin();
682 std::sort(i, tmp.end(), comp);
683 list_of_case_list.push_back(CaseList());
684 list_of_case_list.back().push_back(*i++);
685 for (; i != tmp.end(); ++i) {
686 if (comp(list_of_case_list.back().front(), *i)) {
687 list_of_case_list.push_back(CaseList());
688 }
689 list_of_case_list.back().push_back(*i);
690 }
691 iter = list_of_case_list.begin();
692 }
693 std::list<CaseList>::iterator iter;
694 std::list<CaseList> list_of_case_list;
695 };
696
697 friend class CaseListIterator;
698
699 using type_t = ObjectTypeComplete<CaseList, CaseList::type_t>;
700 static type_t type;
701};
702
703class CaseListRoot : public CaseList {
704public:
705 ~CaseListRoot() override {
706 for (std::vector<Case*>::iterator i = begin(); i != end(); ++i) { (*i)->decref_or_free(); }
707 }
708
709 void set_model(b2000::Model& model) override {}
710
711 void init(Model& model, Dictionary* cmdline_set_, const RTable& adir, const RTable& strat);
712
713 using type_t = ObjectTypeComplete<CaseListRoot, CaseList::type_t>;
714 static type_t type;
715
716private:
717 Allocator allocator;
718};
719
720} // namespace b2000::b2dbv3
721
722#endif // B2CASE_DATABASE_H_
#define THROW
Definition b2exception.H:198
Definition b2case.H:154
Definition b2case.H:110
virtual double get_stage_size(int stage=-1) const =0
virtual int get_stage_number() const =0
virtual std::string get_stage_id(int stage=-1) const =0
Definition b2dictionary.H:48
virtual void warn_on_non_used_key() const =0
T get(const std::string &key) const
Definition b2dictionary.H:121
virtual bool has_key(const std::string &key) const =0
Definition b2domain.H:70
Definition b2exception.H:131
Definition b2model.H:69
Definition b2rtable.H:427
bool has_key(const std::string &key) const
Definition b2rtable.H:433
T get(const std::string &key) const
Definition b2rtable.H:647
void set(const std::string &key, const T &v, const bool new_key=false)
Assign a single value. If new_key is true, the key must not exist.
Definition b2rtable.H:463
Definition b2case_database.H:46
Logger & get_logger(const std::string &logger_name="")
Definition b2logging.H:829
GenericException< UnimplementedError_name > UnimplementedError
Definition b2exception.H:314