A Discrete-Event Network Simulator
API
remote-channel-bundle.h
Go to the documentation of this file.
1/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2/*
3 * Copyright 2013. Lawrence Livermore National Security, LLC.
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: Steven Smith <smith84@llnl.gov>
19 *
20 */
21
28#ifndef NS3_REMOTE_CHANNEL_BUNDLE
29#define NS3_REMOTE_CHANNEL_BUNDLE
30
32
33#include <ns3/channel.h>
34#include <ns3/ptr.h>
35#include <ns3/pointer.h>
36
37#include <unordered_map>
38
39namespace ns3 {
40
52{
53public:
58 static TypeId GetTypeId (void);
59
62
67 RemoteChannelBundle (const uint32_t remoteSystemId);
68
71 {
72 }
73
79 void AddChannel (Ptr<Channel> channel, Time delay);
80
85 uint32_t GetSystemId () const;
86
91 Time GetGuaranteeTime (void) const;
92
99 void SetGuaranteeTime (Time time);
100
105 Time GetDelay (void) const;
106
113 void SetEventId (EventId id);
114
119 EventId GetEventId (void) const;
120
125 std::size_t GetSize (void) const;
126
134 void Send(Time time);
135
143 friend std::ostream& operator<< (std::ostream& out, ns3::RemoteChannelBundle& bundle );
144
145private:
148
153 typedef std::unordered_map < uint32_t, Ptr < Channel > > ChannelMap;
163
169
172
173};
174
175}
176
177#endif
An identifier for simulation events.
Definition: event-id.h:54
A base class which provides memory management and object aggregation.
Definition: object.h:88
Collection of ns-3 channels between local and remote nodes.
Time m_delay
Delay for this Channel bundle, which is the min link delay over all incoming channels;.
std::size_t GetSize(void) const
Get the number of ns-3 channels in this bundle.
Time GetDelay(void) const
Get the minimum delay along any channel in this bundle.
Time GetGuaranteeTime(void) const
Get the current guarantee time for this bundle.
RemoteChannelBundle()
Default constructor.
friend std::ostream & operator<<(std::ostream &out, ns3::RemoteChannelBundle &bundle)
Output for debugging purposes.
void SetEventId(EventId id)
Set the event ID of the Null Message send event currently scheduled for this channel.
EventId GetEventId(void) const
Get the event ID of the Null Message send event for this bundle.
ChannelMap m_channels
ChannelId to Channel map.
static TypeId GetTypeId(void)
Register this type.
std::unordered_map< uint32_t, Ptr< Channel > > ChannelMap
Container of channels that are connected from nodes in this MPI task to nodes in a remote rank.
Time m_guaranteeTime
Guarantee time for the incoming Channels from MPI task remote_rank.
uint32_t m_remoteSystemId
Remote rank.
void AddChannel(Ptr< Channel > channel, Time delay)
Add a channel to this bundle.
EventId m_nullEventId
Event scheduled to send Null Message for this bundle.
uint32_t GetSystemId() const
Get the system Id for this side.
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:103
a unique identifier for an interface.
Definition: type-id.h:59
Every class exported by the ns3 library is enclosed in the ns3 namespace.
channel
Definition: third.py:92
Declaration of class ns3::NullMessageSimulatorImpl.