Simo 0.0.1
Loading...
Searching...
No Matches
Simo::Module Class Reference

#include <Module.h>

Inheritance diagram for Simo::Module:
FailingInitModule InitTrackingModule PingModule PongModule Simo::Modules::Core::Collector TestModule

Public Member Functions

virtual InitializationStatus initialize (Context &sim_ctx_v, const Parameters &parameters)
std::string_view name () const
Contextsim_ctx () const
void record_statistics (Statistics::StatMapper &mapper)
 Record a statistic in a StatMapper to dump statistics.
Portget_port (std::string_view)
template<typename Stat>
Stat * get_statistic (const std::string_view name)
template<typename Function>
void visit_statistics (Function f)

Protected Member Functions

template<typename T, typename... Args>
T & create_statistic (Args... args)
 Create a new statistic of type T.
template<typename T, typename... Args>
T & create_port (const std::string_view name, Args... args)
 Create a new port of type T.

Protected Attributes

Statistics::StatStorage statistics
std::unordered_map< std::string, std::unique_ptr< Port > > ports

Detailed Description

A simulation unit that can schedule events in the context

Every class that inherits from module shall have a default constructor (possibly trivial) and initialize everything in the initialize method.

Member Function Documentation

◆ initialize()

InitializationStatus Simo::Module::initialize ( Context & sim_ctx_v,
const Parameters & parameters )
nodiscardvirtual

Associate a context to this instance and look at the parameters to initialize the structure. The default implementation is to return true. Derived classes can call <base_class>::initialize to initialize the attributes of the base class

Reimplemented in FailingInitModule, InitTrackingModule, PingModule, PongModule, Simo::Modules::Core::Collector, and TestModule.


The documentation for this class was generated from the following files:
  • include/Simo/module/Module.h
  • src/module/Module.cc