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