Class RegulatoryElementFactory

Class Documentation

class RegulatoryElementFactory

Creates regulatory elements based on their type.

Public Types

using FactoryFcn = std::function<RegulatoryElementPtr(const RegulatoryElementDataPtr&)>

Public Functions

inline void registerStrategy(const std::string &strategy, const FactoryFcn &factoryFunction)

Public Static Functions

static RegulatoryElementPtr create(std::string ruleName, const RegulatoryElementDataPtr &data)

create a regulatory element based on the name of the rule

The factory will make sure that the subtype tag of the returned object matches the ruleName as is required by liblanelet.

Parameters:
Throws:

InvalidInputError – if the object could not be created (e.g. if requisites for the specific type are not met or ruleName does not exist)

Returns:

a matching instance of the regulatory element.

static inline RegulatoryElementPtr create(const std::string &ruleName, Id id, const RuleParameterMap &map, const AttributeMap &attributes = AttributeMap())
static std::vector<std::string> availableRules()

returns regulatory element names that this factory can handle

static RegulatoryElementFactory &instance()