Use variadic argument lists in various Helpers.

QosWaveMacHelper::SetType() and NqosWaveMacHelper::SetType() were
virtual, but then they can't be templated to handle variadic
argument lists.  The base class is not virtual, and nothing derives from
these classes, so virtual doesn't seem to be required.
This commit is contained in:
Peter D. Barnes, Jr
2021-09-20 19:55:47 -07:00
committed by Tom Henderson
parent af782862c4
commit d635a72cbc
30 changed files with 457 additions and 1509 deletions

View File

@@ -22,7 +22,6 @@
#include "ns3/log.h"
#include "ns3/simulator.h"
#include "ns3/object-factory.h"
#include "ns3/queue.h"
#include "ns3/net-device-queue-interface.h"
#include "ns3/csma-net-device.h"
#include "ns3/csma-channel.h"
@@ -47,22 +46,6 @@ CsmaHelper::CsmaHelper ()
m_enableFlowControl = true;
}
void
CsmaHelper::SetQueue (std::string type,
std::string n1, const AttributeValue &v1,
std::string n2, const AttributeValue &v2,
std::string n3, const AttributeValue &v3,
std::string n4, const AttributeValue &v4)
{
QueueBase::AppendItemTypeIfNotPresent (type, "Packet");
m_queueFactory.SetTypeId (type);
m_queueFactory.Set (n1, v1);
m_queueFactory.Set (n2, v2);
m_queueFactory.Set (n3, v3);
m_queueFactory.Set (n4, v4);
}
void
CsmaHelper::SetDeviceAttribute (std::string n1, const AttributeValue &v1)
{

View File

@@ -26,6 +26,7 @@
#include "ns3/object-factory.h"
#include "ns3/net-device-container.h"
#include "ns3/node-container.h"
#include "ns3/queue.h"
#include "ns3/csma-channel.h"
#include "ns3/trace-helper.h"
@@ -53,24 +54,15 @@ public:
virtual ~CsmaHelper () {}
/**
* \tparam Ts \deduced Argument types
* \param type the type of queue
* \param n1 the name of the attribute to set on the queue
* \param v1 the value of the attribute to set on the queue
* \param n2 the name of the attribute to set on the queue
* \param v2 the value of the attribute to set on the queue
* \param n3 the name of the attribute to set on the queue
* \param v3 the value of the attribute to set on the queue
* \param n4 the name of the attribute to set on the queue
* \param v4 the value of the attribute to set on the queue
* \param [in] args Name and AttributeValue pairs to set.
*
* Set the type of queue to create and associated to each
* CsmaNetDevice created through CsmaHelper::Install.
*/
void SetQueue (std::string type,
std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue ());
template <typename... Ts>
void SetQueue (std::string type, Ts&&... args);
/**
* \param n1 the name of the attribute to set
@@ -263,6 +255,21 @@ private:
bool m_enableFlowControl; //!< whether to enable flow control
};
/***************************************************************
* Implementation of the templates declared above.
***************************************************************/
template <typename... Ts>
void CsmaHelper::SetQueue (std::string type, Ts&&... args)
{
QueueBase::AppendItemTypeIfNotPresent (type, "Packet");
m_queueFactory.SetTypeId (type);
m_queueFactory.Set (std::forward<Ts> (args)...);
}
} // namespace ns3
#endif /* CSMA_HELPER_H */

View File

@@ -49,33 +49,6 @@ MeshHelper::SetSpreadInterfaceChannels (enum ChannelPolicy policy)
{
m_spreadChannelPolicy = policy;
}
void
MeshHelper::SetStackInstaller (std::string type,
std::string n0, const AttributeValue &v0,
std::string n1, const AttributeValue &v1,
std::string n2, const AttributeValue &v2,
std::string n3, const AttributeValue &v3,
std::string n4, const AttributeValue &v4,
std::string n5, const AttributeValue &v5,
std::string n6, const AttributeValue &v6,
std::string n7, const AttributeValue &v7)
{
m_stackFactory.SetTypeId (type);
m_stackFactory.Set (n0, v0);
m_stackFactory.Set (n1, v1);
m_stackFactory.Set (n2, v2);
m_stackFactory.Set (n3, v3);
m_stackFactory.Set (n4, v4);
m_stackFactory.Set (n5, v5);
m_stackFactory.Set (n6, v6);
m_stackFactory.Set (n7, v7);
m_stack = m_stackFactory.Create<MeshStack> ();
if (!m_stack)
{
NS_FATAL_ERROR ("Stack has not been created: " << type);
}
}
void
MeshHelper::SetNumberOfInterfaces (uint32_t nInterfaces)
@@ -126,48 +99,6 @@ MeshHelper::Default (void)
return helper;
}
void
MeshHelper::SetMacType (std::string n0, const AttributeValue &v0,
std::string n1, const AttributeValue &v1,
std::string n2, const AttributeValue &v2,
std::string n3, const AttributeValue &v3,
std::string n4, const AttributeValue &v4,
std::string n5, const AttributeValue &v5,
std::string n6, const AttributeValue &v6,
std::string n7, const AttributeValue &v7)
{
m_mac.SetTypeId ("ns3::MeshWifiInterfaceMac");
m_mac.Set (n0, v0);
m_mac.Set (n1, v1);
m_mac.Set (n2, v2);
m_mac.Set (n3, v3);
m_mac.Set (n4, v4);
m_mac.Set (n5, v5);
m_mac.Set (n6, v6);
m_mac.Set (n7, v7);
}
void
MeshHelper::SetRemoteStationManager (std::string type,
std::string n0, const AttributeValue &v0,
std::string n1, const AttributeValue &v1,
std::string n2, const AttributeValue &v2,
std::string n3, const AttributeValue &v3,
std::string n4, const AttributeValue &v4,
std::string n5, const AttributeValue &v5,
std::string n6, const AttributeValue &v6,
std::string n7, const AttributeValue &v7)
{
m_stationManager = ObjectFactory ();
m_stationManager.SetTypeId (type);
m_stationManager.Set (n0, v0);
m_stationManager.Set (n1, v1);
m_stationManager.Set (n2, v2);
m_stationManager.Set (n3, v3);
m_stationManager.Set (n4, v4);
m_stationManager.Set (n5, v5);
m_stationManager.Set (n6, v6);
m_stationManager.Set (n7, v7);
}
void
MeshHelper::SetStandard (enum WifiStandard standard)
{

View File

@@ -61,66 +61,28 @@ public:
static MeshHelper Default ();
/**
* \param n0 the name of the attribute to set
* \param v0 the value of the attribute to set
* \param n1 the name of the attribute to set
* \param v1 the value of the attribute to set
* \param n2 the name of the attribute to set
* \param v2 the value of the attribute to set
* \param n3 the name of the attribute to set
* \param v3 the value of the attribute to set
* \param n4 the name of the attribute to set
* \param v4 the value of the attribute to set
* \param n5 the name of the attribute to set
* \param v5 the value of the attribute to set
* \param n6 the name of the attribute to set
* \param v6 the value of the attribute to set
* \param n7 the name of the attribute to set
* \param v7 the value of the attribute to set
*
* \brief Set the Mac Attributes.
*
* All the attributes specified in this method should exist
* in the requested mac.
*
* \tparam Ts \deduced Argument types
* \param [in] args Name and AttributeValue pairs to set.
*/
void SetMacType (std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (),
std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (),
std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (),
std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (),
std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue ());
template <typename... Ts>
void SetMacType (Ts&&... args);
/**
* \param type the type of ns3::WifiRemoteStationManager to create.
* \param n0 the name of the attribute to set
* \param v0 the value of the attribute to set
* \param n1 the name of the attribute to set
* \param v1 the value of the attribute to set
* \param n2 the name of the attribute to set
* \param v2 the value of the attribute to set
* \param n3 the name of the attribute to set
* \param v3 the value of the attribute to set
* \param n4 the name of the attribute to set
* \param v4 the value of the attribute to set
* \param n5 the name of the attribute to set
* \param v5 the value of the attribute to set
* \param n6 the name of the attribute to set
* \param v6 the value of the attribute to set
* \param n7 the name of the attribute to set
* \param v7 the value of the attribute to set
*
* \brief Set the remote station manager type and Attributes.
*
* All the attributes specified in this method should exist
* in the requested station manager.
*
* \tparam Ts \deduced Argument types
* \param type the type of remote station manager to use.
* \param [in] args Name and AttributeValue pairs to set.
*/
void
SetRemoteStationManager (std::string type,
std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (),
std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (),
std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (),
std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (),
std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue ());
template <typename... Ts>
void SetRemoteStationManager (std::string type, Ts&&... args);
/**
* Set standard
* \param standard the wifi phy standard
@@ -162,33 +124,14 @@ public:
NetDeviceContainer
Install (const WifiPhyHelper &phyHelper, NodeContainer c) const;
/**
* \brief Set the MeshStack type to use.
*
* \tparam Ts \deduced Argument types
* \param type the type of ns3::MeshStack.
* \param n0 the name of the attribute to set
* \param v0 the value of the attribute to set
* \param n1 the name of the attribute to set
* \param v1 the value of the attribute to set
* \param n2 the name of the attribute to set
* \param v2 the value of the attribute to set
* \param n3 the name of the attribute to set
* \param v3 the value of the attribute to set
* \param n4 the name of the attribute to set
* \param v4 the value of the attribute to set
* \param n5 the name of the attribute to set
* \param v5 the value of the attribute to set
* \param n6 the name of the attribute to set
* \param v6 the value of the attribute to set
* \param n7 the name of the attribute to set
* \param v7 the value of the attribute to set
* \param [in] args Name and AttributeValue pairs to set.
*/
void SetStackInstaller (std::string type,
std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (),
std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (),
std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (),
std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (),
std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue ());
template <typename... Ts>
void SetStackInstaller (std::string type, Ts&&... args);
/**
* \brief Print statistics.
@@ -241,6 +184,37 @@ private:
enum WifiStandard m_standard; ///< standard
};
/***************************************************************
* Implementation of the templates declared above.
***************************************************************/
template <typename... Ts>
void MeshHelper::SetMacType (Ts&&... args)
{
m_mac.SetTypeId ("ns3::MeshWifiInterfaceMac");
m_mac.Set (std::forward<Ts> (args)...);
}
template <typename... Ts>
void MeshHelper::SetRemoteStationManager (std::string type, Ts&&... args)
{
m_stationManager = ObjectFactory (type, std::forward<Ts> (args)...);
}
template <typename... Ts>
void MeshHelper::SetStackInstaller (std::string type, Ts&&... args)
{
m_stackFactory.SetTypeId (type);
m_stackFactory.Set (std::forward<Ts> (args)...);
m_stack = m_stackFactory.Create<MeshStack> ();
if (!m_stack)
{
NS_FATAL_ERROR ("Stack has not been created: " << type);
}
}
} // namespace ns3
#endif /* MESH_HELPER_H */

