satellite-interference-output-trace-container.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2013 Magister Solutions Ltd.
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Author: Frans Laakso <frans.laakso@magister.fi>
19  */
20 #ifndef SATELLITE_INTERFERENCE_OUTPUT_TRACE_CONTAINER_H
21 #define SATELLITE_INTERFERENCE_OUTPUT_TRACE_CONTAINER_H
22 
24 #include "satellite-enums.h"
25 
26 #include <ns3/mac48-address.h>
27 #include <ns3/satellite-output-fstream-double-container.h>
28 
29 #include <map>
30 #include <utility>
31 #include <vector>
32 
33 namespace ns3
34 {
35 
43 {
44  public:
48  typedef std::pair<Address, SatEnums::ChannelType_t> key_t;
49 
53  typedef std::map<key_t, Ptr<SatOutputFileStreamDoubleContainer>> container_t;
54 
59 
64 
69  static TypeId GetTypeId(void);
70 
75  TypeId GetInstanceTypeId(void) const;
76 
80  void DoDispose();
81 
87  void AddToContainer(key_t key, std::vector<double> newItem);
88 
93  void EnableFigureOutput(bool enableFigureOutput)
94  {
95  m_enableFigureOutput = enableFigureOutput;
96  }
97 
101  void Reset();
102 
103  private:
109  Ptr<SatOutputFileStreamDoubleContainer> AddNode(
110  std::pair<Address, SatEnums::ChannelType_t> key);
111 
117  Ptr<SatOutputFileStreamDoubleContainer> FindNode(key_t key);
118 
122  void WriteToFile();
123 
128 
133 };
134 
135 } // namespace ns3
136 
137 #endif /* SATELLITE_INTERFERENCE_OUTPUT_TRACE_CONTAINER_H */
Base class for trace containers such as interference or fading traces.
TypeId GetInstanceTypeId(void) const
NS-3 instance type id function.
std::pair< Address, SatEnums::ChannelType_t > key_t
typedef for map key
Ptr< SatOutputFileStreamDoubleContainer > FindNode(key_t key)
Function for finding the container matching the key.
Ptr< SatOutputFileStreamDoubleContainer > AddNode(std::pair< Address, SatEnums::ChannelType_t > key)
Function for adding the node to the map.
void EnableFigureOutput(bool enableFigureOutput)
Function for enabling / disabling figure output.
void AddToContainer(key_t key, std::vector< double > newItem)
Add the vector containing the values to container matching the key.
std::map< key_t, Ptr< SatOutputFileStreamDoubleContainer > > container_t
typedef for map of containers
void WriteToFile()
Write the contents of a container matching to the key into a file.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.