SourceXtractorPlusPlus  0.10
Please provide a description of the project.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AttractorsPartitionConfig.cpp
Go to the documentation of this file.
1 
17 /*
18  * @file AttractorsPartitionConfig.cpp
19  * @author nikoapos
20  */
21 
25 
27 
28 using namespace Euclid::Configuration;
29 namespace po = boost::program_options;
30 
31 namespace SourceXtractor {
32 
33 static const std::string USE_ATTRACTORS_PARTITION {"use-attractors-partition"};
34 
35 AttractorsPartitionConfig::AttractorsPartitionConfig(long manager_id) : Configuration(manager_id) {
36  declareDependency<PartitionStepConfig>();
37  ConfigManager::getInstance(manager_id).registerDependency<AttractorsPartitionConfig, MinAreaPartitionConfig>();
38 
39 }
40 
42  return { {"Extraction", {
43  {USE_ATTRACTORS_PARTITION.c_str(), po::bool_switch(),
44  "Enables the use of attractors for partitioning"}
45  }}};
46 }
47 
48 void AttractorsPartitionConfig::initialize(const UserValues& args) {
49  if (args.at(USE_ATTRACTORS_PARTITION).as<bool>()) {
50  getDependency<PartitionStepConfig>().addPartitionStepCreator(
51  [](std::shared_ptr<SourceFactory> source_factory) {
52  return std::make_shared<AttractorsPartitionStep>(source_factory);
53  }
54  );
55  }
56 }
57 
58 } // SourceXtractor namespace
void initialize(const UserValues &args) override
STL class.
STL class.
static const std::string USE_ATTRACTORS_PARTITION
T c_str(T...args)
std::map< std::string, OptionDescriptionList > getProgramOptions() override