View File

@@ -37,6 +37,7 @@ namespace ns3 {
NS_LOG_COMPONENT_DEFINE ("GroupMobilityHelper");
GroupMobilityHelper::GroupMobilityHelper ()
: NS_LOG_TEMPLATE_DEFINE ("GroupMobilityHelper")
{
}
@@ -50,125 +51,18 @@ GroupMobilityHelper::SetReferencePositionAllocator (Ptr<PositionAllocator> alloc
m_referencePosition = allocator;
}
void
GroupMobilityHelper::SetReferencePositionAllocator (std::string type,
std::string n1, const AttributeValue &v1,
std::string n2, const AttributeValue &v2,
std::string n3, const AttributeValue &v3,
std::string n4, const AttributeValue &v4,
std::string n5, const AttributeValue &v5,
std::string n6, const AttributeValue &v6,
std::string n7, const AttributeValue &v7,
std::string n8, const AttributeValue &v8,
std::string n9, const AttributeValue &v9)
{
ObjectFactory pos;
pos.SetTypeId (type);
pos.Set (n1, v1);
pos.Set (n2, v2);
pos.Set (n3, v3);
pos.Set (n4, v4);
pos.Set (n5, v5);
pos.Set (n6, v6);
pos.Set (n7, v7);
pos.Set (n8, v8);
pos.Set (n9, v9);
m_referencePosition = pos.Create ()->GetObject<PositionAllocator> ();
NS_ABORT_MSG_IF (!m_referencePosition, "Unable to create allocator from TypeId " << type);
}
void
GroupMobilityHelper::SetMemberPositionAllocator (Ptr<PositionAllocator> allocator)
{
m_memberPosition = allocator;
}
void
GroupMobilityHelper::SetMemberPositionAllocator (std::string type,
std::string n1, const AttributeValue &v1,
std::string n2, const AttributeValue &v2,
std::string n3, const AttributeValue &v3,
std::string n4, const AttributeValue &v4,
std::string n5, const AttributeValue &v5,
std::string n6, const AttributeValue &v6,
std::string n7, const AttributeValue &v7,
std::string n8, const AttributeValue &v8,
std::string n9, const AttributeValue &v9)
{
ObjectFactory pos;
pos.SetTypeId (type);
pos.Set (n1, v1);
pos.Set (n2, v2);
pos.Set (n3, v3);
pos.Set (n4, v4);
pos.Set (n5, v5);
pos.Set (n6, v6);
pos.Set (n7, v7);
pos.Set (n8, v8);
pos.Set (n9, v9);
m_memberPosition = pos.Create ()->GetObject<PositionAllocator> ();
NS_ABORT_MSG_IF (!m_memberPosition, "Unable to create allocator from TypeId " << type);
}
void
GroupMobilityHelper::SetReferenceMobilityModel (Ptr<MobilityModel> mobility)
{
m_referenceMobility = mobility;
}
void
GroupMobilityHelper::SetReferenceMobilityModel (std::string type,
std::string n1, const AttributeValue &v1,
std::string n2, const AttributeValue &v2,
std::string n3, const AttributeValue &v3,
std::string n4, const AttributeValue &v4,
std::string n5, const AttributeValue &v5,
std::string n6, const AttributeValue &v6,
std::string n7, const AttributeValue &v7,
std::string n8, const AttributeValue &v8,
std::string n9, const AttributeValue &v9)
{
NS_LOG_FUNCTION (this << type);
ObjectFactory mob;
mob.SetTypeId (type);
mob.Set (n1, v1);
mob.Set (n2, v2);
mob.Set (n3, v3);
mob.Set (n4, v4);
mob.Set (n5, v5);
mob.Set (n6, v6);
mob.Set (n7, v7);
mob.Set (n8, v8);
mob.Set (n9, v9);
m_referenceMobility = mob.Create ()->GetObject<MobilityModel> ();
NS_ABORT_MSG_IF (!m_referenceMobility, "Unable to create mobility from TypeId " << type);
}
void
GroupMobilityHelper::SetMemberMobilityModel (std::string type,
std::string n1, const AttributeValue &v1,
std::string n2, const AttributeValue &v2,
std::string n3, const AttributeValue &v3,
std::string n4, const AttributeValue &v4,
std::string n5, const AttributeValue &v5,
std::string n6, const AttributeValue &v6,
std::string n7, const AttributeValue &v7,
std::string n8, const AttributeValue &v8,
std::string n9, const AttributeValue &v9)
{
NS_LOG_FUNCTION (this << type);
m_memberMobilityFactory.SetTypeId (type);
m_memberMobilityFactory.Set (n1, v1);
m_memberMobilityFactory.Set (n2, v2);
m_memberMobilityFactory.Set (n3, v3);
m_memberMobilityFactory.Set (n4, v4);
m_memberMobilityFactory.Set (n5, v5);
m_memberMobilityFactory.Set (n6, v6);
m_memberMobilityFactory.Set (n7, v7);
m_memberMobilityFactory.Set (n8, v8);
m_memberMobilityFactory.Set (n9, v9);
}
void
GroupMobilityHelper::Install (Ptr<Node> node)
{

View File

@@ -68,36 +68,12 @@ public:
* Configure the position allocator which will be used to allocate
* the initial position of the reference mobility model.
*
* \param type the type of mobility model to use.
* \param n1 the name of the attribute to set in the mobility model.
* \param v1 the value of the attribute to set in the mobility model.
* \param n2 the name of the attribute to set in the mobility model.
* \param v2 the value of the attribute to set in the mobility model.
* \param n3 the name of the attribute to set in the mobility model.
* \param v3 the value of the attribute to set in the mobility model.
* \param n4 the name of the attribute to set in the mobility model.
* \param v4 the value of the attribute to set in the mobility model.
* \param n5 the name of the attribute to set in the mobility model.
* \param v5 the value of the attribute to set in the mobility model.
* \param n6 the name of the attribute to set in the mobility model.
* \param v6 the value of the attribute to set in the mobility model.
* \param n7 the name of the attribute to set in the mobility model.
* \param v7 the value of the attribute to set in the mobility model.
* \param n8 the name of the attribute to set in the mobility model.
* \param v8 the value of the attribute to set in the mobility model.
* \param n9 the name of the attribute to set in the mobility model.
* \param v9 the value of the attribute to set in the mobility model.
* \tparam Ts \deduced Argument types
* \param type the type of position allocator to use.
* \param [in] args Name and AttributeValue pairs to set.
*/
void SetReferencePositionAllocator (std::string type,
std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (),
std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (),
std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (),
std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue (),
std::string n8 = "", const AttributeValue &v8 = EmptyAttributeValue (),
std::string n9 = "", const AttributeValue &v9 = EmptyAttributeValue ());
template <typename... Ts>
void SetReferencePositionAllocator (std::string type, Ts&&... args);
/**
* Set the position allocator which will be used to allocate the initial
@@ -111,36 +87,12 @@ public:
* Configure the position allocator which will be used to allocate the
* initial position of the member mobility models.
*
* \param type the type of mobility model to use.
* \param n1 the name of the attribute to set in the mobility model.
* \param v1 the value of the attribute to set in the mobility model.
* \param n2 the name of the attribute to set in the mobility model.
* \param v2 the value of the attribute to set in the mobility model.
* \param n3 the name of the attribute to set in the mobility model.
* \param v3 the value of the attribute to set in the mobility model.
* \param n4 the name of the attribute to set in the mobility model.
* \param v4 the value of the attribute to set in the mobility model.
* \param n5 the name of the attribute to set in the mobility model.
* \param v5 the value of the attribute to set in the mobility model.
* \param n6 the name of the attribute to set in the mobility model.
* \param v6 the value of the attribute to set in the mobility model.
* \param n7 the name of the attribute to set in the mobility model.
* \param v7 the value of the attribute to set in the mobility model.
* \param n8 the name of the attribute to set in the mobility model.
* \param v8 the value of the attribute to set in the mobility model.
* \param n9 the name of the attribute to set in the mobility model.
* \param v9 the value of the attribute to set in the mobility model.
* \tparam Ts \deduced Argument types
* \param type the type of position allocator to use.
* \param [in] args Name and AttributeValue pairs to set.
*/
void SetMemberPositionAllocator (std::string type,
std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (),
std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (),
std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (),
std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue (),
std::string n8 = "", const AttributeValue &v8 = EmptyAttributeValue (),
std::string n9 = "", const AttributeValue &v9 = EmptyAttributeValue ());
template <typename... Ts>
void SetMemberPositionAllocator (std::string type, Ts&&... args);
/**
* Set the reference mobility model which will be installed as the parent
@@ -154,74 +106,26 @@ public:
* Configure the reference mobility model which will be installed as the
* parent mobility model during GroupMobilityModel::Install.
*
* \tparam Ts \deduced Argument types
* \param type the type of mobility model to use.
* \param n1 the name of the attribute to set in the mobility model.
* \param v1 the value of the attribute to set in the mobility model.
* \param n2 the name of the attribute to set in the mobility model.
* \param v2 the value of the attribute to set in the mobility model.
* \param n3 the name of the attribute to set in the mobility model.
* \param v3 the value of the attribute to set in the mobility model.
* \param n4 the name of the attribute to set in the mobility model.
* \param v4 the value of the attribute to set in the mobility model.
* \param n5 the name of the attribute to set in the mobility model.
* \param v5 the value of the attribute to set in the mobility model.
* \param n6 the name of the attribute to set in the mobility model.
* \param v6 the value of the attribute to set in the mobility model.
* \param n7 the name of the attribute to set in the mobility model.
* \param v7 the value of the attribute to set in the mobility model.
* \param n8 the name of the attribute to set in the mobility model.
* \param v8 the value of the attribute to set in the mobility model.
* \param n9 the name of the attribute to set in the mobility model.
* \param v9 the value of the attribute to set in the mobility model.
* \param [in] args Name and AttributeValue pairs to set.
*/
void SetReferenceMobilityModel (std::string type,
std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (),
std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (),
std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (),
std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue (),
std::string n8 = "", const AttributeValue &v8 = EmptyAttributeValue (),
std::string n9 = "", const AttributeValue &v9 = EmptyAttributeValue ());
template <typename... Ts>
void SetReferenceMobilityModel (std::string type, Ts&&... args);
/**
* Configure the mobility model which will be installed as the
* member (child) mobility model during GroupMobilityModel::Install.
*
* \param type the type of mobility model to use.
* \param n1 the name of the attribute to set in the mobility model.
* \param v1 the value of the attribute to set in the mobility model.
* \param n2 the name of the attribute to set in the mobility model.
* \param v2 the value of the attribute to set in the mobility model.
* \param n3 the name of the attribute to set in the mobility model.
* \param v3 the value of the attribute to set in the mobility model.
* \param n4 the name of the attribute to set in the mobility model.
* \param v4 the value of the attribute to set in the mobility model.
* \param n5 the name of the attribute to set in the mobility model.
* \param v5 the value of the attribute to set in the mobility model.
* \param n6 the name of the attribute to set in the mobility model.
* \param v6 the value of the attribute to set in the mobility model.
* \param n7 the name of the attribute to set in the mobility model.
* \param v7 the value of the attribute to set in the mobility model.
* \param n8 the name of the attribute to set in the mobility model.
* \param v8 the value of the attribute to set in the mobility model.
* \param n9 the name of the attribute to set in the mobility model.
* \param v9 the value of the attribute to set in the mobility model.
*
* Calls to MobilityHelper::Install will create an instance of a matching
* mobility model for each node.
*
* \tparam Ts \deduced Argument types
* \param type the type of mobility model to use.
* \param [in] args Name and AttributeValue pairs to set.
*/
void SetMemberMobilityModel (std::string type,
std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (),
std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (),
std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (),
std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue (),
std::string n8 = "", const AttributeValue &v8 = EmptyAttributeValue (),
std::string n9 = "", const AttributeValue &v9 = EmptyAttributeValue ());
template <typename... Ts>
void SetMemberMobilityModel (std::string type, Ts&&... args);
/**
* \brief Install and configure a hierarchical mobility model to the
@@ -277,6 +181,10 @@ public:
private:
// Enable loggin from template instantiations
NS_LOG_TEMPLATE_DECLARE; //!< the log component
bool m_referencePositionSet {false}; //!< flag for avoiding multiple SetPosition calls on the reference model
Ptr<MobilityModel> m_referenceMobility; //!< Reference mobility model
Ptr<PositionAllocator> m_referencePosition; //!< Position allocator for use as reference position allocator
@@ -284,6 +192,48 @@ private:
Ptr<PositionAllocator> m_memberPosition; //!< Position allocator for use as member position allocator
};
/***************************************************************
* Implementation of the templates declared above.
***************************************************************/
template <typename... Ts>
void
GroupMobilityHelper::SetReferencePositionAllocator (std::string type, Ts&&... args)
{
ObjectFactory pos (type, std::forward<Ts> (args)...);
m_referencePosition = pos.Create ()->GetObject<PositionAllocator> ();
NS_ABORT_MSG_IF (!m_referencePosition, "Unable to create allocator from TypeId " << type);
}
template <typename... Ts>
void
GroupMobilityHelper::SetMemberPositionAllocator (std::string type, Ts&&... args)
{
ObjectFactory pos(type, std::forward<Ts> (args)...);
m_memberPosition = pos.Create ()->GetObject<PositionAllocator> ();
NS_ABORT_MSG_IF (!m_memberPosition, "Unable to create allocator from TypeId " << type);
}
template <typename... Ts>
void
GroupMobilityHelper::SetReferenceMobilityModel (std::string type, Ts&&... args)
{
NS_LOG_FUNCTION (this << type);
ObjectFactory mob (type, std::forward<Ts> (args)...);
m_referenceMobility = mob.Create ()->GetObject<MobilityModel> ();
NS_ABORT_MSG_IF (!m_referenceMobility, "Unable to create mobility from TypeId " << type);
}
template <typename... Ts>
void
GroupMobilityHelper::SetMemberMobilityModel (std::string type, Ts&&... args)
{
NS_LOG_FUNCTION (this << type);
m_memberMobilityFactory.SetTypeId (type);
m_memberMobilityFactory.Set (std::forward<Ts> (args)...);
}
} // namespace ns3
#endif /* GROUP_MOBILITY_HELPER_H */

View File

@@ -49,56 +49,6 @@ MobilityHelper::SetPositionAllocator (Ptr<PositionAllocator> allocator)
m_position = allocator;
}
void
MobilityHelper::SetPositionAllocator (std::string type,
std::string n1, const AttributeValue &v1,
std::string n2, const AttributeValue &v2,
std::string n3, const AttributeValue &v3,
std::string n4, const AttributeValue &v4,
std::string n5, const AttributeValue &v5,
std::string n6, const AttributeValue &v6,
std::string n7, const AttributeValue &v7,
std::string n8, const AttributeValue &v8,
std::string n9, const AttributeValue &v9)
{
ObjectFactory pos;
pos.SetTypeId (type);
pos.Set (n1, v1);
pos.Set (n2, v2);
pos.Set (n3, v3);
pos.Set (n4, v4);
pos.Set (n5, v5);
pos.Set (n6, v6);
pos.Set (n7, v7);
pos.Set (n8, v8);
pos.Set (n9, v9);
m_position = pos.Create ()->GetObject<PositionAllocator> ();
}
void
MobilityHelper::SetMobilityModel (std::string type,
std::string n1, const AttributeValue &v1,
std::string n2, const AttributeValue &v2,
std::string n3, const AttributeValue &v3,
std::string n4, const AttributeValue &v4,
std::string n5, const AttributeValue &v5,
std::string n6, const AttributeValue &v6,
std::string n7, const AttributeValue &v7,
std::string n8, const AttributeValue &v8,
std::string n9, const AttributeValue &v9)
{
m_mobility.SetTypeId (type);
m_mobility.Set (n1, v1);
m_mobility.Set (n2, v2);
m_mobility.Set (n3, v3);
m_mobility.Set (n4, v4);
m_mobility.Set (n5, v5);
m_mobility.Set (n6, v6);
m_mobility.Set (n7, v7);
m_mobility.Set (n8, v8);
m_mobility.Set (n9, v9);
}
void
MobilityHelper::PushReferenceMobilityModel (Ptr<Object> reference)
{

View File

@@ -62,71 +62,23 @@ public:
void SetPositionAllocator (Ptr<PositionAllocator> allocator);
/**
* \tparam Ts \deduced Argument types
* \param type the type of mobility model to use.
* \param n1 the name of the attribute to set in the mobility model.
* \param v1 the value of the attribute to set in the mobility model.
* \param n2 the name of the attribute to set in the mobility model.
* \param v2 the value of the attribute to set in the mobility model.
* \param n3 the name of the attribute to set in the mobility model.
* \param v3 the value of the attribute to set in the mobility model.
* \param n4 the name of the attribute to set in the mobility model.
* \param v4 the value of the attribute to set in the mobility model.
* \param n5 the name of the attribute to set in the mobility model.
* \param v5 the value of the attribute to set in the mobility model.
* \param n6 the name of the attribute to set in the mobility model.
* \param v6 the value of the attribute to set in the mobility model.
* \param n7 the name of the attribute to set in the mobility model.
* \param v7 the value of the attribute to set in the mobility model.
* \param n8 the name of the attribute to set in the mobility model.
* \param v8 the value of the attribute to set in the mobility model.
* \param n9 the name of the attribute to set in the mobility model.
* \param v9 the value of the attribute to set in the mobility model.
* \param [in] args Name and AttributeValue pairs to set.
*/
void SetPositionAllocator (std::string type,
std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (),
std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (),
std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (),
std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue (),
std::string n8 = "", const AttributeValue &v8 = EmptyAttributeValue (),
std::string n9 = "", const AttributeValue &v9 = EmptyAttributeValue ());
template <typename... Ts>
void SetPositionAllocator (std::string type, Ts&&... args);
/**
* \tparam Ts \deduced Argument types
* \param type the type of mobility model to use.
* \param n1 the name of the attribute to set in the mobility model.
* \param v1 the value of the attribute to set in the mobility model.
* \param n2 the name of the attribute to set in the mobility model.
* \param v2 the value of the attribute to set in the mobility model.
* \param n3 the name of the attribute to set in the mobility model.
* \param v3 the value of the attribute to set in the mobility model.
* \param n4 the name of the attribute to set in the mobility model.
* \param v4 the value of the attribute to set in the mobility model.
* \param n5 the name of the attribute to set in the mobility model.
* \param v5 the value of the attribute to set in the mobility model.
* \param n6 the name of the attribute to set in the mobility model.
* \param v6 the value of the attribute to set in the mobility model.
* \param n7 the name of the attribute to set in the mobility model.
* \param v7 the value of the attribute to set in the mobility model.
* \param n8 the name of the attribute to set in the mobility model.
* \param v8 the value of the attribute to set in the mobility model.
* \param n9 the name of the attribute to set in the mobility model.
* \param v9 the value of the attribute to set in the mobility model.
* \param [in] args Name and AttributeValue pairs to set.
*
* Calls to MobilityHelper::Install will create an instance of a matching
* mobility model for each node.
*/
void SetMobilityModel (std::string type,
std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (),
std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (),
std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (),
std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue (),
std::string n8 = "", const AttributeValue &v8 = EmptyAttributeValue (),
std::string n9 = "", const AttributeValue &v9 = EmptyAttributeValue ());
template <typename... Ts>
void SetMobilityModel (std::string type, Ts&&... args);
/**
* \param reference item to push.
@@ -289,6 +241,25 @@ private:
Ptr<PositionAllocator> m_position; //!< Position allocator for use in hierarchical mobility model
};
/***************************************************************
* Implementation of the templates declared above.
***************************************************************/
template <typename... Ts>
void MobilityHelper::SetPositionAllocator (std::string type, Ts&&... args)
{
ObjectFactory pos(type, std::forward<Ts> (args)...);
m_position = pos.Create ()->GetObject<PositionAllocator> ();
}
template <typename... Ts>
void MobilityHelper::SetMobilityModel (std::string type, Ts&&... args)
{
m_mobility.SetTypeId (type);
m_mobility.Set (std::forward<Ts> (args)...);
}
} // namespace ns3
#endif /* MOBILITY_HELPER_H */

