D2dBinder Class Reference

Simu5G: D2dBinder Class Reference
Simu5G

#include <D2dBinder.h>

Public Member Functions

virtual void registerD2dPhy (MacNodeId nodeId, PhyBase *phy)
virtual PhyBase * getD2dPhy (MacNodeId nodeId)
virtual bool checkD2DCapability (MacNodeId src, MacNodeId dst)
virtual bool getD2DCapability (MacNodeId src, MacNodeId dst)
virtual LteD2DMode getD2DMode (MacNodeId src, MacNodeId dst)
const std::map< MacNodeId, std::map< MacNodeId, LteD2DMode > > & getD2DPeeringModeMap () const
virtual void setD2DMode (MacNodeId src, MacNodeId dst, LteD2DMode mode)

Protected Member Functions

void receiveSignal (cComponent *source, simsignal_t signalID, long nodeId, cObject *details) override

Detailed Description

Global holder of the D2D-specific network state, split out of the core Binder.

It keeps the D2D peering map (which pairs of D2D-capable UEs communicate in Direct Mode or Infrastructure Mode) and the set of D2D one-to-many transmitters, and answers the D2D capability/mode queries derived from them.

Networks with D2D-capable nodes declare one instance next to the Binder; the D2D modules reach it through their d2dBinderModule parameter.

This module has no events, no emitted signals and no statistics: it is a passive state container. It does listen to the Binder's node-unregistered notification, to drop the state of nodes that leave mid-simulation.

Member Function Documentation

◆ receiveSignal()

void receiveSignal ( cComponent * source,
simsignal_t signalID,
long nodeId,
cObject * details )
overrideprotected

Binder::nodeUnregisteredSignal_: forget the node that has just left the simulation. Both maps are keyed by node id, and the peering map holds the id inside every other UE's map as well; a departed id left behind is later handed to getD2DCapability(), which asserts that both of its arguments are registered UEs.

◆ registerD2dPhy()

virtual void registerD2dPhy ( MacNodeId nodeId,
PhyBase * phy )
virtual

Registers a D2D-capable UE PHY under its node id. Called by the PHY at INITSTAGE_SIMU5G_BINDER_ACCESS, so that the one-to-many transmit path can resolve a peer PHY by id instead of walking submodule names.

◆ getD2dPhy()

virtual PhyBase * getD2dPhy ( MacNodeId nodeId)
virtual

Returns the registered D2D UE PHY of the given node, or nullptr if that node has no D2D-capable PHY.

◆ checkD2DCapability()

virtual bool checkD2DCapability ( MacNodeId src,
MacNodeId dst )
virtual

If the src->dst peering is not yet known, computes and records it; returns whether src may transmit to dst using D2D (either DM or IM).

◆ getD2DCapability()

virtual bool getD2DCapability ( MacNodeId src,
MacNodeId dst )
virtual

Returns whether a (non-NONE) D2D peering has already been recorded for src->dst.

◆ getD2DMode()

virtual LteD2DMode getD2DMode ( MacNodeId src,
MacNodeId dst )
virtual

Returns the current D2D mode (DM or IM) of the src->dst peering; throws if no peering is recorded.

◆ getD2DPeeringModeMap()

const std::map< MacNodeId, std::map< MacNodeId, LteD2DMode > > & getD2DPeeringModeMap ( ) const
inline

Read-only access to the whole peering map, for the mode-selection and conflict-graph modules to iterate over.

◆ setD2DMode()

virtual void setD2DMode ( MacNodeId src,
MacNodeId dst,
LteD2DMode mode )
virtual

Sets the D2D mode of the src->dst peering (used by the mode-selection modules to apply a computed switch).