A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
channel-list.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2009 University of Washington
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 */
6
7#ifndef CHANNEL_LIST_H
8#define CHANNEL_LIST_H
9
10#include "ns3/ptr.h"
11
12#include <vector>
13
14namespace ns3
15{
16
17class Channel;
18class CallbackBase;
19
20/**
21 * \ingroup network
22 *
23 * \brief the list of simulation channels.
24 *
25 * Every Channel created is automatically added to this list.
26 */
28{
29 public:
30 /// Channel container iterator
31 typedef std::vector<Ptr<Channel>>::const_iterator Iterator;
32
33 /**
34 * \param channel channel to add
35 * \returns index of channel in list.
36 *
37 * This method is called automatically from Channel::Channel so
38 * the user has little reason to call it himself.
39 */
40 static uint32_t Add(Ptr<Channel> channel);
41 /**
42 * \returns a C++ iterator located at the beginning of this
43 * list.
44 */
45 static Iterator Begin();
46 /**
47 * \returns a C++ iterator located at the end of this
48 * list.
49 */
50 static Iterator End();
51 /**
52 * \param n index of requested channel.
53 * \returns the Channel associated to index n.
54 */
56 /**
57 * \returns the number of channels currently in the list.
58 */
59 static uint32_t GetNChannels();
60};
61
62} // namespace ns3
63
64#endif /* CHANNEL_LIST_H */
the list of simulation channels.
static Ptr< Channel > GetChannel(uint32_t n)
static uint32_t Add(Ptr< Channel > channel)
static uint32_t GetNChannels()
static Iterator Begin()
std::vector< Ptr< Channel > >::const_iterator Iterator
Channel container iterator.
static Iterator End()
Smart pointer class similar to boost::intrusive_ptr.
Every class exported by the ns3 library is enclosed in the ns3 namespace.