View File

@@ -22,7 +22,6 @@
#include "ns3/log.h"
#include "ns3/simulator.h"
#include "ns3/object-factory.h"
#include "ns3/queue.h"
#include "ns3/net-device-queue-interface.h"
#include "ns3/simple-net-device.h"
#include "ns3/simple-channel.h"
@@ -49,36 +48,6 @@ SimpleNetDeviceHelper::SimpleNetDeviceHelper ()
m_enableFlowControl = true;
}
void
SimpleNetDeviceHelper::SetQueue (std::string type,
std::string n1, const AttributeValue &v1,
std::string n2, const AttributeValue &v2,
std::string n3, const AttributeValue &v3,
std::string n4, const AttributeValue &v4)
{
QueueBase::AppendItemTypeIfNotPresent (type, "Packet");
m_queueFactory.SetTypeId (type);
m_queueFactory.Set (n1, v1);
m_queueFactory.Set (n2, v2);
m_queueFactory.Set (n3, v3);
m_queueFactory.Set (n4, v4);
}
void
SimpleNetDeviceHelper::SetChannel (std::string type,
std::string n1, const AttributeValue &v1,
std::string n2, const AttributeValue &v2,
std::string n3, const AttributeValue &v3,
std::string n4, const AttributeValue &v4)
{
m_channelFactory.SetTypeId (type);
m_channelFactory.Set (n1, v1);
m_channelFactory.Set (n2, v2);
m_channelFactory.Set (n3, v3);
m_channelFactory.Set (n4, v4);
}
void
SimpleNetDeviceHelper::SetDeviceAttribute (std::string n1, const AttributeValue &v1)
{

View File

@@ -26,6 +26,7 @@
#include "ns3/object-factory.h"
#include "ns3/net-device-container.h"
#include "ns3/node-container.h"
#include "ns3/queue.h"
#include "ns3/simple-channel.h"
namespace ns3 {
@@ -47,48 +48,30 @@ public:
* This method allows one to set the type of the queue that is automatically
* created when the device is created and attached to a node.
*
* \tparam Ts \deduced Argument types
* \param type the type of queue
* \param n1 the name of the attribute to set on the queue
* \param v1 the value of the attribute to set on the queue
* \param n2 the name of the attribute to set on the queue
* \param v2 the value of the attribute to set on the queue
* \param n3 the name of the attribute to set on the queue
* \param v3 the value of the attribute to set on the queue
* \param n4 the name of the attribute to set on the queue
* \param v4 the value of the attribute to set on the queue
* \param [in] args Name and AttributeValue pairs to set.
*
* Set the type of queue to create and associated to each
* SimpleNetDevice created through SimpleNetDeviceHelper::Install.
*/
void SetQueue (std::string type,
std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue ());
template <typename... Ts>
void SetQueue (std::string type, Ts&&... args);
/**
* Each net device must have a channel to pass packets through.
* This method allows one to set the type of the channel that is automatically
* created when the device is created and attached to a node.
*
* \param type the type of queue
* \param n1 the name of the attribute to set on the queue
* \param v1 the value of the attribute to set on the queue
* \param n2 the name of the attribute to set on the queue
* \param v2 the value of the attribute to set on the queue
* \param n3 the name of the attribute to set on the queue
* \param v3 the value of the attribute to set on the queue
* \param n4 the name of the attribute to set on the queue
* \param v4 the value of the attribute to set on the queue
* \tparam Ts \deduced Argument types
* \param type the type of channel
* \param [in] args Name and AttributeValue pairs to set.
*
* Set the type of channel to create and associated to each
* SimpleNetDevice created through SimpleNetDeviceHelper::Install.
*/
void SetChannel (std::string type,
std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue ());
template <typename... Ts>
void SetChannel (std::string type, Ts&&... args);
/**
@@ -195,6 +178,27 @@ private:
bool m_enableFlowControl; //!< whether to enable flow control
};
/***************************************************************
* Implementation of the templates declared above.
***************************************************************/
template <typename... Ts>
void SimpleNetDeviceHelper::SetQueue (std::string type, Ts&&... args)
{
QueueBase::AppendItemTypeIfNotPresent (type, "Packet");
m_queueFactory.SetTypeId (type);
m_queueFactory.Set (std::forward<Ts> (args)...);
}
template <typename... Ts>
void SimpleNetDeviceHelper::SetChannel (std::string type, Ts&&... args)
{
m_channelFactory.SetTypeId (type);
m_channelFactory.Set (std::forward<Ts> (args)...);
}
} // namespace ns3
#endif /* SIMPLE_NETDEVICE_HELPER_H */

View File

@@ -23,7 +23,6 @@
#include "ns3/simulator.h"
#include "ns3/point-to-point-net-device.h"
#include "ns3/point-to-point-channel.h"
#include "ns3/queue.h"
#include "ns3/net-device-queue-interface.h"
#include "ns3/config.h"
#include "ns3/packet.h"
@@ -50,22 +49,6 @@ PointToPointHelper::PointToPointHelper ()
m_enableFlowControl = true;
}
void
PointToPointHelper::SetQueue (std::string type,
std::string n1, const AttributeValue &v1,
std::string n2, const AttributeValue &v2,
std::string n3, const AttributeValue &v3,
std::string n4, const AttributeValue &v4)
{
QueueBase::AppendItemTypeIfNotPresent (type, "Packet");
m_queueFactory.SetTypeId (type);
m_queueFactory.Set (n1, v1);
m_queueFactory.Set (n2, v2);
m_queueFactory.Set (n3, v3);
m_queueFactory.Set (n4, v4);
}
void
PointToPointHelper::SetDeviceAttribute (std::string n1, const AttributeValue &v1)
{

View File

@@ -25,6 +25,7 @@
#include "ns3/object-factory.h"
#include "ns3/net-device-container.h"
#include "ns3/node-container.h"
#include "ns3/queue.h"
#include "ns3/trace-helper.h"
@@ -56,24 +57,15 @@ public:
* This method allows one to set the type of the queue that is automatically
* created when the device is created and attached to a node.
*
* \tparam Ts \deduced Argument types
* \param type the type of queue
* \param n1 the name of the attribute to set on the queue
* \param v1 the value of the attribute to set on the queue
* \param n2 the name of the attribute to set on the queue
* \param v2 the value of the attribute to set on the queue
* \param n3 the name of the attribute to set on the queue
* \param v3 the value of the attribute to set on the queue
* \param n4 the name of the attribute to set on the queue
* \param v4 the value of the attribute to set on the queue
* \param [in] args Name and AttributeValue pairs to set.
*
* Set the type of queue to create and associated to each
* PointToPointNetDevice created through PointToPointHelper::Install.
*/
void SetQueue (std::string type,
std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue ());
template <typename... Ts>
void SetQueue (std::string type, Ts&&... args);
/**
* Set an attribute value to be propagated to each NetDevice created by the
@@ -197,6 +189,20 @@ private:
bool m_enableFlowControl; //!< whether to enable flow control
};
/***************************************************************
* Implementation of the templates declared above.
***************************************************************/
template <typename... Ts>
void PointToPointHelper::SetQueue (std::string type, Ts&&... args)
{
QueueBase::AppendItemTypeIfNotPresent (type, "Packet");
m_queueFactory.SetTypeId (type);
m_queueFactory.Set (std::forward<Ts> (args)...);
}
} // namespace ns3
#endif /* POINT_TO_POINT_HELPER_H */

