A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
spectrum-analyzer-helper.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2010 CTTC
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation;
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 *
17 * Author: Nicola Baldo <nbaldo@cttc.es>
18 */
19
20#ifndef SPECTRUM_ANALYZER_HELPER_H
21#define SPECTRUM_ANALYZER_HELPER_H
22
23#include <ns3/attribute.h>
24#include <ns3/net-device-container.h>
25#include <ns3/node-container.h>
26#include <ns3/object-factory.h>
27#include <ns3/queue.h>
28
29#include <string>
30
31namespace ns3
32{
33
34class SpectrumValue;
35class SpectrumChannel;
36class SpectrumModel;
37
43{
44 public:
47
53 void SetChannel(Ptr<SpectrumChannel> channel);
54
60 void SetChannel(std::string channelName);
61
68 void SetPhyAttribute(std::string name, const AttributeValue& v);
69
76 void SetDeviceAttribute(std::string n1, const AttributeValue& v1);
77
85 template <typename... Ts>
86 void SetAntenna(std::string type, Ts&&... args);
87
95
102 void EnableAsciiAll(std::string prefix);
103
118 NetDeviceContainer Install(std::string nodeName) const;
119
120 private:
124
127 std::string m_prefix;
128};
129
130/***************************************************************
131 * Implementation of the templates declared above.
132 ***************************************************************/
133
134template <typename... Ts>
135void
136SpectrumAnalyzerHelper::SetAntenna(std::string type, Ts&&... args)
137{
138 m_antenna = ObjectFactory(type, std::forward<Ts>(args)...);
139}
140
141} // namespace ns3
142
143#endif /* SPECTRUM_ANALYZER_HELPER_H */
Hold a value for an Attribute.
Definition: attribute.h:70
holds a vector of ns3::NetDevice pointers
keep track of a set of node pointers.
Instantiate subclasses of ns3::Object.
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:78
Class to allow the Spectrum Analysis.
ObjectFactory m_phy
Object factory for the phy objects.
void SetAntenna(std::string type, Ts &&... args)
NetDeviceContainer Install(NodeContainer c) const
Ptr< SpectrumModel > m_rxSpectrumModel
Spectrum model.
void SetPhyAttribute(std::string name, const AttributeValue &v)
void SetDeviceAttribute(std::string n1, const AttributeValue &v1)
void SetChannel(Ptr< SpectrumChannel > channel)
Set the SpectrumChannel that will be used by SpectrumPhy instances created by this helper.
ObjectFactory m_antenna
Object factory for the Antenna objects.
std::string m_prefix
Prefix for the output files.
void EnableAsciiAll(std::string prefix)
Enable ASCII output.
Ptr< SpectrumChannel > m_channel
Channel.
ObjectFactory m_device
Object factory for the NetDevice objects.
void SetRxSpectrumModel(Ptr< SpectrumModel > m)
Set the spectrum model used by the created SpectrumAnalyzer instances to represent incoming signals.
Every class exported by the ns3 library is enclosed in the ns3 namespace.