DiscreteValueRule Class Reference

Detailed Description

Describes a discrete value rule.

DiscreteValues are defined by a string value. Semantics of this rule are based on all possible values that this Rule::TypeId could have (as specified by RuleRegistry::FindRuleByType()), not only the subset of values that a specific instance of this rule can be in.

#include <include/maliput/api/rules/discrete_value_rule.h>

Inheritance diagram for DiscreteValueRule:


struct  DiscreteValue
 Defines a discrete value for a DiscreteValueRule. More...

Public Member Functions

 DiscreteValueRule (const Rule::Id &id, const Rule::TypeId &type_id, const LaneSRoute &zone, const std::vector< DiscreteValue > &values)
 Constructs a DiscreteValueRule. More...
const std::vector< DiscreteValue > & states () const
- Public Member Functions inherited from Rule
 Rule (const Id &id, const TypeId &type_id, const LaneSRoute &zone)
 Constructs a Rule. More...
virtual ~Rule ()=default
const Idid () const
const TypeIdtype_id () const
const LaneSRoutezone () const

Additional Inherited Members

- Public Types inherited from Rule
using Id = TypeSpecificIdentifier< class Rule >
 Alias for the Rule's unique ID across all Rule types. More...
using TypeId = TypeSpecificIdentifier< class Type >
 Alias for the Rule's type. More...
using RelatedRules = std::map< std::string, std::vector< Id > >
 Alias of a map holding groups of related rules. More...
using RelatedUniqueIds = std::map< std::string, std::vector< UniqueId > >
 Alias of a map holding groups of related unique ids. More...
- Protected Member Functions inherited from Rule
void ValidateRelatedRules (const RelatedRules &related_rules) const
void ValidateRelatedUniqueIds (const RelatedUniqueIds &related_unique_ids) const
void ValidateSeverity (int severity) const

Constructor & Destructor Documentation

◆ DiscreteValueRule()

DiscreteValueRule ( const Rule::Id id,
const Rule::TypeId type_id,
const LaneSRoute zone,
const std::vector< DiscreteValue > &  values 

Constructs a DiscreteValueRule.

idThe Rule ID.
type_idThe Rule Type ID.
zoneLaneSRoute to which this rule applies.
valuesA vector of possible discrete values that this Rule could be in. The actual value that's enforced at any given time is determined by a DiscreteValueRuleStateProvider. It must have at least one value; each value must be unique.
maliput::common::assertion_errorWhen values is empty.
maliput::common::assertion_errorWhen there are duplicated values in values.

Member Function Documentation



◆ states()

const std::vector<DiscreteValue>& states ( ) const

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