EMANE  1.2.1
nemimpl.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013-2015,2017 - Adjacent Link LLC, Bridgewater,
3  * New Jersey
4  * Copyright (c) 2011 - DRS CenGen, LLC, Columbia, Maryland
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  *
11  * * Redistributions of source code must retain the above copyright
12  * notice, this list of conditions and the following disclaimer.
13  * * Redistributions in binary form must reproduce the above copyright
14  * notice, this list of conditions and the following disclaimer in
15  * the documentation and/or other materials provided with the
16  * distribution.
17  * * Neither the name of DRS CenGen, LLC nor the names of its
18  * contributors may be used to endorse or promote products derived
19  * from this software without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32  * POSSIBILITY OF SUCH DAMAGE.
33  */
34 
35 #ifndef EMANEAPPLICATIONNEMIMPL_HEADER_
36 #define EMANEAPPLICATIONNEMIMPL_HEADER_
37 
38 #include "emane/application/nem.h"
39 
40 #include "nemlayerstack.h"
41 #include "nemotaadapter.h"
42 #include "nemnetworkadapter.h"
43 
44 #include "emane/component.h"
45 
46 #include <memory>
47 
48 namespace EMANE
49 {
50  namespace Application
51  {
58  class NEMImpl : public NEM
59  {
60  public:
70  NEMImpl(NEMId id,
71  std::unique_ptr<NEMLayerStack> & pNEMLayerStack,
72  bool bExternalTransport);
73 
74  ~NEMImpl();
75 
76  void initialize(Registrar & registrar) override;
77 
78  void configure(const ConfigurationUpdate & update) override;
79 
80  void start() override;
81 
82  void postStart() override;
83 
84  void stop() override;
85 
86  void destroy()
87  throw() override;
88 
94  NEMId getNEMId() const override;
95 
96  private:
97  std::unique_ptr<NEMLayerStack> pNEMLayerStack_;
98  NEMId id_;
99  bool bExternalTransport_;
100 
101  NEMOTAAdapter NEMOTAAdapter_;
102  NEMNetworkAdapter NEMNetworkAdapter_;
103 
104  INETAddr platformEndpointAddr_;
105  INETAddr transportEndpointAddr_;
106  NEMNetworkAdapter::Protocol protocol_;
107 
108  // prevent NEM copies
109  NEMImpl(const NEMImpl &) = delete;
110  NEMImpl & operator=(const NEMImpl &) = delete;
111  };
112  }
113 }
114 
115 #endif // EMANEAPPLICATIONNEMIMPL_HEADER_
void postStart() override
Definition: nemimpl.cc:156
The Registrar interface provides access to all of the emulator registrars.
Definition: registrar.h:50
Over-the-Air adapter handles the intra and inter platform OTA transport.
Definition: nemotaadapter.h:55
Implementation of the Network emulation module consisting of NEM components, OTA Adapater and network...
Definition: nemimpl.h:58
Network emulation module container interface. A container for NEM component layers connected to a tra...
Definition: nem.h:53
NEMId getNEMId() const override
Definition: nemimpl.cc:179
NEMImpl(NEMId id, std::unique_ptr< NEMLayerStack > &pNEMLayerStack, bool bExternalTransport)
Definition: nemimpl.cc:43
std::uint16_t NEMId
Definition: types.h:52
void initialize(Registrar &registrar) override
Definition: nemimpl.cc:57
void destroy() override
Definition: nemimpl.cc:173
void start() override
Definition: nemimpl.cc:135
void stop() override
Definition: nemimpl.cc:161
Entry point for packets and crontrol sourced and sinked from the network layer.
std::vector< ConfigurationNameAnyValues > ConfigurationUpdate
void configure(const ConfigurationUpdate &update) override
Definition: nemimpl.cc:86
Definition: agent.h:43