18 #include "scanner/util/common.h" 19 #include "scanner/util/profiler.h" 20 #include "scanner/util/storehouse.h" 47 virtual void validate(proto::Result* result) { result->set_success(
true); }
49 virtual i64 total_elements() = 0;
55 virtual ElementArgs element_args_at(i64 element_idx) = 0;
62 class EnumeratorBuilder;
64 using EnumeratorConstructor =
65 std::function<Enumerator*(const EnumeratorConfig& config)>;
78 constructor_(constructor) {}
81 protobuf_name_ = protobuf_name;
87 EnumeratorConstructor constructor_;
88 std::string protobuf_name_;
92 #define REGISTER_ENUMERATOR(name__, enumerator__) \ 93 REGISTER_ENUMERATOR_HELPER(__COUNTER__, name__, enumerator__) 95 #define REGISTER_ENUMERATOR_HELPER(uid__, name__, enumerator__) \ 96 REGISTER_ENUMERATOR_UID(uid__, name__, enumerator__) 98 #define REGISTER_ENUMERATOR_UID(uid__, name__, enumerator__) \ 99 static ::scanner::internal::EnumeratorRegistration \ 100 enumerator_registration_##uid__ __attribute__((unused)) = \ 101 ::scanner::internal::EnumeratorBuilder( \ 102 #name__, [](const ::scanner::EnumeratorConfig& config) { \ 103 return new enumerator__(config); \ Definition: enumerator.h:72
Interface for enumerating available data from a data source.
Definition: enumerator.h:42
Definition: enumerator.h:67
Definition: enumerator.h:34
Parameters provided at instantiation of an enumerator.
Definition: enumerator.h:29
Definition: database.cpp:36
storehouse::StorageConfig * storage_config
Byte-string of proto args if given.
Definition: enumerator.h:31