GlobalBpiLib  1.0
ProtocolLogic Class Reference

Default implementation of the logic of a protocol implementation. More...

#include <ProtocolLogic.h>

Collaboration diagram for ProtocolLogic:

Public Member Functions

void start ()
 
void stop ()
 
void portInput (EthernetMessage *input)
 
void controlInput (std::string input)
 
virtual void sendMessage (EthernetMessage *msg, int outPorts)
 

Static Public Member Functions

static void * protoLogicEntry (void *This)
 

Protected Member Functions

void _runProtoLogic ()
 
void _initializeProtocol ()
 
void _sendMessage (EthernetMessage *msg, int outPorts)
 
virtual Port_createPort (int i)
 
virtual void _executeProtocolLogic ()
 
virtual void _handleControlMessages ()
 
virtual void _handleControlMessage (std::string cmdId, std::string cmd)
 
virtual void _handleControlMessageFI (std::string cmdId, std::string cmd)
 

Protected Attributes

Port ** ports
 
std::vector< EthernetMessage * > protocol_messages
 
std::deque< std::string > control_messages
 
pthread_t protologic
 
pthread_mutex_t _mutex
 
pthread_cond_t _cond
 
bool run = true
 
BpiOutStream bpiout
 
BpiOutStream bpierr
 
char source_mac [6]
 

Detailed Description

Default implementation of the logic of a protocol implementation.

Member Function Documentation

◆ _sendMessage()

void ProtocolLogic::_sendMessage ( EthernetMessage msg,
int  outPorts 
)
protected

DO NOT CALL THIS FUNCTION! Implementation of the sending routine which shall not be modified or derived from.

DO NOT CALL THIS FUNCTION FOR SENDING MESSAGES!

Adds a message to the egressPorts specified by the binary representation of outPort, i.e. 0<=outPorts = (p3,p2,p1,p0) <=15 where pi=1 indicates to send on port i.

Example: outPorts=0b0101 means to send on port 0 as well as port 2.

◆ sendMessage()

void ProtocolLogic::sendMessage ( EthernetMessage msg,
int  outPorts 
)
virtual

Sends msg (adds msg to the coresponding port queues) via ports specified by the binary representation of the parameter ports.

Adds a message to the egressPorts specified by the binary representation of outPort, i.e. 0<=outPorts = (p3,p2,p1,p0) <=15 where pi=1 indicates to send on port i.

Example: outPorts=0b0101 means to send on port 0 as well as port 2.

Member Data Documentation

◆ bpierr

BpiOutStream ProtocolLogic::bpierr
protected

Error output printer.

◆ bpiout

BpiOutStream ProtocolLogic::bpiout
protected

Standard output printer.


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