A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ns3::QKDControlContainer Class Reference

holds a vector of std::pair of Ptr<QKDControl> and interface index. More...

#include "qkd-control-container.h"

+ Collaboration diagram for ns3::QKDControlContainer:

Public Types

typedef std::vector< std::pair< Ptr< QKDControl >, uint32_t > >::const_iterator Iterator
 Container Const Iterator for pairs of QKDControl smart pointer / Interface Index.
 

Public Member Functions

 QKDControlContainer ()
 Create an empty QKDControlContainer.
 
void Add (const QKDControlContainer &other)
 Concatenate the entries in the other container with ours.
 
void Add (Ptr< QKDControl >, uint32_t ipInterfacePair)
 Manually add an entry to the container consisting of a previously composed entry std::pair.
 
void Add (std::pair< Ptr< QKDControl >, uint32_t > ipInterfacePair)
 Manually add an entry to the container consisting of a previously composed entry std::pair.
 
Iterator Begin () const
 Get an iterator which refers to the first pair in the container.
 
Iterator End () const
 Get an iterator which indicates past-the-last Node in the container.
 
std::pair< Ptr< QKDControl >, uint32_tGet (uint32_t i) const
 Get the std::pair of an Ptr<QKDControl> and interface stored at the location specified by the index.
 
uint32_t GetN () const
 

Private Types

typedef std::vector< std::pair< Ptr< QKDControl >, uint32_t > > InterfaceVector
 Container for pairs of QKDControl smart pointer / Interface Index.
 

Private Attributes

InterfaceVector m_list
 List of QKD Encryptors and interfaces index.
 

Detailed Description

holds a vector of std::pair of Ptr<QKDControl> and interface index.

Typically ns-3 QKDControls are installed on nodes using an QKD helper.

See also
QKDControl

Definition at line 30 of file qkd-control-container.h.

Member Typedef Documentation

◆ InterfaceVector

Container for pairs of QKDControl smart pointer / Interface Index.

Definition at line 146 of file qkd-control-container.h.

◆ Iterator

typedef std::vector<std::pair<Ptr<QKDControl>,uint32_t>>::const_iterator ns3::QKDControlContainer::Iterator

Container Const Iterator for pairs of QKDControl smart pointer / Interface Index.

Definition at line 36 of file qkd-control-container.h.

Constructor & Destructor Documentation

◆ QKDControlContainer()

ns3::QKDControlContainer::QKDControlContainer ( )

Create an empty QKDControlContainer.

Definition at line 17 of file qkd-control-container.cc.

Member Function Documentation

◆ Add() [1/3]

void ns3::QKDControlContainer::Add ( const QKDControlContainer other)

Concatenate the entries in the other container with ours.

Parameters
othercontainer

Definition at line 22 of file qkd-control-container.cc.

References ns3::Create(), and m_list.

Referenced by Add().

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

◆ Add() [2/3]

void ns3::QKDControlContainer::Add ( Ptr< QKDControl qkde,
uint32_t  ipInterfacePair 
)

Manually add an entry to the container consisting of a previously composed entry std::pair.

Parameters
ipInterfacePairthe pair of a pointer to Ipv4 object and interface index of the Ipv4Interface to add to the container

Definition at line 49 of file qkd-control-container.cc.

References ns3::Create(), and m_list.

+ Here is the call graph for this function:

◆ Add() [3/3]

void ns3::QKDControlContainer::Add ( std::pair< Ptr< QKDControl >, uint32_t ipInterfacePair)

Manually add an entry to the container consisting of a previously composed entry std::pair.

Parameters
ipInterfacePairthe pair of a pointer to Ipv4 object and interface index of the Ipv4Interface to add to the container

Definition at line 53 of file qkd-control-container.cc.

References Add(), and ns3::Create().

+ Here is the call graph for this function:

◆ Begin()

QKDControlContainer::Iterator ns3::QKDControlContainer::Begin ( ) const

Get an iterator which refers to the first pair in the container.

Pairs can be retrieved from the container in two ways. First, directly by an index into the container, and second, using an iterator. This method is used in the iterator method and is typically used in a for-loop to run through the pairs

for(i = container.Begin(); i != container.End(); ++i)
{
std::pair<Ptr<QKDControl>, uint32_t> pair = *i;
method(pair.first, pair.second); // use the pair
}
std::vector< std::pair< Ptr< QKDControl >, uint32_t > >::const_iterator Iterator
Container Const Iterator for pairs of QKDControl smart pointer / Interface Index.
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
Definition ptr.h:436
Returns
an iterator which refers to the first pair in the container.

Definition at line 31 of file qkd-control-container.cc.

References m_list.

◆ End()

QKDControlContainer::Iterator ns3::QKDControlContainer::End ( ) const

Get an iterator which indicates past-the-last Node in the container.

Nodes can be retrieved from the container in two ways. First, directly by an index into the container, and second, using an iterator. This method is used in the iterator method and is typically used in a for-loop to run through the Nodes

for(i = container.Begin(); i != container.End(); ++i)
{
std::pair<Ptr<QKDControl>, uint32_t> pair = *i;
method(pair.first, pair.second); // use the pair
}
std::vector< Ptr< Node > >::const_iterator Iterator
Node container iterator.
Returns
an iterator which indicates an ending condition for a loop.

Definition at line 37 of file qkd-control-container.cc.

References m_list.

◆ Get()

std::pair< Ptr< QKDControl >, uint32_t > ns3::QKDControlContainer::Get ( uint32_t  i) const

Get the std::pair of an Ptr<QKDControl> and interface stored at the location specified by the index.

Parameters
ithe index of the container entry to retrieve.
Returns
the std::pair of a Ptr<QKDControl> and an interface index

Definition at line 59 of file qkd-control-container.cc.

References ns3::Create(), and m_list.

+ Here is the call graph for this function:

◆ GetN()

uint32_t ns3::QKDControlContainer::GetN ( ) const
Returns
the number of Ptr<QKDControl> and interface pairs stored in this QKDControlContainer.

Pairs can be retrieved from the container in two ways. First, directly by an index into the container, and second, using an iterator. This method is used in the direct method and is typically used to define an ending condition in a for-loop that runs through the stored Nodes

uint32_t nNodes = container.GetN();
for(uint32_t i = 0 i < nNodes; ++i)
{
std::pair<Ptr<QKDControl>, uint32_t> pair = container.Get(i);
method(pair.first, pair.second); // use the pair
}
Returns
the number of Ptr<Node> stored in this container.

Definition at line 43 of file qkd-control-container.cc.

References m_list.

Member Data Documentation

◆ m_list

InterfaceVector ns3::QKDControlContainer::m_list
private

List of QKD Encryptors and interfaces index.

Definition at line 151 of file qkd-control-container.h.

Referenced by Add(), Add(), Begin(), End(), Get(), and GetN().


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