System provides a virtual clock used during the simulation. Current virtual clock can be obtained by System::getCurrentTime. Every Module registered in the System share same virtual clock and the System manages the total ordering of every event.
More...
#include <E_System.hpp>
|
ModuleID | lookupModuleID (Module &module) |
|
|
std::unordered_map< ModuleID, std::shared_ptr< Module > > | registeredModule |
|
|
UUID | Module::sendMessage (const ModuleID to, Module::Message message, Time timeAfter) |
|
bool | Module::cancelMessage (UUID timer) |
|
System provides a virtual clock used during the simulation. Current virtual clock can be obtained by System::getCurrentTime. Every Module registered in the System share same virtual clock and the System manages the total ordering of every event.
- See also
- System::getCurrentTime
-
Module
◆ addRunnable()
void E::System::addRunnable |
( |
std::shared_ptr< Runnable > |
runnable | ) |
|
|
finalvirtual |
Register a Runnable interface to this System.
- Parameters
-
- Returns
- nothing
- Note
- You cannot override this function.
◆ delRunnable()
void E::System::delRunnable |
( |
std::shared_ptr< Runnable > |
runnable | ) |
|
|
finalvirtual |
Unregister a Runnable interface to this System.
- Parameters
-
runnable | Runnable interface to be removed. The interface must be registered before being removed. |
- Returns
- nothing
- Note
- You cannot override this function.
◆ getCurrentTime()
Time E::System::getCurrentTime |
( |
| ) |
|
- Returns
- Returns current virtual clock of the System.
◆ run()
void E::System::run |
( |
Time |
till | ) |
|
Execute all registered Module. Virtual clock will move to the end of the simulation.
- Parameters
-
till | The System will operate until the given virtual clock. If all events are finished, it will immediately return even if it did not reached to the given termination time. |
The documentation for this class was generated from the following files: