KENSv3
KAIST Educational Network System
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
E::System Class Reference

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>

Inheritance diagram for E::System:
E::Log E::NetworkSystem

Public Member Functions

 System ()
 Nothing is needed to construct a System.
 
void run (Time till)
 Execute all registered Module. Virtual clock will move to the end of the simulation. More...
 
Time getCurrentTime ()
 
virtual void addRunnable (std::shared_ptr< Runnable > runnable) final
 Register a Runnable interface to this System. More...
 
virtual void delRunnable (std::shared_ptr< Runnable > runnable) final
 Unregister a Runnable interface to this System. More...
 
template<typename T , typename... Args>
std::shared_ptr< T > addModule (Args &&...args)
 
std::string getModuleName (const ModuleID moduleID)
 
friend Module::Module (System &system)
 

Protected Member Functions

ModuleID lookupModuleID (Module &module)
 

Protected Attributes

std::unordered_map< ModuleID, std::shared_ptr< Module > > registeredModule
 

Friends

UUID Module::sendMessage (const ModuleID to, Module::Message message, Time timeAfter)
 
bool Module::cancelMessage (UUID timer)
 

Detailed Description

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

Member Function Documentation

◆ addRunnable()

void E::System::addRunnable ( std::shared_ptr< Runnable runnable)
finalvirtual

Register a Runnable interface to this System.

Parameters
runnableRunnable interface to be added.
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
runnableRunnable 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
tillThe 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: