filval.hpp 959 B

123456789101112131415161718192021222324252627282930313233
  1. #ifndef filval_hpp
  2. #define filval_hpp
  3. #define FILVAL_VERSION_MAJOR @FILVAL_VERSION_MAJOR@
  4. #define FILVAL_VERSION_MINOR @FILVAL_VERSION_MINOR@
  5. #include "value.hpp"
  6. #include "container.hpp"
  7. #include "dataset.hpp"
  8. #include "log.hpp"
  9. #include "argparse.hpp"
  10. #include "config.hpp"
  11. #include "memtrack.hpp"
  12. namespace fv {
  13. template<typename T>
  14. Value<T> *lookup(const std::string &name) {
  15. Value<T> *tv = GenValue::get_value<T>(name);
  16. if (tv == nullptr) {
  17. CRITICAL("Could not find alias or value \"" << name << "\"."
  18. << " I'll tell you the ones I know about." << std::endl
  19. << GenValue::summary());
  20. }
  21. return tv;
  22. }
  23. template<typename T>
  24. bool check_exists(const std::string name) {
  25. Value<T> *tv = GenValue::get_value<T>(name);
  26. return tv != nullptr;
  27. }
  28. }
  29. #endif // filval_hpp