A Discrete-Event Network Simulator
API
ns3::QKDEncryptorContainer Class Reference

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

#include "qkd-encryptor-container.h"

+ Collaboration diagram for ns3::QKDEncryptorContainer:

Public Types

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

Public Member Functions

 QKDEncryptorContainer ()
 Constructor. More...
 
void Add (const QKDEncryptorContainer &other)
 Concatenate the entries in the other container with ours. More...
 
void Add (Ptr< QKDEncryptor >, uint32_t ipInterfacePair)
 Add an entry to the container. More...
 
void Add (std::pair< Ptr< QKDEncryptor >, uint32_t > ipInterfacePair)
 Add and entry to the container. More...
 
Iterator Begin (void) const
 Get an iterator which refers to the first pair in the container. More...
 
Iterator End (void) const
 Get an iterator which indicates past-the-last Node in the container. More...
 
std::pair< Ptr< QKDEncryptor >, uint32_t > Get (uint32_t i) const
 Get the pair of the QKD encryptor and interface stored at the location specified by the index. More...
 
uint32_t GetN (void) const
 Get number of nodes withing the container. More...
 

Private Types

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

Private Attributes

InterfaceVector m_list
 List of QKD Encryptors and interfaces index. More...
 

Detailed Description

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

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

See also
QKDEncryptor

Definition at line 41 of file qkd-encryptor-container.h.

Member Typedef Documentation

◆ InterfaceVector

typedef std::vector<std::pair<Ptr<QKDEncryptor>,uint32_t> > ns3::QKDEncryptorContainer::InterfaceVector
private

Container for pairs of QKDEncryptor smart pointer / Interface Index.

Definition at line 135 of file qkd-encryptor-container.h.

◆ Iterator

typedef std::vector<std::pair<Ptr<QKDEncryptor>, uint32_t> >::const_iterator ns3::QKDEncryptorContainer::Iterator

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

Definition at line 47 of file qkd-encryptor-container.h.

Constructor & Destructor Documentation

◆ QKDEncryptorContainer()

ns3::QKDEncryptorContainer::QKDEncryptorContainer ( )

Constructor.

Definition at line 27 of file qkd-encryptor-container.cc.

Member Function Documentation

◆ Add() [1/3]

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

Concatenate the entries in the other container with ours.

Parameters
otherThe other container.

Definition at line 32 of file qkd-encryptor-container.cc.

References m_list.

Referenced by Add(), and ns3::QKDLinkHelper::InstallQKDEncryptor().

+ Here is the caller graph for this function:

◆ Add() [2/3]

void ns3::QKDEncryptorContainer::Add ( Ptr< QKDEncryptor qkde,
uint32_t  ipInterfacePair 
)

Add an entry to the container.

Parameters
TheQKD encryptor object.
ipInterfacePairThe pair of a pointer to Ipv4 object and interface index of the Ipv4Interface to add to the container.

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

References m_list.

◆ Add() [3/3]

void ns3::QKDEncryptorContainer::Add ( std::pair< Ptr< QKDEncryptor >, uint32_t >  ipInterfacePair)

Add and entry to the container.

Parameters
Thepair of QKD encryptors.
ipInterfacePairThe pair of a pointer to Ipv4 object and interface index of the Ipv4Interface to add to the container.

Definition at line 63 of file qkd-encryptor-container.cc.

References Add().

+ Here is the call graph for this function:

◆ Begin()

QKDEncryptorContainer::Iterator ns3::QKDEncryptorContainer::Begin ( void  ) 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<QKDEncryptor>, uint32_t> pair = *i;
method (pair.first, pair.second); // use the pair
}
std::vector< std::pair< Ptr< QKDEncryptor >, uint32_t > >::const_iterator Iterator
Container Const Iterator for pairs of QKDEncryptor smart pointer / Interface Index.
Returns
The iterator which refers to the first pair in the container.

Definition at line 41 of file qkd-encryptor-container.cc.

References m_list.

◆ End()

QKDEncryptorContainer::Iterator ns3::QKDEncryptorContainer::End ( void  ) 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<QKDEncryptor>, uint32_t> pair = *i;
method (pair.first, pair.second); // use the pair
}
std::vector< Ptr< Node > >::const_iterator Iterator
Node container iterator.
Returns
The iterator which indicates an ending condition for a loop.

Definition at line 47 of file qkd-encryptor-container.cc.

References m_list.

◆ Get()

std::pair< Ptr< QKDEncryptor >, uint32_t > ns3::QKDEncryptorContainer::Get ( uint32_t  i) const

Get the pair of the QKD encryptor 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<QKDEncryptor> and an interface index.

Definition at line 69 of file qkd-encryptor-container.cc.

References m_list.

◆ GetN()

uint32_t ns3::QKDEncryptorContainer::GetN ( void  ) const

Get number of nodes withing the container.

Returns
The number of nodes.

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

References m_list.

Member Data Documentation

◆ m_list

InterfaceVector ns3::QKDEncryptorContainer::m_list
private

List of QKD Encryptors and interfaces index.

Definition at line 136 of file qkd-encryptor-container.h.

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


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