|
21 | 21 |
|
22 | 22 | #include <fastdds/dds/log/Log.hpp>
|
23 | 23 |
|
24 |
| -#include "InputFeedProcessor.hpp" |
25 |
| - |
26 | 24 | namespace eprosima {
|
27 | 25 | namespace fastdds {
|
28 | 26 | namespace examples {
|
@@ -50,10 +48,6 @@ class CLIParser
|
50 | 48 | ADDITION,
|
51 | 49 | SUBSTRACTION,
|
52 | 50 | REPRESENTATION_LIMITS,
|
53 |
| - FIBONACCI, |
54 |
| - SUM_ALL, |
55 |
| - ACCUMULATOR, |
56 |
| - FILTER, |
57 | 51 | UNDEFINED
|
58 | 52 | };
|
59 | 53 |
|
@@ -105,30 +99,6 @@ class CLIParser
|
105 | 99 | std::cout << " -r, --representation-limits Computes the representation" << std::endl;
|
106 | 100 | std::cout << " limits of a 32-bit integer" << std::endl;
|
107 | 101 | std::cout << " " << std::endl;
|
108 |
| - std::cout << " -f <num>, --fibonacci <num> Returns a feed of results" << std::endl; |
109 |
| - std::cout << " with the <num> first elements" << |
110 |
| - std::endl; |
111 |
| - std::cout << " of the Fibonacci sequence" << std::endl; |
112 |
| - std::cout << " " << std::endl; |
113 |
| - std::cout << " --sum-all Sum all the values provided" << std::endl; |
114 |
| - std::cout << " in the input feed" << std::endl; |
115 |
| - std::cout << " " << std::endl; |
116 |
| - std::cout << " --accumulator Return a feed of results" << std::endl; |
117 |
| - std::cout << " with the sum of all received" << std::endl; |
118 |
| - std::cout << " values from an input feed" << std::endl; |
119 |
| - std::cout << " " << std::endl; |
120 |
| - std::cout << " --filter <filter_kind> Return a feed of results" << std::endl; |
121 |
| - std::cout << " with the values that match" << std::endl; |
122 |
| - std::cout << " the input filter kind" << std::endl; |
123 |
| - std::cout << " [<filter_kind> = 0, 1, 2]" << std::endl; |
124 |
| - std::cout << " [0 = EVEN," << std::endl; |
125 |
| - std::cout << " 1 = ODD," << std::endl; |
126 |
| - std::cout << " 2 = PRIME]" << std::endl; |
127 |
| - std::cout << " " << std::endl; |
128 |
| - std::cout << " --feed <list> Provide a feed instead of " << std::endl; |
129 |
| - std::cout << " capturing from stdin in the " << std::endl; |
130 |
| - std::cout << " form of <num>,<num>,<num> " << std::endl; |
131 |
| - std::cout << " [default: empty]" << std::endl; |
132 | 102 | std::cout << " --connection-attempts <num> Number of attempts to connect" <<
|
133 | 103 | std::endl;
|
134 | 104 | std::cout << " to a server before failing" << std::endl;
|
@@ -288,104 +258,6 @@ class CLIParser
|
288 | 258 | print_help(EXIT_FAILURE);
|
289 | 259 | }
|
290 | 260 | }
|
291 |
| - else if (arg == "-f" || arg == "--fibonacci") |
292 |
| - { |
293 |
| - if (config.entity == CLIParser::EntityKind::CLIENT) |
294 |
| - { |
295 |
| - if (CLIParser::OperationKind::UNDEFINED != config.operation) |
296 |
| - { |
297 |
| - EPROSIMA_LOG_ERROR(CLI_PARSER, "Only one operation can be selected"); |
298 |
| - print_help(EXIT_FAILURE); |
299 |
| - } |
300 |
| - |
301 |
| - if (++i < argc) |
302 |
| - { |
303 |
| - config.n_results = consume_integer_argument<std::uint32_t>(argv[i], arg); |
304 |
| - } |
305 |
| - else |
306 |
| - { |
307 |
| - EPROSIMA_LOG_ERROR(CLI_PARSER, "missing fibonacci argument"); |
308 |
| - print_help(EXIT_FAILURE); |
309 |
| - } |
310 |
| - |
311 |
| - config.operation = CLIParser::OperationKind::FIBONACCI; |
312 |
| - } |
313 |
| - else |
314 |
| - { |
315 |
| - EPROSIMA_LOG_ERROR(CLI_PARSER, "fibonacci argument is only valid for client entity"); |
316 |
| - print_help(EXIT_FAILURE); |
317 |
| - } |
318 |
| - } |
319 |
| - else if (arg == "--sum-all") |
320 |
| - { |
321 |
| - if (config.entity == CLIParser::EntityKind::CLIENT) |
322 |
| - { |
323 |
| - if (CLIParser::OperationKind::UNDEFINED != config.operation) |
324 |
| - { |
325 |
| - EPROSIMA_LOG_ERROR(CLI_PARSER, "Only one operation can be selected"); |
326 |
| - print_help(EXIT_FAILURE); |
327 |
| - } |
328 |
| - |
329 |
| - config.operation = CLIParser::OperationKind::SUM_ALL; |
330 |
| - } |
331 |
| - else |
332 |
| - { |
333 |
| - EPROSIMA_LOG_ERROR(CLI_PARSER, "sum-all argument is only valid for client entity"); |
334 |
| - print_help(EXIT_FAILURE); |
335 |
| - } |
336 |
| - } |
337 |
| - else if (arg == "--accumulator") |
338 |
| - { |
339 |
| - if (config.entity == CLIParser::EntityKind::CLIENT) |
340 |
| - { |
341 |
| - if (CLIParser::OperationKind::UNDEFINED != config.operation) |
342 |
| - { |
343 |
| - EPROSIMA_LOG_ERROR(CLI_PARSER, "Only one operation can be selected"); |
344 |
| - print_help(EXIT_FAILURE); |
345 |
| - } |
346 |
| - |
347 |
| - config.operation = CLIParser::OperationKind::ACCUMULATOR; |
348 |
| - } |
349 |
| - else |
350 |
| - { |
351 |
| - EPROSIMA_LOG_ERROR(CLI_PARSER, "accumulator argument is only valid for client entity"); |
352 |
| - print_help(EXIT_FAILURE); |
353 |
| - } |
354 |
| - } |
355 |
| - else if (arg == "--filter") |
356 |
| - { |
357 |
| - if (config.entity == CLIParser::EntityKind::CLIENT) |
358 |
| - { |
359 |
| - if (CLIParser::OperationKind::UNDEFINED != config.operation) |
360 |
| - { |
361 |
| - EPROSIMA_LOG_ERROR(CLI_PARSER, "Only one operation can be selected"); |
362 |
| - print_help(EXIT_FAILURE); |
363 |
| - } |
364 |
| - |
365 |
| - if (++i < argc) |
366 |
| - { |
367 |
| - config.filter_kind = consume_integer_argument<std::uint8_t>(argv[i], arg); |
368 |
| - |
369 |
| - if (config.filter_kind > 2) |
370 |
| - { |
371 |
| - EPROSIMA_LOG_ERROR(CLI_PARSER, "filter kind must be 0, 1 or 2"); |
372 |
| - print_help(EXIT_FAILURE); |
373 |
| - } |
374 |
| - } |
375 |
| - else |
376 |
| - { |
377 |
| - EPROSIMA_LOG_ERROR(CLI_PARSER, "missing filter argument"); |
378 |
| - print_help(EXIT_FAILURE); |
379 |
| - } |
380 |
| - |
381 |
| - config.operation = CLIParser::OperationKind::FILTER; |
382 |
| - } |
383 |
| - else |
384 |
| - { |
385 |
| - EPROSIMA_LOG_ERROR(CLI_PARSER, "filter argument is only valid for client entity"); |
386 |
| - print_help(EXIT_FAILURE); |
387 |
| - } |
388 |
| - } |
389 | 261 | else if (arg == "--connection-attempts")
|
390 | 262 | {
|
391 | 263 | if (config.entity == CLIParser::EntityKind::CLIENT)
|
@@ -470,27 +342,6 @@ class CLIParser
|
470 | 342 | print_help(EXIT_FAILURE);
|
471 | 343 | }
|
472 | 344 | }
|
473 |
| - else if (arg == "--feed") |
474 |
| - { |
475 |
| - if (++i < argc) |
476 |
| - { |
477 |
| - if (config.entity == CLIParser::EntityKind::CLIENT) |
478 |
| - { |
479 |
| - // Error handling for reading in performed in InputFeedProcessor |
480 |
| - InputFeedProcessor::provided_input_feed.reset(new std::stringstream(argv[i])); |
481 |
| - } |
482 |
| - else |
483 |
| - { |
484 |
| - EPROSIMA_LOG_ERROR(CLI_PARSER, "--feed argument is only valid for client entity"); |
485 |
| - print_help(EXIT_FAILURE); |
486 |
| - } |
487 |
| - } |
488 |
| - else |
489 |
| - { |
490 |
| - EPROSIMA_LOG_ERROR(CLI_PARSER, "parsing feed argument"); |
491 |
| - print_help(EXIT_FAILURE); |
492 |
| - } |
493 |
| - } |
494 | 345 | else
|
495 | 346 | {
|
496 | 347 | EPROSIMA_LOG_ERROR(CLI_PARSER, "unknown option " + arg);
|
|
0 commit comments