A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
src
mpi
model
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
25
#include "
null-message-simulator-impl.h
"
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
45
class
RemoteChannelBundle
:
public
Object
46
{
47
public
:
48
static
TypeId
GetTypeId
(
void
);
49
50
RemoteChannelBundle
();
51
52
RemoteChannelBundle
(
const
uint32_t remoteSystemId);
53
54
~RemoteChannelBundle
()
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
std::size_t
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
*/
121
uint32_t
m_remoteSystemId
;
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
* Guarantee 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. Initialized to StartTime.
134
*/
135
Time
m_guaranteeTime
;
136
137
/*
138
* Delay for this Channel bundle. min link delay over all incoming channels;
139
*/
140
Time
m_delay
;
141
142
/*
143
* Event scheduled to send Null Message for this bundle.
144
*/
145
EventId
m_nullEventId
;
146
147
};
148
149
}
150
151
#endif
ns3::RemoteChannelBundle::~RemoteChannelBundle
~RemoteChannelBundle()
Definition:
remote-channel-bundle.h:54
ns3::RemoteChannelBundle::RemoteChannelBundle
RemoteChannelBundle()
Definition:
remote-channel-bundle.cc:42
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition:
nstime.h:102
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition:
ptr.h:73
null-message-simulator-impl.h
ns3::RemoteChannelBundle::SetGuaranteeTime
void SetGuaranteeTime(Time time)
Definition:
remote-channel-bundle.cc:76
ns3::RemoteChannelBundle::operator<<
friend std::ostream & operator<<(std::ostream &out, ns3::RemoteChannelBundle &bundle)
Output for debugging purposes.
Definition:
remote-channel-bundle.cc:113
ns3::RemoteChannelBundle::GetSystemId
uint32_t GetSystemId() const
Definition:
remote-channel-bundle.cc:64
ns3::RemoteChannelBundle
Collection of NS3 channels between local and remote nodes.
Definition:
remote-channel-bundle.h:45
ns3::RemoteChannelBundle::m_nullEventId
EventId m_nullEventId
Definition:
remote-channel-bundle.h:145
ns3::RemoteChannelBundle::Send
void Send(Time time)
Definition:
remote-channel-bundle.cc:108
third.channel
channel
Definition:
third.py:85
ns3::RemoteChannelBundle::GetSize
std::size_t GetSize(void) const
Definition:
remote-channel-bundle.cc:102
ns3::RemoteChannelBundle::GetGuaranteeTime
Time GetGuaranteeTime(void) const
Definition:
remote-channel-bundle.cc:70
ns3::RemoteChannelBundle::AddChannel
void AddChannel(Ptr< Channel > channel, Time delay)
Definition:
remote-channel-bundle.cc:57
ns3::RemoteChannelBundle::m_channels
std::map< uint32_t, Ptr< Channel > > m_channels
Definition:
remote-channel-bundle.h:128
ns3::RemoteChannelBundle::GetEventId
EventId GetEventId(void) const
Definition:
remote-channel-bundle.cc:96
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::EventId
An identifier for simulation events.
Definition:
event-id.h:53
ns3::RemoteChannelBundle::SetEventId
void SetEventId(EventId id)
Set the event ID of the Null Message send event current scheduled for this channel.
Definition:
remote-channel-bundle.cc:90
ns3::RemoteChannelBundle::m_remoteSystemId
uint32_t m_remoteSystemId
Definition:
remote-channel-bundle.h:121
ns3::Object
A base class which provides memory management and object aggregation.
Definition:
object.h:87
ns3::RemoteChannelBundle::GetDelay
Time GetDelay(void) const
Definition:
remote-channel-bundle.cc:84
ns3::RemoteChannelBundle::GetTypeId
static TypeId GetTypeId(void)
Definition:
remote-channel-bundle.cc:33
ns3::RemoteChannelBundle::m_delay
Time m_delay
Definition:
remote-channel-bundle.h:140
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:58
ns3::RemoteChannelBundle::m_guaranteeTime
Time m_guaranteeTime
Definition:
remote-channel-bundle.h:135
Generated on Wed Nov 7 2018 10:02:06 for ns-3 by
1.8.14