KENSv3
KAIST Educational Network System
Classes | Public Types | Public Member Functions | List of all members
E::Wire Class Reference

Wire does a role of 2-ended wire. However there is a speed limit and delayed packets are queued (currently, no limitation to the queue length). More...

#include <E_Wire.hpp>

Inheritance diagram for E::Wire:
E::Module E::NetworkLog

Classes

class  Message
 

Public Types

enum  MessageType { PACKET_TO_PORT , PACKET_FROM_PORT }
 
- Public Types inherited from E::Module
using Message = std::unique_ptr< MessageBase >
 

Public Member Functions

 Wire (std::string name, NetworkSystem &system, ModuleID left, ModuleID right, Time propagationDelay=1000000, Size bps=1000000000UL, bool limit_speed=true)
 Create a Wire. More...
 
virtual void setSpeedLimit (bool do_limit) final
 
virtual void setWireSpeed (Size bps) final
 
virtual Size getWireSpeed () final
 
virtual void setPropagationDelay (Time delay) final
 
virtual Time nextSendAvailable (const ModuleID me) final
 
- Public Member Functions inherited from E::Module
 Module (System &system)
 Module must belong to a System. Module is registered to a System when it is created. More...
 
std::string getModuleName ()
 
std::string getModuleName (const ModuleID moduleID)
 
Time getCurrentTime ()
 

Additional Inherited Members

- Protected Types inherited from E::NetworkLog
enum  LOG_LEVEL {
  PACKET_TO_MODULE = 0UL , PACKET_FROM_MODULE , PACKET_TO_HOST , PACKET_FROM_HOST ,
  PACKET_ALLOC , PACKET_CLONE , PACKET_FREE , PACKET_QUEUE ,
  PACKET_DROPPED , SYSCALL_RAISED , SYSCALL_FINISHED , SYSCALL_BLOCKED ,
  SYSCALL_UNBLOCKED , SYSCALL_ERROR , APPLICATION_RETRUN , MODULE_ERROR ,
  PROTOCOL_ERROR , PROTOCOL_WARNING , TCP_LOG , LEVEL_COUNT
}
 Enumerations for log levels.
 
- Protected Member Functions inherited from E::Module
virtual UUID sendMessage (const ModuleID to, Module::Message message, Time timeAfter) final
 Send a Message to other Module. Every message has its own delay before it is actually sent. The System guarantees the total ordering of all delayed messages in the System. More...
 
virtual UUID sendMessageSelf (Module::Message message, Time timeAfter) final
 Send a Message to self Every message has its own delay before it is actually sent. The System guarantees the total ordering of all delayed messages in the System. More...
 
virtual bool cancelMessage (UUID messageID) final
 Cancel the raised Message. If a message is not actually sent yet, you can cancel the message. If the message is already sent, this function has no effect. More...
 
- Protected Member Functions inherited from E::NetworkLog
 NetworkLog (System &system)
 Constructs a NetworkLog instance. More...
 
 NetworkLog (System &system, uint64_t level)
 Constructs a NetworkLog instance with log level. More...
 
 ~NetworkLog ()
 Destructs a NetworkLog instance.
 
void print_log (uint64_t level, const char *format,...)
 Prints log with specified log level and format. NetworkLog::print_log prints logs specified in log level parameter. For example, if log level is set to TCP_LOG, it only prints TCP_LOG logs. If you want to print multiple log levels in NetworkLog, you can set log level with OR operation (i.e. SYSCALL_ERROR | MODULE_ERROR). More...
 
void vprint_log (uint64_t level, const char *format, va_list args)
 Prints log with specified log level and format. NetworkLog::print_log prints logs specified in log level parameter. For example, if log level is set to TCP_LOG, it only prints TCP_LOG logs. If you want to print multiple log levels in NetworkLog, you can set log level with OR operation (i.e. SYSCALL_ERROR | MODULE_ERROR). More...
 
- Static Protected Attributes inherited from E::NetworkLog
static uint64_t defaultLevel
 Default log level. More...
 

Detailed Description

Wire does a role of 2-ended wire. However there is a speed limit and delayed packets are queued (currently, no limitation to the queue length).

Constructor & Destructor Documentation

◆ Wire()

E::Wire::Wire ( std::string  name,
NetworkSystem system,
ModuleID  left,
ModuleID  right,
Time  propagationDelay = 1000000,
Size  bps = 1000000000UL,
bool  limit_speed = true 
)

Create a Wire.

Parameters
nameSee NetworkModule
systemSee NetworkSysetm
leftModule ID for left
rightModule ID for right
propagationDelayPropagation delay in nanoseconds.
bpsLink speed in bit per sec.
limit_speedControl speed limiting functionality.

Member Function Documentation

◆ getWireSpeed()

Size E::Wire::getWireSpeed ( )
finalvirtual
Returns
Get data rate.
Note
You cannot override this function.

◆ setPropagationDelay()

void E::Wire::setPropagationDelay ( Time  delay)
finalvirtual
Parameters
delaySet propagation delay.
Note
You cannot override this function.

◆ setSpeedLimit()

void E::Wire::setSpeedLimit ( bool  do_limit)
finalvirtual
Parameters
do_limitControl speed limiting functionality.
Note
You cannot override this function.

◆ setWireSpeed()

void E::Wire::setWireSpeed ( Size  bps)
finalvirtual
Parameters
bpsSet data rate.
Note
You cannot override this function.

The documentation for this class was generated from the following files: