Q2NS dev
ns-3 module
Loading...
Searching...
No Matches
q2ns::TeleportationApp Class Referencefinal

#include <q2ns-teleportation-app.h>

Inheritance diagram for q2ns::TeleportationApp:
Collaboration diagram for q2ns::TeleportationApp:

Public Member Functions

 TeleportationApp ()
 
 ~TeleportationApp () override=default
 
void StartApplication () override
 
void StopApplication () override
 
void SetNetController (NetController *nc)
 
void SetTeleportState (const std::shared_ptr< QState > &state)
 

Static Public Member Functions

static ns3::TypeId GetTypeId ()
 

Public Attributes

ns3::TracedCallback< uint64_t, ns3::Time > m_traceSourceStart
 
ns3::TracedCallback< uint64_t, ns3::Time > m_traceSourceBellDone
 
ns3::TracedCallback< uint64_t, ns3::Time > m_traceSourceCtrlSent
 
ns3::TracedCallback< uint64_t, ns3::Time > m_traceSinkStart
 
ns3::TracedCallback< uint64_t, ns3::Time > m_traceSinkQArrive
 
ns3::TracedCallback< uint64_t, ns3::Time > m_traceSinkCtrlArrive
 
ns3::TracedCallback< uint64_t, ns3::Time > m_traceSinkCorrection
 

Private Member Functions

void DoSourceStart ()
 
void DoSinkStart ()
 
void OnTcpConnectSuccess (ns3::Ptr< ns3::Socket > s)
 
void OnTcpConnectFail (ns3::Ptr< ns3::Socket > s)
 
void QubitArrivalHandler (std::shared_ptr< Qubit > q)
 
void OnCtrlRx (ns3::Ptr< const ns3::Packet > pkt, const ns3::Address &from)
 
void SendCtrlBits (uint8_t m1, uint8_t m2)
 
void TryApplyCorrection ()
 

Private Attributes

std::string m_role
 
ns3::Ptr< q2ns::QNodem_peerQNode
 
std::shared_ptr< QStatem_teleportState
 
ns3::Ipv4Address m_peer
 
uint16_t m_ctrlPort {7000}
 
std::string m_ctrlProto
 
std::string m_backend
 
std::string m_targetQubitTag
 
uint64_t m_sessionId {0}
 
ns3::Time m_sessionStart {ns3::Seconds(0.0)}
 
q2ns::NetControllerm_nc {nullptr}
 
ns3::Ptr< ns3::Packet > m_pendingCtrlPkt
 
ns3::Ptr< ns3::PacketSink > m_ctrlSink
 
ns3::Ptr< ns3::Application > m_ctrlSender
 
bool m_haveCtrl {false}
 
bool m_haveQ {false}
 
uint8_t m_m1 {0}
 
uint8_t m_m2 {0}
 

Detailed Description

Definition at line 40 of file q2ns-teleportation-app.h.

Constructor & Destructor Documentation

◆ TeleportationApp()

q2ns::TeleportationApp::TeleportationApp ( )
default

◆ ~TeleportationApp()

q2ns::TeleportationApp::~TeleportationApp ( )
overridedefault

Member Function Documentation

◆ DoSinkStart()

void q2ns::TeleportationApp::DoSinkStart ( )
private

Definition at line 222 of file q2ns-teleportation-app.cc.

References m_ctrlPort, m_ctrlProto, m_ctrlSink, m_sessionId, m_traceSinkStart, OnCtrlRx(), and QubitArrivalHandler().

Referenced by StartApplication().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DoSourceStart()

void q2ns::TeleportationApp::DoSourceStart ( )
private

Definition at line 182 of file q2ns-teleportation-app.cc.

References m1, m2, m_peerQNode, m_sessionId, m_targetQubitTag, m_teleportState, m_traceSourceBellDone, m_traceSourceStart, and SendCtrlBits().

Referenced by StartApplication().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetTypeId()

◆ OnCtrlRx()

void q2ns::TeleportationApp::OnCtrlRx ( ns3::Ptr< const ns3::Packet >  pkt,
const ns3::Address &  from 
)
private

Definition at line 316 of file q2ns-teleportation-app.cc.

References m_haveCtrl, m_m1, m_m2, m_sessionId, m_traceSinkCtrlArrive, and TryApplyCorrection().

Referenced by DoSinkStart().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnTcpConnectFail()

void q2ns::TeleportationApp::OnTcpConnectFail ( ns3::Ptr< ns3::Socket >  s)
private

Definition at line 258 of file q2ns-teleportation-app.cc.

Referenced by SendCtrlBits().

Here is the caller graph for this function:

◆ OnTcpConnectSuccess()

void q2ns::TeleportationApp::OnTcpConnectSuccess ( ns3::Ptr< ns3::Socket >  s)
private

Definition at line 250 of file q2ns-teleportation-app.cc.

References m_pendingCtrlPkt.

Referenced by SendCtrlBits().

Here is the caller graph for this function:

◆ QubitArrivalHandler()

void q2ns::TeleportationApp::QubitArrivalHandler ( std::shared_ptr< Qubit q)
private

Definition at line 306 of file q2ns-teleportation-app.cc.

References m_haveQ, m_sessionId, m_traceSinkQArrive, and TryApplyCorrection().

Referenced by DoSinkStart().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SendCtrlBits()

void q2ns::TeleportationApp::SendCtrlBits ( uint8_t  m1,
uint8_t  m2 
)
private

Definition at line 264 of file q2ns-teleportation-app.cc.

References m1, m2, m_ctrlPort, m_ctrlProto, m_peer, m_pendingCtrlPkt, m_sessionId, m_traceSourceCtrlSent, OnTcpConnectFail(), and OnTcpConnectSuccess().

Referenced by DoSourceStart().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetNetController()

void q2ns::TeleportationApp::SetNetController ( NetController nc)

Definition at line 136 of file q2ns-teleportation-app.cc.

References m_nc.

◆ SetTeleportState()

void q2ns::TeleportationApp::SetTeleportState ( const std::shared_ptr< QState > &  state)

Definition at line 140 of file q2ns-teleportation-app.cc.

References m_teleportState.

◆ StartApplication()

void q2ns::TeleportationApp::StartApplication ( )
override

Definition at line 147 of file q2ns-teleportation-app.cc.

References DoSinkStart(), DoSourceStart(), m_role, m_sessionId, m_sessionStart, and m_targetQubitTag.

Here is the call graph for this function:

◆ StopApplication()

void q2ns::TeleportationApp::StopApplication ( )
override

Definition at line 173 of file q2ns-teleportation-app.cc.

References m_ctrlSender, and m_ctrlSink.

◆ TryApplyCorrection()

void q2ns::TeleportationApp::TryApplyCorrection ( )
private

Definition at line 338 of file q2ns-teleportation-app.cc.

References m_haveCtrl, m_haveQ, m_m1, m_m2, m_sessionId, m_targetQubitTag, m_traceSinkCorrection, q2ns::gates::X(), and q2ns::gates::Z().

Referenced by OnCtrlRx(), and QubitArrivalHandler().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ m_backend

std::string q2ns::TeleportationApp::m_backend
private

Definition at line 76 of file q2ns-teleportation-app.h.

Referenced by GetTypeId().

◆ m_ctrlPort

uint16_t q2ns::TeleportationApp::m_ctrlPort {7000}
private

Definition at line 74 of file q2ns-teleportation-app.h.

Referenced by DoSinkStart(), GetTypeId(), and SendCtrlBits().

◆ m_ctrlProto

std::string q2ns::TeleportationApp::m_ctrlProto
private

Definition at line 75 of file q2ns-teleportation-app.h.

Referenced by DoSinkStart(), GetTypeId(), and SendCtrlBits().

◆ m_ctrlSender

ns3::Ptr<ns3::Application> q2ns::TeleportationApp::m_ctrlSender
private

Definition at line 84 of file q2ns-teleportation-app.h.

Referenced by StopApplication().

◆ m_ctrlSink

ns3::Ptr<ns3::PacketSink> q2ns::TeleportationApp::m_ctrlSink
private

Definition at line 83 of file q2ns-teleportation-app.h.

Referenced by DoSinkStart(), and StopApplication().

◆ m_haveCtrl

bool q2ns::TeleportationApp::m_haveCtrl {false}
private

Definition at line 99 of file q2ns-teleportation-app.h.

Referenced by OnCtrlRx(), and TryApplyCorrection().

◆ m_haveQ

bool q2ns::TeleportationApp::m_haveQ {false}
private

Definition at line 100 of file q2ns-teleportation-app.h.

Referenced by QubitArrivalHandler(), and TryApplyCorrection().

◆ m_m1

uint8_t q2ns::TeleportationApp::m_m1 {0}
private

Definition at line 101 of file q2ns-teleportation-app.h.

Referenced by OnCtrlRx(), and TryApplyCorrection().

◆ m_m2

uint8_t q2ns::TeleportationApp::m_m2 {0}
private

Definition at line 101 of file q2ns-teleportation-app.h.

Referenced by OnCtrlRx(), and TryApplyCorrection().

◆ m_nc

q2ns::NetController* q2ns::TeleportationApp::m_nc {nullptr}
private

Definition at line 81 of file q2ns-teleportation-app.h.

Referenced by SetNetController().

◆ m_peer

ns3::Ipv4Address q2ns::TeleportationApp::m_peer
private

Definition at line 73 of file q2ns-teleportation-app.h.

Referenced by GetTypeId(), and SendCtrlBits().

◆ m_peerQNode

ns3::Ptr<q2ns::QNode> q2ns::TeleportationApp::m_peerQNode
private

Definition at line 71 of file q2ns-teleportation-app.h.

Referenced by DoSourceStart(), and GetTypeId().

◆ m_pendingCtrlPkt

ns3::Ptr<ns3::Packet> q2ns::TeleportationApp::m_pendingCtrlPkt
private

Definition at line 82 of file q2ns-teleportation-app.h.

Referenced by OnTcpConnectSuccess(), and SendCtrlBits().

◆ m_role

std::string q2ns::TeleportationApp::m_role
private

Definition at line 70 of file q2ns-teleportation-app.h.

Referenced by GetTypeId(), and StartApplication().

◆ m_sessionId

uint64_t q2ns::TeleportationApp::m_sessionId {0}
private

◆ m_sessionStart

ns3::Time q2ns::TeleportationApp::m_sessionStart {ns3::Seconds(0.0)}
private

Definition at line 79 of file q2ns-teleportation-app.h.

Referenced by GetTypeId(), and StartApplication().

◆ m_targetQubitTag

std::string q2ns::TeleportationApp::m_targetQubitTag
private

◆ m_teleportState

std::shared_ptr<QState> q2ns::TeleportationApp::m_teleportState
private

Definition at line 72 of file q2ns-teleportation-app.h.

Referenced by DoSourceStart(), and SetTeleportState().

◆ m_traceSinkCorrection

ns3::TracedCallback<uint64_t, ns3::Time> q2ns::TeleportationApp::m_traceSinkCorrection

Definition at line 67 of file q2ns-teleportation-app.h.

Referenced by GetTypeId(), and TryApplyCorrection().

◆ m_traceSinkCtrlArrive

ns3::TracedCallback<uint64_t, ns3::Time> q2ns::TeleportationApp::m_traceSinkCtrlArrive

Definition at line 66 of file q2ns-teleportation-app.h.

Referenced by GetTypeId(), and OnCtrlRx().

◆ m_traceSinkQArrive

ns3::TracedCallback<uint64_t, ns3::Time> q2ns::TeleportationApp::m_traceSinkQArrive

Definition at line 65 of file q2ns-teleportation-app.h.

Referenced by GetTypeId(), and QubitArrivalHandler().

◆ m_traceSinkStart

ns3::TracedCallback<uint64_t, ns3::Time> q2ns::TeleportationApp::m_traceSinkStart

Definition at line 64 of file q2ns-teleportation-app.h.

Referenced by DoSinkStart(), and GetTypeId().

◆ m_traceSourceBellDone

ns3::TracedCallback<uint64_t, ns3::Time> q2ns::TeleportationApp::m_traceSourceBellDone

Definition at line 60 of file q2ns-teleportation-app.h.

Referenced by DoSourceStart(), and GetTypeId().

◆ m_traceSourceCtrlSent

ns3::TracedCallback<uint64_t, ns3::Time> q2ns::TeleportationApp::m_traceSourceCtrlSent

Definition at line 61 of file q2ns-teleportation-app.h.

Referenced by GetTypeId(), and SendCtrlBits().

◆ m_traceSourceStart

ns3::TracedCallback<uint64_t, ns3::Time> q2ns::TeleportationApp::m_traceSourceStart

Definition at line 59 of file q2ns-teleportation-app.h.

Referenced by DoSourceStart(), and GetTypeId().


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