View File

@@ -90,30 +90,6 @@ AdhocAlohaNoackIdealPhyHelper::SetDeviceAttribute (std::string name, const Attri
m_device.Set (name, v);
}
void
AdhocAlohaNoackIdealPhyHelper::SetAntenna (std::string type,
std::string n0, const AttributeValue &v0,
std::string n1, const AttributeValue &v1,
std::string n2, const AttributeValue &v2,
std::string n3, const AttributeValue &v3,
std::string n4, const AttributeValue &v4,
std::string n5, const AttributeValue &v5,
std::string n6, const AttributeValue &v6,
std::string n7, const AttributeValue &v7)
{
ObjectFactory factory;
factory.SetTypeId (type);
factory.Set (n0, v0);
factory.Set (n1, v1);
factory.Set (n2, v2);
factory.Set (n3, v3);
factory.Set (n4, v4);
factory.Set (n5, v5);
factory.Set (n6, v6);
factory.Set (n7, v7);
m_antenna = factory;
}
NetDeviceContainer
AdhocAlohaNoackIdealPhyHelper::Install (NodeContainer c) const
{

View File

@@ -89,36 +89,14 @@ public:
void SetDeviceAttribute (std::string n1, const AttributeValue &v1);
/**
* \tparam Ts \deduced Argument types
* \param type the type of the model to set
* \param n0 the name of the attribute to set
* \param v0 the value of the attribute to set
* \param n1 the name of the attribute to set
* \param v1 the value of the attribute to set
* \param n2 the name of the attribute to set
* \param v2 the value of the attribute to set
* \param n3 the name of the attribute to set
* \param v3 the value of the attribute to set
* \param n4 the name of the attribute to set
* \param v4 the value of the attribute to set
* \param n5 the name of the attribute to set
* \param v5 the value of the attribute to set
* \param n6 the name of the attribute to set
* \param v6 the value of the attribute to set
* \param n7 the name of the attribute to set
* \param v7 the value of the attribute to set
* \param [in] args Name and AttributeValue pairs to set.
*
* Configure the AntennaModel instance for each new device to be created
*/
void SetAntenna (std::string type,
std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (),
std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (),
std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (),
std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (),
std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue ());
template <typename... Ts>
void SetAntenna (std::string type, Ts&&... args);
/**
* @param c the set of nodes on which a device must be created
@@ -148,6 +126,16 @@ protected:
};
/***************************************************************
* Implementation of the templates declared above.
***************************************************************/
template <typename... Ts>
void AdhocAlohaNoackIdealPhyHelper::SetAntenna (std::string type, Ts&&... args)
{
m_antenna = ObjectFactory (std::forward<Ts> (args)...);
}
} // namespace ns3

View File

@@ -115,30 +115,6 @@ SpectrumAnalyzerHelper::SetDeviceAttribute (std::string name, const AttributeVal
m_device.Set (name, v);
}
void
SpectrumAnalyzerHelper::SetAntenna (std::string type,
std::string n0, const AttributeValue &v0,
std::string n1, const AttributeValue &v1,
std::string n2, const AttributeValue &v2,
std::string n3, const AttributeValue &v3,
std::string n4, const AttributeValue &v4,
std::string n5, const AttributeValue &v5,
std::string n6, const AttributeValue &v6,
std::string n7, const AttributeValue &v7)
{
ObjectFactory factory;
factory.SetTypeId (type);
factory.Set (n0, v0);
factory.Set (n1, v1);
factory.Set (n2, v2);
factory.Set (n3, v3);
factory.Set (n4, v4);
factory.Set (n5, v5);
factory.Set (n6, v6);
factory.Set (n7, v7);
m_antenna = factory;
}
void
SpectrumAnalyzerHelper::SetRxSpectrumModel (Ptr<SpectrumModel> m)

View File

