17#include "ns3/callback.h"
20#include "ns3/q2ns-types.h"
24#include <unordered_map>
81 void AddRoute(uint32_t dstNodeId, uint32_t oif);
98 bool Send(std::shared_ptr<Qubit> q, uint32_t dstNodeId);
Internal helper owned by QNode for node-local quantum networking.
const std::vector< ns3::Ptr< QNetDevice > > & GetInterfaces() const
Get the registered outgoing interfaces.
void AddRoute(uint32_t dstNodeId, uint32_t oif)
Add or replace a host route for a destination node.
void SetRecvCallback(RecvCallback cb)
Set the application-level receive callback.
std::vector< ns3::Ptr< QNetDevice > > m_ifaces
Outgoing interfaces by index.
bool Send(std::shared_ptr< Qubit > q, uint32_t dstNodeId)
Send a local qubit toward a destination node.
QNode & owner_
Owning node.
RecvCallback recvCallback_
Application-level receive callback.
uint32_t AddInterface(ns3::Ptr< ns3::NetDevice > dev)
Register a quantum device as an outgoing interface. Analogue of Ipv4L3Protocol::AddInterface(dev).
void ReceiveFromDevice(std::shared_ptr< Qubit > q, const QMapInstance &map)
Handle a qubit delivered from a channel.
std::unordered_map< uint32_t, uint32_t > m_hostRoutes
Host routes: dst node id to oif.
Main user-facing per-node API for quantum operations and transmission.
ns3::Callback< void, std::shared_ptr< Qubit > > RecvCallback
Callback invoked when a qubit is successfully received at a node.
std::function< void(QNode &, std::shared_ptr< Qubit > &)> QMapInstance
Per-transmission quantum map callable applied to a received qubit.