JODA  0.13.1 (59b41972)
JSON On-Demand Analysis
IValueTestHelper.h
Go to the documentation of this file.
1 //
2 // Created by Nico on 28/02/2019.
3 //
4 
5 #ifndef JODA_IVALUETESTHELPER_H
6 #define JODA_IVALUETESTHELPER_H
10 
12  public:
13  template <typename V>
14  static void param(std::vector<V> &vec) {}
15 
16  template <typename V, typename T1, typename... Types>
17  static void param(std::vector<V> &vec, T1 &&t1, Types &&... args) {
18  vec.emplace_back(std::forward<T1 &&>(t1));
19  param(vec, std::forward<Types &&>(args)...);
20  }
21 
22  static std::unique_ptr<joda::query::IValueProvider> getNumVal(double d) {
23  return std::make_unique<joda::query::DoubleProvider>(d);
24  }
25 
26  static std::unique_ptr<joda::query::IValueProvider> getNumVal(int64_t i) {
27  return std::make_unique<joda::query::Int64Provider>(i);
28  }
29 
30  static std::unique_ptr<joda::query::IValueProvider> getNumVal(u_int64_t i) {
31  return std::make_unique<joda::query::UInt64Provider>(i);
32  }
33  static std::unique_ptr<joda::query::IValueProvider> getPointer(
34  std::string ptr) {
35  return std::make_unique<joda::query::PointerProvider>(ptr);
36  }
37  static std::unique_ptr<joda::query::IValueProvider> getStringVal(
38  std::string str) {
39  return std::make_unique<joda::query::StringProvider>(str);
40  }
41  static std::unique_ptr<joda::query::IValueProvider> getBoolVal(bool b) {
42  return std::make_unique<joda::query::BoolProvider>(b);
43  }
44 };
45 #endif // JODA_IVALUETESTHELPER_H
Definition: IValueTestHelper.h:11
static std::unique_ptr< joda::query::IValueProvider > getPointer(std::string ptr)
Definition: IValueTestHelper.h:33
static std::unique_ptr< joda::query::IValueProvider > getNumVal(double d)
Definition: IValueTestHelper.h:22
static std::unique_ptr< joda::query::IValueProvider > getBoolVal(bool b)
Definition: IValueTestHelper.h:41
static void param(std::vector< V > &vec)
Definition: IValueTestHelper.h:14
static std::unique_ptr< joda::query::IValueProvider > getStringVal(std::string str)
Definition: IValueTestHelper.h:37
static void param(std::vector< V > &vec, T1 &&t1, Types &&... args)
Definition: IValueTestHelper.h:17
static std::unique_ptr< joda::query::IValueProvider > getNumVal(int64_t i)
Definition: IValueTestHelper.h:26
static std::unique_ptr< joda::query::IValueProvider > getNumVal(u_int64_t i)
Definition: IValueTestHelper.h:30