maliput
SystemVisitor< T > Class Template Referenceabstract

Detailed Description

template<typename T>
class maliput::drake::systems::SystemVisitor< T >

Provides a "Visitor Pattern" for System and Diagram.

Rather than adding more virtual methods to the System base class, or performing a dynamic_cast to test if a System is a Diagram, you may use the visitor pattern enabled by this class, e.g.:

template <typename T>
class MySystemVisitor : public SystemVisitor {
...
}
MySystemVisitor<T> visitor;
system.Accept(visitor);

will call the correct Visit overload.

Note
This method does not recurse through the subsystems of a Diagram, but that is easy to do: just call Diagram::GetSystems() in your visitor and then call Accept on the subsystems.

@tparam_default_scalar

#include <src/maliput/drake/systems/framework/system_visitor.h>

Public Member Functions

virtual ~SystemVisitor ()=default
 
virtual void VisitSystem (const System< T > &system)=0
 This method will be called by System<T>::accept() if the System is not a Diagram<T>. More...
 

Protected Member Functions

 SystemVisitor ()=default
 

Constructor & Destructor Documentation

◆ ~SystemVisitor()

virtual ~SystemVisitor ( )
virtualdefault

◆ SystemVisitor()

SystemVisitor ( )
protecteddefault

Member Function Documentation

◆ VisitSystem()

virtual void VisitSystem ( const System< T > &  system)
pure virtual

This method will be called by System<T>::accept() if the System is not a Diagram<T>.


The documentation for this class was generated from the following file:
maliput::drake::systems::SystemVisitor::SystemVisitor
SystemVisitor()=default