11 namespace DDSegmentation {
34 map<std::string, SegmentationCreatorBase*>::const_iterator it;
37 return it->second->create(identifier);
44 vector<std::string> segmentationNames;
45 map<std::string, SegmentationCreatorBase*>::const_iterator it;
47 segmentationNames.push_back(it->first);
49 return segmentationNames;
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...
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.
Base class for all segmentations.
std::map< std::string, SegmentationCreatorBase * > _segmentations
Map to store SegmentationCreators by name.
std::vector< std::string > registeredSegmentations() const
Access to the list of registered segmentations.
static SegmentationFactory * instance()
Access to the global factory instance.