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.:
will call the correct Visit
overload.
T | The scalar type, which must be one of the default scalars. |
#include <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... | |
virtual void | VisitDiagram (const Diagram< T > &diagram)=0 |
This method will be called by System<T>::accept() if the System is a Diagram<T>. More... | |
Does not allow copy, move, or assignment | |
SystemVisitor (const SystemVisitor &)=delete | |
SystemVisitor & | operator= (const SystemVisitor &)=delete |
SystemVisitor (SystemVisitor &&)=delete | |
SystemVisitor & | operator= (SystemVisitor &&)=delete |
Protected Member Functions | |
SystemVisitor ()=default | |
|
delete |
|
delete |
|
virtualdefault |
|
protecteddefault |
|
delete |
|
delete |
|
pure virtual |
This method will be called by System<T>::accept() if the System is a Diagram<T>.
|
pure virtual |
This method will be called by System<T>::accept() if the System is not a Diagram<T>.