maliput
ManualPhaseProvider Class Reference

Detailed Description

A concrete implementation of the api::rules::PhaseProvider abstract interface that allows the current phase to be manually set.

#include <include/maliput/base/manual_phase_provider.h>

Inheritance diagram for ManualPhaseProvider:
[legend]

Public Member Functions

 MALIPUT_NO_COPY_NO_MOVE_NO_ASSIGN (ManualPhaseProvider)
 
 ManualPhaseProvider ()
 
 ~ManualPhaseProvider () override
 
void AddPhaseRing (const api::rules::PhaseRing::Id &id, const api::rules::Phase::Id &initial_phase, const std::optional< api::rules::Phase::Id > &initial_next_phase=std::nullopt, const std::optional< double > &initial_duration_until=std::nullopt)
 Adds a phase ring to this provider. More...
 
void SetPhase (const api::rules::PhaseRing::Id &id, const api::rules::Phase::Id &phase, const std::optional< api::rules::Phase::Id > &next_phase=std::nullopt, const std::optional< double > &duration_until=std::nullopt)
 Sets the current phase of a PhaseRing. More...
 
- Public Member Functions inherited from PhaseProvider
 MALIPUT_NO_COPY_NO_MOVE_NO_ASSIGN (PhaseProvider)
 
virtual ~PhaseProvider ()=default
 
std::optional< ResultGetPhase (const PhaseRing::Id &id) const
 Gets the phase within a specified PhaseRing. More...
 

Static Public Member Functions

static std::unique_ptr< ManualPhaseProviderGetDefaultPopulatedManualPhaseProvider (const maliput::api::rules::PhaseRingBook *phase_ring_book)
 Constructs a ManualPhaseProvider populated from a given PhaseRingBook. More...
 

Additional Inherited Members

- Public Types inherited from PhaseProvider
using Result = StateProviderResult< Phase::Id >
 Result returned by GetPhase(). More...
 
- Protected Member Functions inherited from PhaseProvider
 PhaseProvider ()=default
 

Constructor & Destructor Documentation

◆ ManualPhaseProvider()

◆ ~ManualPhaseProvider()

~ManualPhaseProvider ( )
overridedefault

Member Function Documentation

◆ AddPhaseRing()

void AddPhaseRing ( const api::rules::PhaseRing::Id id,
const api::rules::Phase::Id initial_phase,
const std::optional< api::rules::Phase::Id > &  initial_next_phase = std::nullopt,
const std::optional< double > &  initial_duration_until = std::nullopt 
)

Adds a phase ring to this provider.

Exceptions
std::exceptionif a PhaseRing with an ID of id already exists in this provider, or if initial_duration_until is defined when next_phase is undefined

◆ GetDefaultPopulatedManualPhaseProvider()

std::unique_ptr< ManualPhaseProvider > GetDefaultPopulatedManualPhaseProvider ( const maliput::api::rules::PhaseRingBook phase_ring_book)
static

Constructs a ManualPhaseProvider populated from a given PhaseRingBook.

The initial phase for each ring is the arbitrarily chosen.

Parameters
phase_ring_bookThe PhaseRingBook to use.
Exceptions
maliput::common::assertion_errorWhen phase_ring_book is nullptr.

◆ MALIPUT_NO_COPY_NO_MOVE_NO_ASSIGN()

MALIPUT_NO_COPY_NO_MOVE_NO_ASSIGN ( ManualPhaseProvider  )

◆ SetPhase()

void SetPhase ( const api::rules::PhaseRing::Id id,
const api::rules::Phase::Id phase,
const std::optional< api::rules::Phase::Id > &  next_phase = std::nullopt,
const std::optional< double > &  duration_until = std::nullopt 
)

Sets the current phase of a PhaseRing.

Exceptions
std::exceptionif no PhaseRing with ID id exists in this provider, or if duration_until is defined when next_phase is undefined.

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