@@ -78,35 +78,14 @@ public:
void SetDeviceAttribute (std::string n1, const AttributeValue &v1);
/**
* \tparam Ts \deduced Argument types
* \param type the type of the model to set
* \param n0 the name of the attribute to set
* \param v0 the value of the attribute to set
* \param n1 the name of the attribute to set
* \param v1 the value of the attribute to set
* \param n2 the name of the attribute to set
* \param v2 the value of the attribute to set
* \param n3 the name of the attribute to set
* \param v3 the value of the attribute to set
* \param n4 the name of the attribute to set
* \param v4 the value of the attribute to set
* \param n5 the name of the attribute to set
* \param v5 the value of the attribute to set
* \param n6 the name of the attribute to set
* \param v6 the value of the attribute to set
* \param n7 the name of the attribute to set
* \param v7 the value of the attribute to set
* \param [in] args Name and AttributeValue pairs to set.
*
* Configure the AntennaModel instance for each new device to be created
*/
void SetAntenna (std::string type,
std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (),
std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (),
std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (),
std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (),
std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue ());
template <typename... Ts>
void SetAntenna (std::string type, Ts&&... args);
/**
* Set the spectrum model used by the created SpectrumAnalyzer instances to represent incoming signals
@@ -151,6 +130,16 @@ private:
};
/***************************************************************
* Implementation of the templates declared above.
***************************************************************/
template <typename... Ts>
void SpectrumAnalyzerHelper::SetAntenna (std::string type, Ts&&... args)
{
m_antenna = ObjectFactory (type, std::forward<Ts> (args)...);
}
} // namespace ns3

View File

