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 
22 #ifndef NS3_REMOTE_CHANNEL_BUNDLE
23 #define NS3_REMOTE_CHANNEL_BUNDLE
24 
26 
27 #include <ns3/channel.h>
28 #include <ns3/ptr.h>
29 #include <ns3/pointer.h>
30 
31 #include <map>
32 
33 namespace ns3 {
34 
46 {
47 public:
48  static TypeId GetTypeId (void);
49 
51 
52  RemoteChannelBundle (const uint32_t remoteSystemId);
53 
55  {
56  }
57 
62  void AddChannel (Ptr<Channel> channel, Time delay);
63 
67  uint32_t GetSystemId () const;
68 
72  Time GetGuaranteeTime (void) const;
73 
80  void SetGuaranteeTime (Time time);
81 
85  Time GetDelay (void) const;
86 
91  void SetEventId (EventId id);
92 
96  EventId GetEventId (void) const;
97 
101  int GetSize (void) const;
102 
110  void Send(Time time);
111 
115  friend std::ostream& operator<< (std::ostream& out, ns3::RemoteChannelBundle& bundle );
116 
117 private:
118  /*
119  * Remote rank.
120  */
122 
123  /*
124  * NS3 Channels that are connected from nodes in this MPI task to remote_rank.
125  *
126  * Would be more efficient to use unordered_map when C++11 is adopted by NS3.
127  */
128  std::map < uint32_t, Ptr < Channel > > m_channels;
129 
130  /*
131  * Guarentee time for the incoming Channels from MPI task remote_rank.
132  * No PacketMessage will ever arrive on any incoming channel in this bundle with a
133  * ReceiveTime less than this. Intialized to StartTime.
134  */
136 
137  /*
138  * Delay for this Channel bundle. min link delay over all incoming channels;
139  */
141 
142  /*
143  * Event scheduled to send Null Message for this bundle.
144  */
146 
147 };
148 
149 }
150 
151 #endif
tuple channel
Definition: third.py:85
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:102
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:73
EventId GetEventId(void) const
friend std::ostream & operator<<(std::ostream &out, ns3::RemoteChannelBundle &bundle)
Output for debugging purposes.
Collection of NS3 channels between local and remote nodes.
Time GetGuaranteeTime(void) const
void AddChannel(Ptr< Channel > channel, Time delay)
std::map< uint32_t, Ptr< Channel > > m_channels
Every class exported by the ns3 library is enclosed in the ns3 namespace.
An identifier for simulation events.
Definition: event-id.h:53
void SetEventId(EventId id)
Set the event ID of the Null Message send event current scheduled for this channel.
A base class which provides memory management and object aggregation.
Definition: object.h:87
a unique identifier for an interface.
Definition: type-id.h:58