10 #ifndef DDSegmentation_SEGMENTATIONFACTORY_H_
11 #define DDSegmentation_SEGMENTATIONFACTORY_H_
20 namespace DDSegmentation {
24 class SegmentationCreatorBase;
56 Segmentation*
create(
const std::string& name,
const std::string& identifier =
"")
const;
virtual ~SegmentationCreator()
Destructor.
SegmentationFactory(const SegmentationFactory &)
Copy constructor.
static SegmentationFactory * _instance
The global factory instance.
Segmentation * create(const std::string &name, const std::string &identifier="") const
Create a new segmentation object with the given type name. Returns NULL if type name is unknown...
Base class for the SegmentationCreator objects. Allows to use the factory without template...
virtual ~SegmentationCreatorBase()
Destructor.
SegmentationCreatorBase(const std::string &name)
Default constructor. Takes the class name as argument and takes care of registration with the factory...
Factory for creating segmentation objects by type name.
SegmentationFactory()
Default constructor.
void registerSegmentation(const std::string &name, SegmentationCreatorBase *creator)
Registers a new SegmentationCreator with the factory.
Segmentation * create(const std::string &identifier) const
Create a new object of the given type.
virtual ~SegmentationFactory()
Destructor.
Base class for all segmentations.
Concrete class to create segmentation objects. Every segmentation needs to instantiate a static insta...
std::map< std::string, SegmentationCreatorBase * > _segmentations
Map to store SegmentationCreators by name.
virtual Segmentation * create(const std::string &identifier) const =0
Create a new object.
std::vector< std::string > registeredSegmentations() const
Access to the list of registered segmentations.
static SegmentationFactory * instance()
Access to the global factory instance.