@@ -41,54 +41,6 @@ SpectrumChannelHelper::Default (void)
return h;
}
void
SpectrumChannelHelper::SetChannel (std::string type,
std::string n0, const AttributeValue &v0,
std::string n1, const AttributeValue &v1,
std::string n2, const AttributeValue &v2,
std::string n3, const AttributeValue &v3,
std::string n4, const AttributeValue &v4,
std::string n5, const AttributeValue &v5,
std::string n6, const AttributeValue &v6,
std::string n7, const AttributeValue &v7)
{
ObjectFactory factory;
m_channel.SetTypeId (type);
m_channel.Set (n0, v0);
m_channel.Set (n1, v1);
m_channel.Set (n2, v2);
m_channel.Set (n3, v3);
m_channel.Set (n4, v4);
m_channel.Set (n5, v5);
m_channel.Set (n6, v6);
m_channel.Set (n7, v7);
}
void
SpectrumChannelHelper::AddPropagationLoss (std::string type,
std::string n0, const AttributeValue &v0,
std::string n1, const AttributeValue &v1,
std::string n2, const AttributeValue &v2,
std::string n3, const AttributeValue &v3,
std::string n4, const AttributeValue &v4,
std::string n5, const AttributeValue &v5,
std::string n6, const AttributeValue &v6,
std::string n7, const AttributeValue &v7)
{
ObjectFactory factory;
factory.SetTypeId (type);
factory.Set (n0, v0);
factory.Set (n1, v1);
factory.Set (n2, v2);
factory.Set (n3, v3);
factory.Set (n4, v4);
factory.Set (n5, v5);
factory.Set (n6, v6);
factory.Set (n7, v7);
Ptr<PropagationLossModel> m = factory.Create<PropagationLossModel> ();
AddPropagationLoss (m);
}
void
SpectrumChannelHelper::AddPropagationLoss (Ptr<PropagationLossModel> m)
@@ -97,31 +49,6 @@ SpectrumChannelHelper::AddPropagationLoss (Ptr<PropagationLossModel> m)
m_propagationLossModel = m;
}
void
SpectrumChannelHelper::AddSpectrumPropagationLoss (std::string type,
std::string n0, const AttributeValue &v0,
std::string n1, const AttributeValue &v1,
std::string n2, const AttributeValue &v2,
std::string n3, const AttributeValue &v3,
std::string n4, const AttributeValue &v4,
std::string n5, const AttributeValue &v5,
std::string n6, const AttributeValue &v6,
std::string n7, const AttributeValue &v7)
{
ObjectFactory factory;
factory.SetTypeId (type);
factory.Set (n0, v0);
factory.Set (n1, v1);
factory.Set (n2, v2);
factory.Set (n3, v3);
factory.Set (n4, v4);
factory.Set (n5, v5);
factory.Set (n6, v6);
factory.Set (n7, v7);
Ptr<SpectrumPropagationLossModel> m = factory.Create<SpectrumPropagationLossModel> ();
AddSpectrumPropagationLoss (m);
}
void
SpectrumChannelHelper::AddSpectrumPropagationLoss (Ptr<SpectrumPropagationLossModel> m)
{
@@ -129,30 +56,6 @@ SpectrumChannelHelper::AddSpectrumPropagationLoss (Ptr<SpectrumPropagationLossMo
m_spectrumPropagationLossModel = m;
}
void
SpectrumChannelHelper::SetPropagationDelay (std::string type,
std::string n0, const AttributeValue &v0,
std::string n1, const AttributeValue &v1,
std::string n2, const AttributeValue &v2,
std::string n3, const AttributeValue &v3,
std::string n4, const AttributeValue &v4,
std::string n5, const AttributeValue &v5,
std::string n6, const AttributeValue &v6,
std::string n7, const AttributeValue &v7)
{
ObjectFactory factory;
factory.SetTypeId (type);
factory.Set (n0, v0);
factory.Set (n1, v1);
factory.Set (n2, v2);
factory.Set (n3, v3);
factory.Set (n4, v4);
factory.Set (n5, v5);
factory.Set (n6, v6);
factory.Set (n7, v7);
m_propagationDelay = factory;
}
Ptr<SpectrumChannel>
SpectrumChannelHelper::Create (void) const
{
@@ -165,30 +68,6 @@ SpectrumChannelHelper::Create (void) const
}
void
SpectrumPhyHelper::SetPhy (std::string type,
std::string n0, const AttributeValue &v0,
std::string n1, const AttributeValue &v1,
std::string n2, const AttributeValue &v2,
std::string n3, const AttributeValue &v3,
std::string n4, const AttributeValue &v4,
std::string n5, const AttributeValue &v5,
std::string n6, const AttributeValue &v6,
std::string n7, const AttributeValue &v7)
{
m_phy.SetTypeId (type);
m_phy.Set (n0, v0);
m_phy.Set (n1, v1);
m_phy.Set (n2, v2);
m_phy.Set (n3, v3);
m_phy.Set (n4, v4);
m_phy.Set (n5, v5);
m_phy.Set (n6, v6);
m_phy.Set (n7, v7);
}
void
SpectrumPhyHelper::SetChannel (Ptr<SpectrumChannel> channel)
{

View File

@@ -55,63 +55,21 @@ public:
static SpectrumChannelHelper Default ();
/**
* \tparam Ts \deduced Argument types
* \param type the type of the SpectrumChannel to use
* \param n0 the name of the attribute to set
* \param v0 the value of the attribute to set
* \param n1 the name of the attribute to set
* \param v1 the value of the attribute to set
* \param n2 the name of the attribute to set
* \param v2 the value of the attribute to set
* \param n3 the name of the attribute to set
* \param v3 the value of the attribute to set
* \param n4 the name of the attribute to set
* \param v4 the value of the attribute to set
* \param n5 the name of the attribute to set
* \param v5 the value of the attribute to set
* \param n6 the name of the attribute to set
* \param v6 the value of the attribute to set
* \param n7 the name of the attribute to set
* \param v7 the value of the attribute to set
* \param [in] args Name and AttributeValue pairs to set.
*/
void SetChannel (std::string type,
std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (),
std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (),
std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (),
std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (),
std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue ());
template <typename... Ts>
void SetChannel (std::string type, Ts&&... args);
/**
* \tparam Ts \deduced Argument types
* \param name the name of the model to set
* \param n0 the name of the attribute to set
* \param v0 the value of the attribute to set
* \param n1 the name of the attribute to set
* \param v1 the value of the attribute to set
* \param n2 the name of the attribute to set
* \param v2 the value of the attribute to set
* \param n3 the name of the attribute to set
* \param v3 the value of the attribute to set
* \param n4 the name of the attribute to set
* \param v4 the value of the attribute to set
* \param n5 the name of the attribute to set
* \param v5 the value of the attribute to set
* \param n6 the name of the attribute to set
* \param v6 the value of the attribute to set
* \param n7 the name of the attribute to set
* \param v7 the value of the attribute to set
* \param [in] args Name and AttributeValue pairs to set.
*
* Add a new single-frequency propagation loss model to this channel helper.
*/
void AddPropagationLoss (std::string name,
std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (),
std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (),
std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (),
std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (),
std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue ());
template <typename... Ts>
void AddPropagationLoss (std::string name, Ts&&... args);
/**
@@ -122,35 +80,14 @@ public:
void AddPropagationLoss (Ptr<PropagationLossModel> m);
/**
* \tparam Ts \deduced Argument types
* \param name the name of the model to set
* \param n0 the name of the attribute to set
* \param v0 the value of the attribute to set
* \param n1 the name of the attribute to set
* \param v1 the value of the attribute to set
* \param n2 the name of the attribute to set
* \param v2 the value of the attribute to set
* \param n3 the name of the attribute to set
* \param v3 the value of the attribute to set
* \param n4 the name of the attribute to set
* \param v4 the value of the attribute to set
* \param n5 the name of the attribute to set
* \param v5 the value of the attribute to set
* \param n6 the name of the attribute to set
* \param v6 the value of the attribute to set
* \param n7 the name of the attribute to set
* \param v7 the value of the attribute to set
* \param [in] args Name and AttributeValue pairs to set.
*
* Add a new frequency-dependent propagation loss model to this channel helper.
*/
void AddSpectrumPropagationLoss (std::string name,
std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (),
std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (),
std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (),
std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (),
std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue ());
template <typename... Ts>
void AddSpectrumPropagationLoss (std::string name, Ts&&... args);
/**
* Add a new frequency-dependent propagation loss model instance to this channel helper.
@@ -160,35 +97,14 @@ public:
void AddSpectrumPropagationLoss (Ptr<SpectrumPropagationLossModel> m);
/**
* \tparam Ts \deduced Argument types
* \param name the name of the model to set
* \param n0 the name of the attribute to set
* \param v0 the value of the attribute to set
* \param n1 the name of the attribute to set
* \param v1 the value of the attribute to set
* \param n2 the name of the attribute to set
* \param v2 the value of the attribute to set
* \param n3 the name of the attribute to set
* \param v3 the value of the attribute to set
* \param n4 the name of the attribute to set
* \param v4 the value of the attribute to set
* \param n5 the name of the attribute to set
* \param v5 the value of the attribute to set
* \param n6 the name of the attribute to set
* \param v6 the value of the attribute to set
* \param n7 the name of the attribute to set
* \param v7 the value of the attribute to set
* \param [in] args Name and AttributeValue pairs to set.
*
* Configure a propagation delay for this channel.
*/
void SetPropagationDelay (std::string name,
std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (),
std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (),
std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (),
std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (),
std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue ());
template <typename... Ts>
void SetPropagationDelay (std::string name, Ts&&... args);
/**
* \returns a new channel
@@ -215,33 +131,12 @@ class SpectrumPhyHelper
{
public:
/**
* \tparam Ts \deduced Argument types
* \param name the type of SpectrumPhy to use
* \param n0 the name of the attribute to set
* \param v0 the value of the attribute to set
* \param n1 the name of the attribute to set
* \param v1 the value of the attribute to set
* \param n2 the name of the attribute to set
* \param v2 the value of the attribute to set
* \param n3 the name of the attribute to set
* \param v3 the value of the attribute to set
* \param n4 the name of the attribute to set
* \param v4 the value of the attribute to set
* \param n5 the name of the attribute to set
* \param v5 the value of the attribute to set
* \param n6 the name of the attribute to set
* \param v6 the value of the attribute to set
* \param n7 the name of the attribute to set
* \param v7 the value of the attribute to set
* \param [in] args Name and AttributeValue pairs to set.
*/
void SetPhy (std::string name,
std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (),
std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (),
std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (),
std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (),
std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue ());
template <typename... Ts>
void SetPhy (std::string name, Ts&&... args);
/**
* set the channel that will be used by SpectrumPhy instances created by this helper
@@ -282,6 +177,46 @@ private:
};
/***************************************************************
* Implementation of the templates declared above.
***************************************************************/
template <typename... Ts>
void SpectrumChannelHelper::SetChannel (std::string type, Ts&&... args)
{
m_channel.SetTypeId (type);
m_channel.Set (std::forward<Ts> (args)...);
}
template <typename... Ts>
void SpectrumChannelHelper::AddPropagationLoss (std::string name, Ts&&... args)
{
ObjectFactory factory (name, std::forward<Ts> (args)...);
Ptr<PropagationLossModel> m = factory.Create<PropagationLossModel> ();
AddPropagationLoss (m);
}
template <typename... Ts>
void SpectrumChannelHelper::AddSpectrumPropagationLoss (std::string name, Ts&&... args)
{
ObjectFactory factory (name, std::forward<Ts> (args)...);
Ptr<SpectrumPropagationLossModel> m = factory.Create<SpectrumPropagationLossModel> ();
AddSpectrumPropagationLoss (m);
}
template <typename... Ts>
void SpectrumChannelHelper::SetPropagationDelay (std::string name, Ts&&... args)
{
m_propagationDelay = ObjectFactory (name, std::forward<Ts> (args)...);
}
template <typename... Ts>
void SpectrumPhyHelper::SetPhy (std::string name, Ts&&... args)
{
m_phy.SetTypeId (name);
m_phy.Set (std::forward<Ts> (args)...);
}
} // namespace ns3
#endif /* SPECTRUM_HELPER_H */

View File

@@ -82,30 +82,6 @@ WaveformGeneratorHelper::SetDeviceAttribute (std::string name, const AttributeVa
m_device.Set (name, v);
}
void
WaveformGeneratorHelper::SetAntenna (std::string type,
std::string n0, const AttributeValue &v0,
std::string n1, const AttributeValue &v1,
std::string n2, const AttributeValue &v2,
std::string n3, const AttributeValue &v3,
std::string n4, const AttributeValue &v4,
std::string n5, const AttributeValue &v5,
std::string n6, const AttributeValue &v6,
std::string n7, const AttributeValue &v7)
{
ObjectFactory factory;
factory.SetTypeId (type);
factory.Set (n0, v0);
factory.Set (n1, v1);
factory.Set (n2, v2);
factory.Set (n3, v3);
factory.Set (n4, v4);
factory.Set (n5, v5);
factory.Set (n6, v6);
factory.Set (n7, v7);
m_antenna = factory;
}
NetDeviceContainer
WaveformGeneratorHelper::Install (NodeContainer c) const
{

View File

@@ -87,35 +87,14 @@ public:
void SetDeviceAttribute (std::string n1, const AttributeValue &v1);
/**
* \tparam Ts \deduced Argument types
* \param type the type of the model to set
* \param n0 the name of the attribute to set
* \param v0 the value of the attribute to set
* \param n1 the name of the attribute to set
* \param v1 the value of the attribute to set
* \param n2 the name of the attribute to set
* \param v2 the value of the attribute to set
* \param n3 the name of the attribute to set
* \param v3 the value of the attribute to set
* \param n4 the name of the attribute to set
* \param v4 the value of the attribute to set
* \param n5 the name of the attribute to set
* \param v5 the value of the attribute to set
* \param n6 the name of the attribute to set
* \param v6 the value of the attribute to set
* \param n7 the name of the attribute to set
* \param v7 the value of the attribute to set
* \param [in] args Name and AttributeValue pairs to set.
*
* Configure the AntennaModel instance for each new device to be created
*/
void SetAntenna (std::string type,
std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (),
std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (),
std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (),
std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (),
std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue ());
template <typename... Ts>
void SetAntenna (std::string type, Ts&&... args);
/**
* @param c the set of nodes on which a device must be created
@@ -143,6 +122,17 @@ protected:
};
/***************************************************************
* Implementation of the templates declared above.
***************************************************************/
template <typename... Ts>
void WaveformGeneratorHelper::SetAntenna (std::string type, Ts&&... args)
{
m_antenna = ObjectFactory (type, std::forward<Ts> (args)...);
}
} // namespace ns3

View File

@@ -91,77 +91,6 @@ UanHelper::~UanHelper ()
}
void
UanHelper::SetMac (std::string macType,
std::string n0, const AttributeValue &v0,
std::string n1, const AttributeValue &v1,
std::string n2, const AttributeValue &v2,
std::string n3, const AttributeValue &v3,
std::string n4, const AttributeValue &v4,
std::string n5, const AttributeValue &v5,
std::string n6, const AttributeValue &v6,
std::string n7, const AttributeValue &v7)
{
m_mac = ObjectFactory ();
m_mac.SetTypeId (macType);
m_mac.Set (n0, v0);
m_mac.Set (n1, v1);
m_mac.Set (n2, v2);
m_mac.Set (n3, v3);
m_mac.Set (n4, v4);
m_mac.Set (n5, v5);
m_mac.Set (n6, v6);
m_mac.Set (n7, v7);
}
void
UanHelper::SetPhy (std::string phyType,
std::string n0, const AttributeValue &v0,
std::string n1, const AttributeValue &v1,
std::string n2, const AttributeValue &v2,
std::string n3, const AttributeValue &v3,
std::string n4, const AttributeValue &v4,
std::string n5, const AttributeValue &v5,
std::string n6, const AttributeValue &v6,
std::string n7, const AttributeValue &v7)
{
m_phy = ObjectFactory ();
m_phy.SetTypeId (phyType);
m_phy.Set (n0, v0);
m_phy.Set (n1, v1);
m_phy.Set (n2, v2);
m_phy.Set (n3, v3);
m_phy.Set (n4, v4);
m_phy.Set (n5, v5);
m_phy.Set (n6, v6);
m_phy.Set (n7, v7);
}
void
UanHelper::SetTransducer (std::string type,
std::string n0, const AttributeValue &v0,
std::string n1, const AttributeValue &v1,
std::string n2, const AttributeValue &v2,
std::string n3, const AttributeValue &v3,
std::string n4, const AttributeValue &v4,
std::string n5, const AttributeValue &v5,
std::string n6, const AttributeValue &v6,
std::string n7, const AttributeValue &v7)
{
m_transducer = ObjectFactory ();
m_transducer.SetTypeId (type);
m_transducer.Set (n0, v0);
m_transducer.Set (n1, v1);
m_transducer.Set (n2, v2);
m_transducer.Set (n3, v3);
m_transducer.Set (n4, v4);
m_transducer.Set (n5, v5);
m_transducer.Set (n6, v6);
m_transducer.Set (n7, v7);
}
void
UanHelper::EnableAscii (std::ostream &os, uint32_t nodeid, uint32_t deviceid)
{

View File

@@ -46,106 +46,42 @@ public:
/**
* Set MAC attributes.
*
* \tparam Ts \deduced Argument types
* \param type The type of ns3::UanMac to create.
* \param n0 The name of the attribute to set.
* \param v0 The value of the attribute to set.
* \param n1 The name of the attribute to set.
* \param v1 The value of the attribute to set.
* \param n2 The name of the attribute to set.
* \param v2 The value of the attribute to set.
* \param n3 The name of the attribute to set.
* \param v3 The value of the attribute to set.
* \param n4 The name of the attribute to set.
* \param v4 The value of the attribute to set.
* \param n5 The name of the attribute to set.
* \param v5 The value of the attribute to set.
* \param n6 The name of the attribute to set.
* \param v6 The value of the attribute to set.
* \param n7 The name of the attribute to set.
* \param v7 The value of the attribute to set.
* \param [in] args Name and AttributeValue pairs to set.
*
* All the attributes specified in this method should exist
* in the requested mac.
*/
void SetMac (std::string type,
std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (),
std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (),
std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (),
std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (),
std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue ());
template <typename... Ts>
void SetMac (std::string type, Ts&&... args);
/**
* Set PHY attributes.
*
* \tparam Ts \deduced Argument types
* \param phyType The type of ns3::UanPhy to create.
* \param n0 The name of the attribute to set.
* \param v0 The value of the attribute to set.
* \param n1 The name of the attribute to set.
* \param v1 The value of the attribute to set.
* \param n2 The name of the attribute to set.
* \param v2 The value of the attribute to set.
* \param n3 The name of the attribute to set.
* \param v3 The value of the attribute to set.
* \param n4 The name of the attribute to set.
* \param v4 The value of the attribute to set.
* \param n5 The name of the attribute to set.
* \param v5 The value of the attribute to set.
* \param n6 The name of the attribute to set.
* \param v6 The value of the attribute to set.
* \param n7 The name of the attribute to set.
* \param v7 The value of the attribute to set.
* \param [in] args Name and AttributeValue pairs to set.
*
* All the attributes specified in this method should exist
* in the requested Phy.
*/
void SetPhy (std::string phyType,
std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (),
std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (),
std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (),
std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (),
std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue ());
template <typename... Ts>
void SetPhy (std::string phyType, Ts&&... args);
/**
* Set the transducer attributes.
*
* \tparam Ts \deduced Argument types
* \param type The type of ns3::Transducer to create.
* \param n0 The name of the attribute to set.
* \param v0 The value of the attribute to set.
* \param n1 The name of the attribute to set.
* \param v1 The value of the attribute to set.
* \param n2 The name of the attribute to set.
* \param v2 The value of the attribute to set.
* \param n3 The name of the attribute to set.
* \param v3 The value of the attribute to set.
* \param n4 The name of the attribute to set.
* \param v4 The value of the attribute to set.
* \param n5 The name of the attribute to set.
* \param v5 The value of the attribute to set.
* \param n6 The name of the attribute to set.
* \param v6 The value of the attribute to set.
* \param n7 The name of the attribute to set.
* \param v7 The value of the attribute to set.
* \param [in] args Name and AttributeValue pairs to set.
*
* All the attributes specified in this method should exist
* in the requested transducer.
*/
void SetTransducer (std::string type,
std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (),
std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (),
std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (),
std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (),
std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue ());
template <typename... Ts>
void SetTransducer (std::string type, Ts&&... args);
/**
* Enable ascii output on the specified deviceid within the
* specified nodeid if it is of type ns3::UanNetDevice and dump
@@ -254,6 +190,28 @@ private:
};
/***************************************************************
* Implementation of the templates declared above.
***************************************************************/
template <typename... Ts>
void UanHelper::SetMac (std::string type, Ts&&... args)
{
m_mac = ObjectFactory (type, std::forward<Ts> (args)...);
}
template <typename... Ts>
void UanHelper::SetPhy (std::string phyType, Ts&&... args)
{
m_phy = ObjectFactory (phyType, std::forward<Ts> (args)...);
}
template <typename... Ts>
void UanHelper::SetTransducer (std::string type, Ts&&... args)
{
m_transducer = ObjectFactory (type, std::forward<Ts> (args)...);
}
} // end namespace ns3
#endif /* UAN_HELPER_H */

