Backed out changeset d120f5c38317

This commit is contained in:
Alexander Krotov
2018-07-20 10:54:37 +03:00
parent 85d08c96e7
commit 93ce5ba2f7
6 changed files with 2 additions and 120 deletions

View File

@@ -124,7 +124,6 @@ YansWavePhyHelper::Default (void)
{
YansWavePhyHelper helper;
helper.SetErrorRateModel ("ns3::NistErrorRateModel");
helper.SetFrameCaptureModel ("ns3::NoOpFrameCaptureModel");
return helper;
}

View File

@@ -159,29 +159,6 @@ WifiPhyHelper::SetErrorRateModel (std::string name,
m_errorRateModel.Set (n7, v7);
}
void
WifiPhyHelper::SetFrameCaptureModel (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)
{
m_frameCaptureModel = ObjectFactory ();
m_frameCaptureModel.SetTypeId (name);
m_frameCaptureModel.Set (n0, v0);
m_frameCaptureModel.Set (n1, v1);
m_frameCaptureModel.Set (n2, v2);
m_frameCaptureModel.Set (n3, v3);
m_frameCaptureModel.Set (n4, v4);
m_frameCaptureModel.Set (n5, v5);
m_frameCaptureModel.Set (n6, v6);
m_frameCaptureModel.Set (n7, v7);
}
void
WifiPhyHelper::PcapSniffTxEvent (
Ptr<PcapFileWrapper> file,

View File

@@ -97,36 +97,7 @@ public:
std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (),
std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (),
std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue ());
/**
* \param name the name of the error rate 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
*
* Set the error rate model and its attributes to use when Install is called.
*/
void SetFrameCaptureModel (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 ());
/**
* An enumeration of the pcap data link types (DLTs) which this helper
* supports. See http://wiki.wireshark.org/Development/LibpcapFileFormat
@@ -193,7 +164,6 @@ protected:
ObjectFactory m_phy; ///< PHY object
ObjectFactory m_errorRateModel; ///< error rate model
ObjectFactory m_frameCaptureModel; //< frame capture model factory
private:
/**

View File

@@ -24,7 +24,6 @@
#include "ns3/propagation-loss-model.h"
#include "ns3/propagation-delay-model.h"
#include "ns3/error-rate-model.h"
#include "ns3/frame-capture-model.h"
#include "ns3/yans-wifi-phy.h"
#include "yans-wifi-helper.h"
@@ -133,7 +132,6 @@ YansWifiPhyHelper::Default (void)
{
YansWifiPhyHelper helper;
helper.SetErrorRateModel ("ns3::NistErrorRateModel");
helper.SetFrameCaptureModel ("ns3::NoOpFrameCaptureModel");
return helper;
}
@@ -155,9 +153,7 @@ YansWifiPhyHelper::Create (Ptr<Node> node, Ptr<NetDevice> device) const
{
Ptr<YansWifiPhy> phy = m_phy.Create<YansWifiPhy> ();
Ptr<ErrorRateModel> error = m_errorRateModel.Create<ErrorRateModel> ();
Ptr<FrameCaptureModel> capture = m_frameCaptureModel.Create<FrameCaptureModel> ();
phy->SetErrorRateModel (error);
phy->SetFrameCaptureModel (capture);
phy->SetChannel (m_channel);
phy->SetDevice (device);
return phy;

View File

@@ -18,18 +18,13 @@
* Author: Sébastien Deronne <sebastien.deronne@gmail.com>
*/
#include "ns3/log.h"
#include "frame-capture-model.h"
namespace ns3 {
NS_LOG_COMPONENT_DEFINE ("FrameCaptureModel");
NS_OBJECT_ENSURE_REGISTERED (FrameCaptureModel);
NS_OBJECT_ENSURE_REGISTERED (NoOpFrameCaptureModel);
TypeId
FrameCaptureModel::GetTypeId (void)
TypeId FrameCaptureModel::GetTypeId (void)
{
static TypeId tid = TypeId ("ns3::FrameCaptureModel")
.SetParent<Object> ()
@@ -38,31 +33,4 @@ FrameCaptureModel::GetTypeId (void)
return tid;
}
TypeId
NoOpFrameCaptureModel::GetTypeId (void)
{
static TypeId tid = TypeId ("ns3::NoOpFrameCaptureModel")
.SetParent<FrameCaptureModel> ()
.SetGroupName ("Wifi")
.AddConstructor<NoOpFrameCaptureModel> ()
;
return tid;
}
NoOpFrameCaptureModel::NoOpFrameCaptureModel ()
{
NS_LOG_FUNCTION (this);
}
NoOpFrameCaptureModel::~NoOpFrameCaptureModel ()
{
NS_LOG_FUNCTION (this);
}
bool
NoOpFrameCaptureModel::CaptureNewFrame (Ptr<Event> currentEvent, Ptr<Event> newEvent) const
{
return false;
}
} //namespace ns3

View File

@@ -55,34 +55,6 @@ public:
virtual bool CaptureNewFrame (Ptr<Event> currentEvent, Ptr<Event> newEvent) const = 0;
};
/**
* \ingroup wifi
* \brief A frame capture model that never switches to a new incoming frame.
*/
class NoOpFrameCaptureModel : public FrameCaptureModel
{
public:
/**
* \brief Get the type ID.
* \return the object TypeId
*/
static TypeId GetTypeId (void);
NoOpFrameCaptureModel ();
~NoOpFrameCaptureModel ();
/**
* This method returns whether the reception should be switched to a
* new incoming frame.
*
* \param currentEvent the event of the current frame
* \param newEvent the event of the new incoming frame
*
* \return false
*/
bool CaptureNewFrame (Ptr<Event> currentEvent, Ptr<Event> newEvent) const;
};
} //namespace ns3
#endif /* FRAME_CAPTURE_MODEL_H */