Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
lanelet::RegulatoryElementFactory Class Reference

Creates regulatory elements based on their type. More...

#include <RegulatoryElement.h>

Public Types

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

Public Member Functions

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

Static Public Member Functions

static std::vector< std::string > availableRules ()
 returns regulatory element names that this factory can handle More...
 
static RegulatoryElementPtr create (const std::string &ruleName, Id id, const RuleParameterMap &map, const AttributeMap &attributes=AttributeMap())
 
static RegulatoryElementPtr create (std::string ruleName, const RegulatoryElementDataPtr &data)
 create a regulatory element based on the name of the rule More...
 
static RegulatoryElementFactoryinstance ()
 

Private Member Functions

 RegulatoryElementFactory ()=default
 

Private Attributes

std::map< std::string, FactoryFcnregistry_
 

Detailed Description

Creates regulatory elements based on their type.

Definition at line 332 of file primitives/RegulatoryElement.h.

Member Typedef Documentation

◆ FactoryFcn

Definition at line 334 of file primitives/RegulatoryElement.h.

Constructor & Destructor Documentation

◆ RegulatoryElementFactory()

lanelet::RegulatoryElementFactory::RegulatoryElementFactory ( )
privatedefault

Member Function Documentation

◆ availableRules()

std::vector< std::string > lanelet::RegulatoryElementFactory::availableRules ( )
static

returns regulatory element names that this factory can handle

Definition at line 127 of file RegulatoryElement.cpp.

◆ create() [1/2]

static RegulatoryElementPtr lanelet::RegulatoryElementFactory::create ( const std::string &  ruleName,
Id  id,
const RuleParameterMap map,
const AttributeMap attributes = AttributeMap() 
)
inlinestatic

Definition at line 353 of file primitives/RegulatoryElement.h.

◆ create() [2/2]

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

create a regulatory element based on the name of the rule

Parameters
ruleNameRuleName of the regulatory element to create. If empty, a GenericRegulatoryElement will be returned.
datathe data with which to create the RegulatoryElement
Exceptions
InvalidInputErrorif 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.

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

Definition at line 114 of file RegulatoryElement.cpp.

◆ instance()

RegulatoryElementFactory & lanelet::RegulatoryElementFactory::instance ( )
static

Definition at line 132 of file RegulatoryElement.cpp.

◆ registerStrategy()

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

Definition at line 335 of file primitives/RegulatoryElement.h.

Member Data Documentation

◆ registry_

std::map<std::string, FactoryFcn> lanelet::RegulatoryElementFactory::registry_
private

Definition at line 365 of file primitives/RegulatoryElement.h.


The documentation for this class was generated from the following files:


lanelet2_core
Author(s): Fabian Poggenhans
autogenerated on Thu Mar 6 2025 03:25:53