A Discrete-Event Network Simulator
QKDNetSim v2.0 (NS-3 v3.41) @ (+)
API
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
application-container.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008 INRIA
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: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
18  */
19 
20 #ifndef APPLICATION_CONTAINER_H
21 #define APPLICATION_CONTAINER_H
22 
23 #include "ns3/application.h"
24 #include "ns3/random-variable-stream.h"
25 
26 #include <stdint.h>
27 #include <vector>
28 
29 namespace ns3
30 {
31 
44 {
45  public:
50 
59 
67  ApplicationContainer(std::string name);
68 
70  typedef std::vector<Ptr<Application>>::const_iterator Iterator;
71 
91  Iterator Begin() const;
92 
112  Iterator End() const;
113 
134  uint32_t GetN() const;
135 
157  Ptr<Application> Get(uint32_t i) const;
158 
165  void Add(ApplicationContainer other);
166 
172  void Add(Ptr<Application> application);
173 
180  void Add(std::string name);
181 
196  void Start(Time start) const;
197 
210 
225  void Stop(Time stop) const;
226 
227  private:
228  std::vector<Ptr<Application>> m_applications;
229 };
230 
231 } // namespace ns3
232 
233 #endif /* APPLICATION_CONTAINER_H */
holds a vector of ns3::Application pointers.
std::vector< Ptr< Application > > m_applications
Applications smart pointers.
Iterator Begin() const
Get an iterator which refers to the first Application in the container.
Iterator End() const
Get an iterator which indicates past-the-last Application in the container.
void Start(Time start) const
Start all of the Applications in this container at the start time given as a parameter.
void StartWithJitter(Time start, Ptr< RandomVariableStream > rv) const
Start all of the Applications in this container at the start time given as a parameter,...
std::vector< Ptr< Application > >::const_iterator Iterator
Application container iterator.
ApplicationContainer()
Create an empty ApplicationContainer.
Ptr< Application > Get(uint32_t i) const
Get the Ptr<Application> stored in this container at a given index.
void Stop(Time stop) const
Arrange for all of the Applications in this container to Stop() at the Time given as a parameter.
uint32_t GetN() const
Get the number of Ptr<Application> stored in this container.
void Add(ApplicationContainer other)
Append the contents of another ApplicationContainer to the end of this container.
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:105
Every class exported by the ns3 library is enclosed in the ns3 namespace.