View File

@@ -311,52 +311,6 @@ WaveHelper::CreatePhys (uint32_t phys)
m_physNumber = phys;
}
void
WaveHelper::SetRemoteStationManager (std::string type,
std::string n0, const AttributeValue &v0,
std::string n1, const AttributeValue &v1,
std::string n2, const AttributeValue &v2,
std::string n3, const AttributeValue &v3,
std::string n4, const AttributeValue &v4,
std::string n5, const AttributeValue &v5,
std::string n6, const AttributeValue &v6,
std::string n7, const AttributeValue &v7)
{
m_stationManager = ObjectFactory ();
m_stationManager.SetTypeId (type);
m_stationManager.Set (n0, v0);
m_stationManager.Set (n1, v1);
m_stationManager.Set (n2, v2);
m_stationManager.Set (n3, v3);
m_stationManager.Set (n4, v4);
m_stationManager.Set (n5, v5);
m_stationManager.Set (n6, v6);
m_stationManager.Set (n7, v7);
}
void
WaveHelper::SetChannelScheduler (std::string type,
std::string n0, const AttributeValue &v0,
std::string n1, const AttributeValue &v1,
std::string n2, const AttributeValue &v2,
std::string n3, const AttributeValue &v3,
std::string n4, const AttributeValue &v4,
std::string n5, const AttributeValue &v5,
std::string n6, const AttributeValue &v6,
std::string n7, const AttributeValue &v7)
{
m_channelScheduler = ObjectFactory ();
m_channelScheduler.SetTypeId (type);
m_channelScheduler.Set (n0, v0);
m_channelScheduler.Set (n1, v1);
m_channelScheduler.Set (n2, v2);
m_channelScheduler.Set (n3, v3);
m_channelScheduler.Set (n4, v4);
m_channelScheduler.Set (n5, v5);
m_channelScheduler.Set (n6, v6);
m_channelScheduler.Set (n7, v7);
}
NetDeviceContainer
WaveHelper::Install (const WifiPhyHelper &phyHelper, const WifiMacHelper &macHelper, NodeContainer c) const
{

View File

@@ -136,67 +136,25 @@ public:
void CreatePhys (uint32_t phys);
/**
* \tparam Ts \deduced Argument types
* \param type the type of ns3::WifiRemoteStationManager to create.
* \param n0 the name of the attribute to set
* \param v0 the value of the attribute to set
* \param n1 the name of the attribute to set
* \param v1 the value of the attribute to set
* \param n2 the name of the attribute to set
* \param v2 the value of the attribute to set
* \param n3 the name of the attribute to set
* \param v3 the value of the attribute to set
* \param n4 the name of the attribute to set
* \param v4 the value of the attribute to set
* \param n5 the name of the attribute to set
* \param v5 the value of the attribute to set
* \param n6 the name of the attribute to set
* \param v6 the value of the attribute to set
* \param n7 the name of the attribute to set
* \param v7 the value of the attribute to set
* \param [in] args Name and AttributeValue pairs to set.
*
* All the attributes specified in this method should exist
* in the requested station manager.
*/
void SetRemoteStationManager (std::string type,
std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (),
std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (),
std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (),
std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (),
std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue ());
template <typename... Ts>
void SetRemoteStationManager (std::string type, Ts&&... args);
/**
* \tparam Ts \deduced Argument types
* \param type the type of ns3::ChannelScheduler to create.
* \param n0 the name of the attribute to set
* \param v0 the value of the attribute to set
* \param n1 the name of the attribute to set
* \param v1 the value of the attribute to set
* \param n2 the name of the attribute to set
* \param v2 the value of the attribute to set
* \param n3 the name of the attribute to set
* \param v3 the value of the attribute to set
* \param n4 the name of the attribute to set
* \param v4 the value of the attribute to set
* \param n5 the name of the attribute to set
* \param v5 the value of the attribute to set
* \param n6 the name of the attribute to set
* \param v6 the value of the attribute to set
* \param n7 the name of the attribute to set
* \param v7 the value of the attribute to set
* \param [in] args Name and AttributeValue pairs to set.
*
* All the attributes specified in this method should exist
* in the requested channel scheduler.
*/
void SetChannelScheduler (std::string type,
std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (),
std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (),
std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (),
std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (),
std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue ());
template <typename... Ts>
void SetChannelScheduler (std::string type, Ts&&... args);
/**
* \param phy the PHY helper to create PHY objects
@@ -250,5 +208,24 @@ protected:
std::vector<uint32_t> m_macsForChannelNumber; ///< MACs for channel number
uint32_t m_physNumber; ///< Phy number
};
/***************************************************************
* Implementation of the templates declared above.
***************************************************************/
template <typename... Ts>
void WaveHelper::SetRemoteStationManager (std::string type, Ts&&... args)
{
m_stationManager = ObjectFactory (type, std::forward<Ts> (args)...);
}
template <typename... Ts>
void WaveHelper::SetChannelScheduler (std::string type, Ts&&... args)
{
m_channelScheduler = ObjectFactory (type, std::forward<Ts> (args)...);
}
}
#endif /* WAVE_HELPER_H */

View File

@@ -45,37 +45,6 @@ NqosWaveMacHelper::Default (void)
helper.SetType ("ns3::OcbWifiMac", "QosSupported", BooleanValue (false));
return helper;
}
void
NqosWaveMacHelper::SetType (std::string type,
std::string n0, const AttributeValue &v0,
std::string n1, const AttributeValue &v1,
std::string n2, const AttributeValue &v2,
std::string n3, const AttributeValue &v3,
std::string n4, const AttributeValue &v4,
std::string n5, const AttributeValue &v5,
std::string n6, const AttributeValue &v6,
std::string n7, const AttributeValue &v7,
std::string n8, const AttributeValue &v8,
std::string n9, const AttributeValue &v9,
std::string n10, const AttributeValue &v10)
{
if (type.compare ("ns3::OcbWifiMac") != 0)
{
NS_FATAL_ERROR ("QosWaveMacHelper shall set OcbWifiMac");
}
WifiMacHelper::SetType ("ns3::OcbWifiMac",
n0, v0,
n1, v1,
n2, v2,
n3, v3,
n4, v4,
n5, v5,
n6, v6,
n7, v7,
n8, v8,
n9, v9,
n10, v10);
}
/********** QosWifi80211pMacHelper *********/
QosWaveMacHelper::QosWaveMacHelper ()
@@ -97,36 +66,4 @@ QosWaveMacHelper::Default (void)
return helper;
}
void
QosWaveMacHelper::SetType (std::string type,
std::string n0, const AttributeValue &v0,
std::string n1, const AttributeValue &v1,
std::string n2, const AttributeValue &v2,
std::string n3, const AttributeValue &v3,
std::string n4, const AttributeValue &v4,
std::string n5, const AttributeValue &v5,
std::string n6, const AttributeValue &v6,
std::string n7, const AttributeValue &v7,
std::string n8, const AttributeValue &v8,
std::string n9, const AttributeValue &v9,
std::string n10, const AttributeValue &v10)
{
if (type.compare ("ns3::OcbWifiMac") != 0)
{
NS_FATAL_ERROR ("QosWaveMacHelper shall set OcbWifiMac");
}
WifiMacHelper::SetType ("ns3::OcbWifiMac",
n0, v0,
n1, v1,
n2, v2,
n3, v3,
n4, v4,
n5, v5,
n6, v6,
n7, v7,
n8, v8,
n9, v9,
n10, v10);
}
} // namespace ns3

View File

