EMANE  1.2.1
basemodel.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015-2016 - Adjacent Link LLC, Bridgewater, New Jersey
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  * * Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in
13  * the documentation and/or other materials provided with the
14  * distribution.
15  * * Neither the name of Adjacent Link LLC nor the names of its
16  * contributors may be used to endorse or promote products derived
17  * from this software without specific prior written permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
22  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
23  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
24  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
25  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
26  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
29  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30  * POSSIBILITY OF SUCH DAMAGE.
31  */
32 
33 #ifndef EMANETDMABASEMODEL_HEADER_
34 #define EMANETDMABASEMODEL_HEADER_
35 
36 #include "emane/maclayerimpl.h"
39 
40 namespace EMANE
41 {
42  namespace Models
43  {
44  namespace TDMA
45  {
54  public SchedulerUser
55  {
56  public:
57  BaseModel(NEMId id,
58  PlatformServiceProvider *pPlatformServiceProvider,
59  RadioServiceProvider * pRadioServiceProvider,
60  Scheduler * pScheduler,
61  QueueManager * pQueueManager);
62 
63  ~BaseModel();
64 
65  void initialize(Registrar & registrar) override;
66 
67  void configure(const ConfigurationUpdate & update) override;
68 
69  void start() override;
70 
71  void postStart() override;
72 
73  void stop() override;
74 
75  void destroy() throw() override;
76 
77  void processUpstreamControl(const ControlMessages & msgs) override;
78 
79 
80  void processUpstreamPacket(const CommonMACHeader & hdr,
81  UpstreamPacket & pkt,
82  const ControlMessages & msgs) override;
83 
84  void processDownstreamControl(const ControlMessages & msgs) override;
85 
86 
88  const ControlMessages & msgs) override;
89 
90 
91  void processEvent(const EventId &, const Serialization &) override;
92 
93  void processConfiguration(const ConfigurationUpdate & update) override;
94 
95  void notifyScheduleChange(const Frequencies & frequencies,
96  std::uint64_t u64BandwidthHz,
97  const Microseconds & slotDuration,
98  const Microseconds & slotOverhead) override;
99 
100  void processSchedulerPacket(DownstreamPacket & pkt) override;
101 
102  void processSchedulerControl(const ControlMessages & msgs) override;
103 
104  QueueInfos getPacketQueueInfo() const override;
105 
106  private:
107  class Implementation;
108  std::unique_ptr<Implementation> pImpl_;
109  };
110  }
111  }
112 }
113 
114 #endif // EMANETDMABASEMODEL_HEADER_
void initialize(Registrar &registrar) override
Definition: basemodel.cc:57
void processDownstreamControl(const ControlMessages &msgs) override
Definition: basemodel.cc:112
std::string Serialization
Definition: serializable.h:42
QueueInfos getPacketQueueInfo() const override
Definition: basemodel.cc:158
A Packet class that allows upstream processing to strip layer headers as the packet travels up the st...
void processConfiguration(const ConfigurationUpdate &update) override
Definition: basemodel.cc:132
The Registrar interface provides access to all of the emulator registrars.
Definition: registrar.h:50
std::list< const ControlMessage * > ControlMessages
void processUpstreamControl(const ControlMessages &msgs) override
Definition: basemodel.cc:99
std::uint16_t EventId
Definition: types.h:53
The PlatformServiceProvider interface provides access to emulator services.
void processEvent(const EventId &, const Serialization &) override
Definition: basemodel.cc:125
void configure(const ConfigurationUpdate &update) override
Definition: basemodel.cc:65
std::vector< QueueInfo > QueueInfos
Specialized packet the allows downstream processing to add layer specific headers as the packet trave...
std::set< std::uint64_t > Frequencies
std::chrono::microseconds Microseconds
Definition: types.h:45
std::uint16_t NEMId
Definition: types.h:52
void notifyScheduleChange(const Frequencies &frequencies, std::uint64_t u64BandwidthHz, const Microseconds &slotDuration, const Microseconds &slotOverhead) override
Definition: basemodel.cc:137
void processSchedulerControl(const ControlMessages &msgs) override
Definition: basemodel.cc:152
The RadioServiceProvider interface provides access to radio (RF) model specific services.
Interface used by a scheduler module to communicate information with BaseModel.
Definition: scheduleruser.h:52
Scheduler interface used by BaseModel to communicate with a scheduler module.
Definition: scheduler.h:56
TDMA radio module implementation that uses specialized scheduler and queue manager modules to allow v...
Definition: basemodel.h:53
Queue management interface used by BaseModel
Definition: queuemanager.h:57
std::vector< ConfigurationNameAnyValues > ConfigurationUpdate
void processDownstreamPacket(DownstreamPacket &pkt, const ControlMessages &msgs) override
Definition: basemodel.cc:118
void processUpstreamPacket(const CommonMACHeader &hdr, UpstreamPacket &pkt, const ControlMessages &msgs) override
Definition: basemodel.cc:105
void processSchedulerPacket(DownstreamPacket &pkt) override
Definition: basemodel.cc:146
BaseModel(NEMId id, PlatformServiceProvider *pPlatformServiceProvider, RadioServiceProvider *pRadioServiceProvider, Scheduler *pScheduler, QueueManager *pQueueManager)
Definition: basemodel.cc:36
Definition: agent.h:43
Interface used to create a MAC layer plugin implementation.
Definition: maclayerimpl.h:48