A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ns3::NixVectorHelper< T > Class Template Reference

Helper class that adds Nix-vector routing to nodes. More...

#include "nix-vector-helper.h"

+ Inheritance diagram for ns3::NixVectorHelper< T >:
+ Collaboration diagram for ns3::NixVectorHelper< T >:

Public Member Functions

 NixVectorHelper ()
 Construct an NixVectorHelper to make life easier while adding Nix-vector routing to nodes.
 
 NixVectorHelper (const NixVectorHelper< T > &o)
 Construct an NixVectorHelper from another previously initialized instance (Copy Constructor).
 
NixVectorHelper< T > * Copy () const override
 
Ptr< IpRoutingProtocolCreate (Ptr< Node > node) const override
 
NixVectorHelperoperator= (const NixVectorHelper &)=delete
 
void PrintRoutingPathAt (Time printTime, Ptr< Node > source, IpAddress dest, Ptr< OutputStreamWrapper > stream, Time::Unit unit=Time::S)
 prints the routing path for a source and destination at a particular time.
 

Private Types

using Ip = typename std::conditional_t< IsIpv4, Ipv4, Ipv6 >
 Alias for Ipv4 and Ipv6 classes.
 
using IpAddress = typename std::conditional_t< IsIpv4, Ipv4Address, Ipv6Address >
 Alias for Ipv4Address and Ipv6Address classes.
 
using IpRoutingProtocol = typename std::conditional_t< IsIpv4, Ipv4RoutingProtocol, Ipv6RoutingProtocol >
 Alias for Ipv4RoutingProtocol and Ipv6RoutingProtocol classes.
 

Static Private Member Functions

static void PrintRoute (Ptr< Node > source, IpAddress dest, Ptr< OutputStreamWrapper > stream, Time::Unit unit=Time::S)
 prints the routing path for the source and destination.
 

Private Attributes

ObjectFactory m_agentFactory
 Object factory.
 

Static Private Attributes

static constexpr bool IsIpv4 = std::is_same_v<Ipv4RoutingHelper, T>
 Alias for determining whether the parent is Ipv4RoutingHelper or Ipv6RoutingHelper.
 

Detailed Description

template<typename T>
class ns3::NixVectorHelper< T >

Helper class that adds Nix-vector routing to nodes.

This class is expected to be used in conjunction with ns3::InternetStackHelper::SetRoutingHelper

Internal:
Since this class is meant to be specialized only by Ipv4RoutingHelper or Ipv6RoutingHelper the implementation of this class doesn't need to be exposed here; it is in nix-vector-helper.cc.

Definition at line 50 of file nix-vector-helper.h.

Member Typedef Documentation

◆ Ip

template<typename T >
using ns3::NixVectorHelper< T >::Ip = typename std::conditional_t<IsIpv4, Ipv4, Ipv6>
private

Alias for Ipv4 and Ipv6 classes.

Definition at line 57 of file nix-vector-helper.h.

◆ IpAddress

template<typename T >
using ns3::NixVectorHelper< T >::IpAddress = typename std::conditional_t<IsIpv4, Ipv4Address, Ipv6Address>
private

Alias for Ipv4Address and Ipv6Address classes.

Definition at line 59 of file nix-vector-helper.h.

◆ IpRoutingProtocol

template<typename T >
using ns3::NixVectorHelper< T >::IpRoutingProtocol = typename std::conditional_t<IsIpv4, Ipv4RoutingProtocol, Ipv6RoutingProtocol>
private

Alias for Ipv4RoutingProtocol and Ipv6RoutingProtocol classes.

Definition at line 61 of file nix-vector-helper.h.

Constructor & Destructor Documentation

◆ NixVectorHelper() [1/2]

template<typename T >
ns3::NixVectorHelper< T >::NixVectorHelper

Construct an NixVectorHelper to make life easier while adding Nix-vector routing to nodes.

Definition at line 34 of file nix-vector-helper.cc.

◆ NixVectorHelper() [2/2]

template<typename T >
ns3::NixVectorHelper< T >::NixVectorHelper ( const NixVectorHelper< T > &  o)

Construct an NixVectorHelper from another previously initialized instance (Copy Constructor).

Parameters
oobject to copy

Definition at line 50 of file nix-vector-helper.cc.

Member Function Documentation

◆ Copy()

template<typename T >
NixVectorHelper< T > * ns3::NixVectorHelper< T >::Copy
override
Returns
pointer to clone of this NixVectorHelper

This method is mainly for internal use by the other helpers; clients are expected to free the dynamic memory allocated by this method

Definition at line 60 of file nix-vector-helper.cc.

◆ Create()

template<typename T >
Ptr< typename NixVectorHelper< T >::IpRoutingProtocol > ns3::NixVectorHelper< T >::Create ( Ptr< Node node) const
override
Parameters
nodethe node on which the routing protocol will run
Returns
a newly-created routing protocol

This method will be called by ns3::InternetStackHelper::Install

Definition at line 67 of file nix-vector-helper.cc.

◆ operator=()

template<typename T >
NixVectorHelper & ns3::NixVectorHelper< T >::operator= ( const NixVectorHelper< T > &  )
delete

◆ PrintRoute()

template<typename T >
void ns3::NixVectorHelper< T >::PrintRoute ( Ptr< Node source,
IpAddress  dest,
Ptr< OutputStreamWrapper stream,
Time::Unit  unit = Time::S 
)
staticprivate

prints the routing path for the source and destination.

If the routing path does not exist, it prints that the path does not exist between the nodes in the ostream.

Parameters
sourcethe source node pointer to start traversing
destthe IP destination address
streamthe output stream object to use
unitthe time unit to be used in the report

This method calls the PrintRoutingPath() method of the NixVectorRouting for the source and destination to provide the routing path.

Definition at line 89 of file nix-vector-helper.cc.

References NS_ASSERT.

◆ PrintRoutingPathAt()

template<typename T >
void ns3::NixVectorHelper< T >::PrintRoutingPathAt ( Time  printTime,
Ptr< Node source,
IpAddress  dest,
Ptr< OutputStreamWrapper stream,
Time::Unit  unit = Time::S 
)

prints the routing path for a source and destination at a particular time.

If the routing path does not exist, it prints that the path does not exist between the nodes in the ostream.

Parameters
printTimethe time at which the routing path is supposed to be printed.
sourcethe source node pointer to start traversing
destthe IP destination address
streamthe output stream object to use
unitthe time unit to be used in the report

This method calls the PrintRoutingPath() method of the NixVectorRouting for the source and destination to provide the routing path at the specified time.

Definition at line 78 of file nix-vector-helper.cc.

References ns3::Simulator::Schedule().

Referenced by NixVectorRoutingTest::DoRun().

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

Member Data Documentation

◆ IsIpv4

template<typename T >
constexpr bool ns3::NixVectorHelper< T >::IsIpv4 = std::is_same_v<Ipv4RoutingHelper, T>
staticconstexprprivate

Alias for determining whether the parent is Ipv4RoutingHelper or Ipv6RoutingHelper.

Definition at line 55 of file nix-vector-helper.h.

◆ m_agentFactory

template<typename T >
ObjectFactory ns3::NixVectorHelper< T >::m_agentFactory
private

Object factory.

Definition at line 119 of file nix-vector-helper.h.


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