15 std::vector<char*> processors;
16 std::map<unsigned, char*> config_names;
19 unsigned procindex = 0;
20 while ((c=getopt(argc, argv,
"m:c:")) != -1) {
23 processors.push_back(optarg);
27 config_names[procindex-1] = optarg;
30 if (optopt ==
'c' || optopt ==
'm')
31 fprintf(stderr,
"Option -%c requires an argument.\n", optopt);
32 else if (isprint(optopt))
33 fprintf(stderr,
"Unknown option `-%c'.\n", optopt);
35 fprintf(stderr,
"Unknown option character `\\x%x'.\n", optopt);
42 if (argc - optind < 1) {
43 std::cout <<
"Usage: " << argv[0] <<
" [-m PROCESSOR [-c CONFIG]] "
44 <<
"INPUTDEF [...]" << std::endl;
49 std::string filedef = argv[optind];
50 std::string list_suffix =
".list";
51 std::vector<std::string> filenames;
53 if (
std::equal(list_suffix.rbegin(), list_suffix.rend(), filedef.rbegin())) {
55 std::ifstream infile(filedef);
57 while (infile >> filename) {
58 filenames.push_back(filename);
63 for (
int i=optind; i<argc; i++) {
64 filenames.push_back(argv[i]);
68 assert(!filenames.empty());
71 std::vector<core::ProcessorBase*> procs(processors.size());
72 std::vector<fhicl::ParameterSet*>
configs(processors.size());
74 std::cout <<
"Configuring... " << std::endl;
75 for (
size_t i=0; i<procs.size(); i++) {
82 for (
int i=0; i<procs.size(); i++) {
Struct containing (macro defined) creation/deletion operations.
process_name WireCellLarsoft configs
BEGIN_PROLOG could also be dds filename
export_table * LoadProcessor(char *libname)
ProcessorBase *(* create)(void)
virtual void DeleteProcessors()
bool equal(double a, double b)
Comparison tolerance, in centimeters.
fhicl::ParameterSet * LoadConfig(char *configfile)
virtual void ProcessFiles(std::vector< std::string > filenames)
virtual void AddProcessor(ProcessorBase *processor, fhicl::ParameterSet *config)
BEGIN_PROLOG could also be cout