22 #include "glog/logging.h" 27 std::unique_ptr<FrameIdFilteringPointsProcessor>
30 std::vector<std::string> keep_frames, drop_frames;
31 if (dictionary->
HasKey(
"keep_frames")) {
33 dictionary->
GetDictionary(
"keep_frames")->GetArrayValuesAsStrings();
35 if (dictionary->
HasKey(
"drop_frames")) {
37 dictionary->
GetDictionary(
"drop_frames")->GetArrayValuesAsStrings();
39 return common::make_unique<FrameIdFilteringPointsProcessor>(
40 std::unordered_set<std::string>(keep_frames.begin(), keep_frames.end()),
41 std::unordered_set<std::string>(drop_frames.begin(), drop_frames.end()),
46 const std::unordered_set<std::string>& keep_frame_ids,
47 const std::unordered_set<std::string>& drop_frame_ids,
52 CHECK_NE(keep_frame_ids.empty(), drop_frame_ids.empty())
53 <<
"You have to specify exactly one of the `keep_frames` property or the " 54 <<
"`drop_frames` property, but not both at the same time.";
58 std::unique_ptr<PointsBatch> batch) {
virtual void Process(std::unique_ptr< PointsBatch > points_batch)=0
const std::unordered_set< std::string > keep_frame_ids_
PointsProcessor *const next_
FlushResult Flush() override
virtual FlushResult Flush()=0
static std::unique_ptr< FrameIdFilteringPointsProcessor > FromDictionary(common::LuaParameterDictionary *dictionary, PointsProcessor *next)
const std::unordered_set< std::string > drop_frame_ids_
FrameIdFilteringPointsProcessor(const std::unordered_set< std::string > &keep_frame_ids, const std::unordered_set< std::string > &drop_frame_ids, PointsProcessor *next)
std::unique_ptr< LuaParameterDictionary > GetDictionary(const std::string &key)
bool HasKey(const std::string &key) const
void Process(std::unique_ptr< PointsBatch > batch) override