satellite-fading-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_FADING_OUTPUT_TRACE_CONTAINER_H
21 #define SATELLITE_FADING_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 namespace ns3
30 {
31 
39 {
40  public:
44  typedef std::pair<Address, SatEnums::ChannelType_t> key_t;
45 
49  typedef std::map<key_t, Ptr<SatOutputFileStreamDoubleContainer>> container_t;
50 
55 
60 
65  static TypeId GetTypeId(void);
66 
71  TypeId GetInstanceTypeId(void) const;
72 
76  void DoDispose();
77 
83  void AddToContainer(key_t key, std::vector<double> newItem);
84 
89  void EnableFigureOutput(bool enableFigureOutput)
90  {
91  m_enableFigureOutput = enableFigureOutput;
92  }
93 
97  void Reset();
98 
99  private:
105  Ptr<SatOutputFileStreamDoubleContainer> AddNode(
106  std::pair<Address, SatEnums::ChannelType_t> key);
107 
113  Ptr<SatOutputFileStreamDoubleContainer> FindNode(key_t key);
114 
118  void WriteToFile();
119 
124 
129 };
130 
131 } // namespace ns3
132 
133 #endif /* SATELLITE_FADING_OUTPUT_TRACE_CONTAINER_H */
Base class for trace containers such as interference or fading traces.
Class for fading output trace container.
static TypeId GetTypeId(void)
NS-3 type id function.
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
std::pair< Address, SatEnums::ChannelType_t > key_t
typedef for map key
void EnableFigureOutput(bool enableFigureOutput)
Function for enabling / disabling figure output.
Ptr< SatOutputFileStreamDoubleContainer > AddNode(std::pair< Address, SatEnums::ChannelType_t > key)
Function for adding the node to the map.
Ptr< SatOutputFileStreamDoubleContainer > FindNode(key_t key)
Function for finding the container matching the key.
TypeId GetInstanceTypeId(void) const
NS-3 instance type id function.
void WriteToFile()
Write the contents of a container matching to the key into a file.
void Reset()
Function for resetting the variables.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.