@@ -51,29 +51,9 @@ public:
*/
static NqosWaveMacHelper Default (void);
/**
* \tparam Ts \deduced Argument types
* \param type the type of ns3::WifiMac to create.
* \param n0 the name of the attribute to set
* \param v0 the value of the attribute to set
* \param n1 the name of the attribute to set
* \param v1 the value of the attribute to set
* \param n2 the name of the attribute to set
* \param v2 the value of the attribute to set
* \param n3 the name of the attribute to set
* \param v3 the value of the attribute to set
* \param n4 the name of the attribute to set
* \param v4 the value of the attribute to set
* \param n5 the name of the attribute to set
* \param v5 the value of the attribute to set
* \param n6 the name of the attribute to set
* \param v6 the value of the attribute to set
* \param n7 the name of the attribute to set
* \param v7 the value of the attribute to set
* \param n8 the value of the attribute to set
* \param v8 the value of the attribute to set
* \param n9 the value of the attribute to set
* \param v9 the value of the attribute to set
* \param n10 the value of the attribute to set
* \param v10 the value of the attribute to set
* \param [in] args Name and AttributeValue pairs to set.
*
* All the attributes specified in this method should exist
* in the requested mac.
@@ -81,18 +61,8 @@ public:
* note: Here we require users set type with OcbWifiMac or its
* subclass, otherwise it will become error
*/
virtual void SetType (std::string type,
std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (),
std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (),
std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (),
std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (),
std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue (),
std::string n8 = "", const AttributeValue &v8 = EmptyAttributeValue (),
std::string n9 = "", const AttributeValue &v9 = EmptyAttributeValue (),
std::string n10 = "", const AttributeValue &v10 = EmptyAttributeValue ());
template <typename... Ts>
void SetType (std::string type, Ts&&... args);
};
/**
@@ -120,29 +90,9 @@ public:
static QosWaveMacHelper Default (void);
/**
* \tparam Ts \deduced Argument types
* \param type the type of ns3::WifiMac to create.
* \param n0 the name of the attribute to set
* \param v0 the value of the attribute to set
* \param n1 the name of the attribute to set
* \param v1 the value of the attribute to set
* \param n2 the name of the attribute to set
* \param v2 the value of the attribute to set
* \param n3 the name of the attribute to set
* \param v3 the value of the attribute to set
* \param n4 the name of the attribute to set
* \param v4 the value of the attribute to set
* \param n5 the name of the attribute to set
* \param v5 the value of the attribute to set
* \param n6 the name of the attribute to set
* \param v6 the value of the attribute to set
* \param n7 the name of the attribute to set
* \param v7 the value of the attribute to set
* \param n8 the value of the attribute to set
* \param v8 the value of the attribute to set
* \param n9 the value of the attribute to set
* \param v9 the value of the attribute to set
* \param n10 the value of the attribute to set
* \param v10 the value of the attribute to set
* \param [in] args Name and AttributeValue pairs to set.
*
* All the attributes specified in this method should exist
* in the requested mac.
@@ -150,20 +100,36 @@ public:
* note: Here we require users set type with OcbWifiMac or its
* subclass, otherwise it will become error
*/
virtual void SetType (std::string type,
std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (),
std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (),
std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (),
std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (),
std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue (),
std::string n8 = "", const AttributeValue &v8 = EmptyAttributeValue (),
std::string n9 = "", const AttributeValue &v9 = EmptyAttributeValue (),
std::string n10 = "", const AttributeValue &v10 = EmptyAttributeValue ());
template <typename... Ts>
void SetType (std::string type, Ts&&... args);
};
/***************************************************************
* Implementation of the templates declared above.
***************************************************************/
template <typename... Ts>
void NqosWaveMacHelper::SetType (std::string type, Ts&&... args)
{
if (type.compare ("ns3::OcbWifiMac") != 0)
{
NS_FATAL_ERROR ("QosWaveMacHelper shall set OcbWifiMac");
}
WifiMacHelper::SetType ("ns3::OcbWifiMac", std::forward<Ts> (args)...);
}
template <typename... Ts>
void QosWaveMacHelper::SetType (std::string type, Ts&&... args)
{
if (type.compare ("ns3::OcbWifiMac") != 0)
{
NS_FATAL_ERROR ("QosWaveMacHelper shall set OcbWifiMac");
}
WifiMacHelper::SetType ("ns3::OcbWifiMac", std::forward<Ts> (args)...);
}
}
#endif /* WAVE_MAC_HELPER_H */

View File

@@ -56,30 +56,6 @@ WifiRadioEnergyModelHelper::SetRechargedCallback (
m_rechargedCallback = callback;
}
void
WifiRadioEnergyModelHelper::SetTxCurrentModel (std::string name,
std::string n0, const AttributeValue& v0,
std::string n1, const AttributeValue& v1,
std::string n2, const AttributeValue& v2,
std::string n3, const AttributeValue& v3,
std::string n4, const AttributeValue& v4,
std::string n5, const AttributeValue& v5,
std::string n6, const AttributeValue& v6,
std::string n7, const AttributeValue& v7)
{
ObjectFactory factory;
factory.SetTypeId (name);
factory.Set (n0, v0);
factory.Set (n1, v1);
factory.Set (n2, v2);
factory.Set (n3, v3);
factory.Set (n4, v4);
factory.Set (n5, v5);
factory.Set (n6, v6);
factory.Set (n7, v7);
m_txCurrentModel = factory;
}
/*
* Private function starts here.

View File

@@ -69,35 +69,14 @@ public:
void SetRechargedCallback (WifiRadioEnergyModel::WifiRadioEnergyRechargedCallback callback);
/**
* \tparam Ts \deduced Argument types
* \param name the name of the model to set
* \param n0 the name of the attribute to set
* \param v0 the value of the attribute to set
* \param n1 the name of the attribute to set
* \param v1 the value of the attribute to set
* \param n2 the name of the attribute to set
* \param v2 the value of the attribute to set
* \param n3 the name of the attribute to set
* \param v3 the value of the attribute to set
* \param n4 the name of the attribute to set
* \param v4 the value of the attribute to set
* \param n5 the name of the attribute to set
* \param v5 the value of the attribute to set
* \param n6 the name of the attribute to set
* \param v6 the value of the attribute to set
* \param n7 the name of the attribute to set
* \param v7 the value of the attribute to set
* \param [in] args Name and AttributeValue pairs to set.
*
* Configure a Transmission Current model for this EnergySource.
*/
void SetTxCurrentModel (std::string name,
std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (),
std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (),
std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (),
std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (),
std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue ());
template <typename... Ts>
void SetTxCurrentModel (std::string name, Ts&&... args);
private:
/**
@@ -118,6 +97,19 @@ private:
};
/***************************************************************
* Implementation of the templates declared above.
***************************************************************/
template <typename... Ts>
void WifiRadioEnergyModelHelper::SetTxCurrentModel (std::string name, Ts&&... args)
{
m_txCurrentModel = ObjectFactory (name, std::forward<Ts> (args)...);
}
} // namespace ns3
#endif /* WIFI_RADIO_ENERGY_MODEL_HELPER_H */

View File

@@ -48,54 +48,6 @@ YansWifiChannelHelper::Default (void)
return helper;
}
void
YansWifiChannelHelper::AddPropagationLoss (std::string type,
std::string n0, const AttributeValue &v0,
std::string n1, const AttributeValue &v1,
std::string n2, const AttributeValue &v2,
std::string n3, const AttributeValue &v3,
std::string n4, const AttributeValue &v4,
std::string n5, const AttributeValue &v5,
std::string n6, const AttributeValue &v6,
std::string n7, const AttributeValue &v7)
{
ObjectFactory factory;
factory.SetTypeId (type);
factory.Set (n0, v0);
factory.Set (n1, v1);
factory.Set (n2, v2);
factory.Set (n3, v3);
factory.Set (n4, v4);
factory.Set (n5, v5);
factory.Set (n6, v6);
factory.Set (n7, v7);
m_propagationLoss.push_back (factory);
}
void
YansWifiChannelHelper::SetPropagationDelay (std::string type,
std::string n0, const AttributeValue &v0,
std::string n1, const AttributeValue &v1,
std::string n2, const AttributeValue &v2,
std::string n3, const AttributeValue &v3,
std::string n4, const AttributeValue &v4,
std::string n5, const AttributeValue &v5,
std::string n6, const AttributeValue &v6,
std::string n7, const AttributeValue &v7)
{
ObjectFactory factory;
factory.SetTypeId (type);
factory.Set (n0, v0);
factory.Set (n1, v1);
factory.Set (n2, v2);
factory.Set (n3, v3);
factory.Set (n4, v4);
factory.Set (n5, v5);
factory.Set (n6, v6);
factory.Set (n7, v7);
m_propagationDelay = factory;
}
Ptr<YansWifiChannel>
YansWifiChannelHelper::Create (void) const
{

View File

@@ -52,23 +52,9 @@ public:
static YansWifiChannelHelper Default (void);
/**
* \tparam Ts \deduced Argument types
* \param name the name of the model to add
* \param n0 the name of the attribute to set
* \param v0 the value of the attribute to set
* \param n1 the name of the attribute to set
* \param v1 the value of the attribute to set
* \param n2 the name of the attribute to set
* \param v2 the value of the attribute to set
* \param n3 the name of the attribute to set
* \param v3 the value of the attribute to set
* \param n4 the name of the attribute to set
* \param v4 the value of the attribute to set
* \param n5 the name of the attribute to set
* \param v5 the value of the attribute to set
* \param n6 the name of the attribute to set
* \param v6 the value of the attribute to set
* \param n7 the name of the attribute to set
* \param v7 the value of the attribute to set
* \param [in] args Name and AttributeValue pairs to set.
*
* Add a propagation loss model to the set of currently-configured loss models.
* This method is additive to allow you to construct complex propagation loss models
@@ -79,45 +65,17 @@ public:
* are therefore not commutative. The final receive power (excluding receiver
* gains) are calculated in the order the models are added.
*/
void AddPropagationLoss (std::string name,
std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (),
std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (),
std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (),
std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (),
std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue ());
template <typename... Ts>
void AddPropagationLoss (std::string name, Ts&&... args);
/**
* \tparam Ts \deduced Argument types
* \param name the name of the model to set
* \param n0 the name of the attribute to set
* \param v0 the value of the attribute to set
* \param n1 the name of the attribute to set
* \param v1 the value of the attribute to set
* \param n2 the name of the attribute to set
* \param v2 the value of the attribute to set
* \param n3 the name of the attribute to set
* \param v3 the value of the attribute to set
* \param n4 the name of the attribute to set
* \param v4 the value of the attribute to set
* \param n5 the name of the attribute to set
* \param v5 the value of the attribute to set
* \param n6 the name of the attribute to set
* \param v6 the value of the attribute to set
* \param n7 the name of the attribute to set
* \param v7 the value of the attribute to set
* \param [in] args Name and AttributeValue pairs to set.
*
* Configure a propagation delay for this channel.
*/
void SetPropagationDelay (std::string name,
std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (),
std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (),
std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (),
std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (),
std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue ());
template <typename... Ts>
void SetPropagationDelay (std::string name, Ts&&... args);
/**
* \returns a new channel
@@ -192,6 +150,24 @@ private:
Ptr<YansWifiChannel> m_channel; ///< YANS wifi channel
};
/***************************************************************
* Implementation of the templates declared above.
***************************************************************/
template <typename... Ts>
void YansWifiChannelHelper::AddPropagationLoss (std::string name, Ts&&... args)
{
m_propagationLoss.push_back (ObjectFactory (name, std::forward<Ts> (args)...));
}
template <typename... Ts>
void YansWifiChannelHelper::SetPropagationDelay (std::string name, Ts&&... args)
{
m_propagationDelay = ObjectFactory (name, std::forward<Ts> (args)...);
}
} //namespace ns3
#endif /* YANS_WIFI_HELPER_H */