Skip to content

Commit

Permalink
Pass search arguments via msgpack object for clp-s/clo in package
Browse files Browse the repository at this point in the history
  • Loading branch information
gibber9809 committed May 31, 2024
1 parent c9854b3 commit 81db451
Show file tree
Hide file tree
Showing 7 changed files with 371 additions and 700 deletions.
506 changes: 155 additions & 351 deletions components/core/src/clp/clo/CommandLineArguments.cpp

Large diffs are not rendered by default.

49 changes: 18 additions & 31 deletions components/core/src/clp/clo/CommandLineArguments.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <boost/program_options/option.hpp>
#include <boost/program_options/options_description.hpp>
#include <boost/program_options/variables_map.hpp>
#include <json/single_include/nlohmann/json.hpp>

#include "../../reducer/types.hpp"
#include "../CommandLineArgumentsBase.hpp"
Expand All @@ -19,7 +20,8 @@ class CommandLineArguments : public CommandLineArgumentsBase {
public:
// Types
enum class OutputHandlerType : uint8_t {
Network = 0,
None = 0,
Network,
Reducer,
ResultsCache,
};
Expand Down Expand Up @@ -77,43 +79,28 @@ class CommandLineArguments : public CommandLineArgumentsBase {
private:
// Methods
/**
* Validates output options related to the Network Destination output handler.
* @param options_description
* @param options Vector of options previously parsed by boost::program_options and which may
* contain options that have the unrecognized flag set
* @param parsed_options Returns any parsed options that were newly recognized
* Validates the extended arguments to search passed by the package.
* @param extended_search_arguments
*/
void parse_network_dest_output_handler_options(
boost::program_options::options_description const& options_description,
std::vector<boost::program_options::option> const& options,
boost::program_options::variables_map& parsed_options
);
void parse_extended_search_arguments(nlohmann::json const& extended_search_arguments);

/**
* Validates output options related to the Reducer output handler.
* @param options_description
* @param options Vector of options previously parsed by boost::program_options and which may
* contain options that have the unrecognized flag set
* @param parsed_options Returns any parsed options that were newly recognized
* Validates output options related to the Network Destination output handler.
* @param options
*/
void parse_reducer_output_handler_options(
boost::program_options::options_description const& options_description,
std::vector<boost::program_options::option> const& options,
boost::program_options::variables_map& parsed_options
);
void parse_network_dest_output_handler_options(nlohmann::json const& options);

/**
* Validates output options related to the Results Cache output handler.
* @param options_description
* @param options Vector of options previously parsed by boost::program_options and which may
* contain options that have the unrecognized flag set
* @param parsed_options Returns any parsed options that were newly recognized
* @param options
*/
void parse_results_cache_output_handler_options(nlohmann::json const& options);

/**
* Validates the extended arguments to search passed by the package.
* @param extended_search_arguments
*/
void parse_results_cache_output_handler_options(
boost::program_options::options_description const& options_description,
std::vector<boost::program_options::option> const& options,
boost::program_options::variables_map& parsed_options
);
void parse_extended_aggregation_arguments(nlohmann::json const& extended_aggregation_arguments);

void print_basic_usage() const override;

Expand Down Expand Up @@ -142,7 +129,7 @@ class CommandLineArguments : public CommandLineArgumentsBase {
bool m_do_count_by_time_aggregation{false};
int64_t m_count_by_time_bucket_size{0}; // Milliseconds

OutputHandlerType m_output_handler_type{OutputHandlerType::ResultsCache};
OutputHandlerType m_output_handler_type{OutputHandlerType::None};
};
} // namespace clp::clo

Expand Down
Loading

0 comments on commit 81db451

Please sign in to comment.