SourceXtractorPlusPlus  0.10
Please provide a description of the project.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SourceIDTaskFactory.h
Go to the documentation of this file.
1 
17 /*
18  * SourceIDTaskFactory.h
19  *
20  * Created on: May 30, 2018
21  * Author: mschefer
22  */
23 
24 #ifndef _SEIMPLEMENTATION_PLUGIN_SOURCEIDS_SOURCEIDTASKFACTORY_H_
25 #define _SEIMPLEMENTATION_PLUGIN_SOURCEIDS_SOURCEIDTASKFACTORY_H_
26 
27 
30 
31 namespace SourceXtractor {
32 
34 public:
36 
38  virtual ~SourceIDTaskFactory() = default;
39 
40  // TaskFactory implementation
41  virtual std::shared_ptr<Task> createTask(const PropertyId& property_id) const override {
42  if (property_id == PropertyId::create<SourceID>()) {
43  return std::make_shared<SourceIDTask>();
44  } else {
45  return nullptr;
46  }
47  }
48 };
49 
50 }
51 
52 #endif /* _SEIMPLEMENTATION_PLUGIN_SOURCEIDS_SOURCEIDTASKFACTORY_H_ */
Creates a Task for computing a given property.
Definition: TaskFactory.h:42
Identifier used to set and retrieve properties.
Definition: PropertyId.h:40
virtual ~SourceIDTaskFactory()=default
Destructor.
virtual std::shared_ptr< Task > createTask(const PropertyId &property_id) const override
Returns a Task producing a Property corresponding to the given PropertyId.