$darkmode
#include <controller.hpp>
Public Member Functions | |
| virtual bool | has_vehicle () const |
| virtual std::shared_ptr< Vehicle > | get_vehicle () const |
| virtual void | set_vehicle (std::shared_ptr< Vehicle > v) |
Public Member Functions inherited from cloe::Model | |
| virtual | ~Model () noexcept=default |
| virtual Duration | resolution () const |
| virtual bool | is_connected () const |
| virtual bool | is_operational () const |
| virtual void | connect () |
| virtual void | disconnect () |
| virtual void | enroll (Registrar &) |
| virtual void | start (const Sync &) |
| virtual Duration | process (const Sync &)=0 |
| virtual void | pause (const Sync &) |
| virtual void | resume (const Sync &) |
| virtual void | stop (const Sync &) |
| virtual void | reset () |
| virtual void | abort () |
| Entity (std::string name) | |
| Entity (std::string name, std::string desc) | |
Public Member Functions inherited from cloe::Entity | |
| Entity (std::string name) | |
| Entity (std::string name, std::string desc) | |
| const std::string & | name () const |
| void | set_name (std::string name) |
| const std::string & | description () const |
| void | set_description (std::string desc) |
Protected Attributes | |
| std::shared_ptr< Vehicle > | veh_ {nullptr} |
Protected Attributes inherited from cloe::Model | |
| bool | connected_ {false} |
| bool | operational_ {false} |
Protected Attributes inherited from cloe::Entity | |
| std::string | name_ |
| std::string | desc_ |
Additional Inherited Members | |
Protected Member Functions inherited from cloe::Entity | |
| virtual Logger | logger () const |
The Controller class serves as an interface which every controller binding should inherit from.
It differs from its base class Model by providing a method to assign a Vehicle to it. Thus, a controller is bound to a single vehicle, which it can use during processing for input and output purposes.
Make sure to implement the following methods from the Model interface:
Duration resolution() constbool is_connected() constbool is_operational() constvoid connect()void disconnect()void enroll(Registrar&)void start(const Sync&)Duration process(const Sync&) = 0void pause(const Sync&)void resume(const Sync&)void stop(const Sync&)void reset()void abort()See the documentation for the Model class for information on when these methods are called in a simulation.
The following methods are specific to the Controller interface:
bool has_vehicle()std::shared_ptr<Vehicle> get_vehicle()void set_vehicle(std::shared_ptr<Vehicle>)
|
inlinevirtual |
Return a pointer to the vehicle that is assigned to the controller.
|
inlinevirtual |
Return whether the controller has a vehicle assigned to it.
This is a prerequisite for the controller to be able to run.
|
inlinevirtual |
Assign a vehicle to the controller.