A Discrete-Event Network Simulator
API
default-channel-scheduler.h
Go to the documentation of this file.
1/*
2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License version 2 as
4 * published by the Free Software Foundation;
5 *
6 * This program is distributed in the hope that it will be useful,
7 * but WITHOUT ANY WARRANTY; without even the implied warranty of
8 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9 * GNU General Public License for more details.
10 *
11 * You should have received a copy of the GNU General Public License
12 * along with this program; if not, write to the Free Software
13 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
14 *
15 * Author: Junling Bu <linlinjavaer@gmail.com>
16 */
17#ifndef DEFAULT_CHANNEL_SCHEDULER_H
18#define DEFAULT_CHANNEL_SCHEDULER_H
19
20#include "wave-net-device.h"
21
22namespace ns3
23{
24class WaveNetDevice;
25
34{
35 public:
40 static TypeId GetTypeId();
42 ~DefaultChannelScheduler() override;
43
47 void SetWaveNetDevice(Ptr<WaveNetDevice> device) override;
52 ChannelAccess GetAssignedAccessType(uint32_t channelNumber) const override;
53
58 void NotifyCchSlotStart(Time duration);
63 void NotifySchSlotStart(Time duration);
69 void NotifyGuardSlotStart(Time duration, bool cchi);
70
71 private:
72 void DoInitialize() override;
73 void DoDispose() override;
81 bool AssignAlternatingAccess(uint32_t channelNumber, bool immediate) override;
89 bool AssignContinuousAccess(uint32_t channelNumber, bool immediate) override;
98 bool AssignExtendedAccess(uint32_t channelNumber, uint32_t extends, bool immediate) override;
103 bool AssignDefaultCchAccess() override;
109 bool ReleaseAccess(uint32_t channelNumber) override;
114 void SwitchToNextChannel(uint32_t curChannelNumber, uint32_t nextChannelNumber);
115
119
133
137
139};
140
141} // namespace ns3
142#endif /* DEFAULT_CHANNEL_SCHEDULER_H */
This class will assign channel access for requests from higher layers.
This class uses a simple mechanism to assign channel access with following features: (1) only in the ...
bool ReleaseAccess(uint32_t channelNumber) override
void DoDispose() override
Destructor implementation.
Ptr< ChannelManager > m_manager
channel manager
void NotifyGuardSlotStart(Time duration, bool cchi)
Notify guard slot start.
static TypeId GetTypeId()
Get the type ID.
void NotifyCchSlotStart(Time duration)
Notify CCH slot start.
void SwitchToNextChannel(uint32_t curChannelNumber, uint32_t nextChannelNumber)
bool AssignContinuousAccess(uint32_t channelNumber, bool immediate) override
Ptr< ChannelCoordinator > m_coordinator
channel coordinator
bool AssignDefaultCchAccess() override
This method will assign default CCH access for CCH.
bool AssignAlternatingAccess(uint32_t channelNumber, bool immediate) override
bool AssignExtendedAccess(uint32_t channelNumber, uint32_t extends, bool immediate) override
void NotifySchSlotStart(Time duration)
Notify SCH slot start.
void SetWaveNetDevice(Ptr< WaveNetDevice > device) override
ChannelAccess GetAssignedAccessType(uint32_t channelNumber) const override
uint32_t m_channelNumber
when m_channelAccess is ContinuousAccess, m_channelNumber is continuous channel number; when m_channe...
ChannelAccess m_channelAccess
channel access
uint32_t m_waitChannelNumber
wait channel number
void DoInitialize() override
Initialize() implementation.
Ptr< ChannelCoordinationListener > m_coordinationListener
coordination listener
An identifier for simulation events.
Definition: event-id.h:55
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:105
a unique identifier for an interface.
Definition: type-id.h:59
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ChannelAccess
ChannelAccess enumeration.