A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Loading...
Searching...
No Matches
flame-installer.cc
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2008,2009 IITP RAS
3
*
4
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Authors: Kirill Andreev <andreev@iitp.ru>
7
*/
8
9
#include "
flame-installer.h
"
10
11
#include "ns3/flame-protocol.h"
12
#include "ns3/mesh-wifi-interface-mac.h"
13
14
namespace
ns3
15
{
16
using namespace
flame;
17
NS_OBJECT_ENSURE_REGISTERED
(FlameStack);
18
19
TypeId
20
FlameStack::GetTypeId
()
21
{
22
static
TypeId
tid =
TypeId
(
"ns3::FlameStack"
)
23
.
SetParent
<
MeshStack
>()
24
.SetGroupName(
"Mesh"
)
25
.AddConstructor<
FlameStack
>();
26
return
tid;
27
}
28
29
FlameStack::FlameStack
()
30
{
31
}
32
33
FlameStack::~FlameStack
()
34
{
35
}
36
37
void
38
FlameStack::DoDispose
()
39
{
40
}
41
42
bool
43
FlameStack::InstallStack
(
Ptr<MeshPointDevice>
mp)
44
{
45
Ptr<FlameProtocol>
flame =
CreateObject<FlameProtocol>
();
46
return
flame->Install(mp);
47
}
48
49
void
50
FlameStack::Report
(
const
Ptr<MeshPointDevice>
mp, std::ostream& os)
51
{
52
mp->Report(os);
53
/// \todo report flame counters
54
Ptr<FlameProtocol>
flame = mp->GetObject<
FlameProtocol
>();
55
NS_ASSERT
(flame);
56
flame->Report(os);
57
}
58
59
void
60
FlameStack::ResetStats
(
const
Ptr<MeshPointDevice>
mp)
61
{
62
mp->ResetStats();
63
/// \todo reset flame counters
64
Ptr<FlameProtocol>
flame = mp->GetObject<
FlameProtocol
>();
65
NS_ASSERT
(flame);
66
67
flame->ResetStats();
68
}
69
}
// namespace ns3
ns3::FlameStack
Helper class used to install FLAME mesh stack (actually single protocol in this stack)
Definition
flame-installer.h:24
ns3::FlameStack::DoDispose
void DoDispose() override
Break any reference cycles in the installer helper.
Definition
flame-installer.cc:38
ns3::FlameStack::Report
void Report(const Ptr< MeshPointDevice > mp, std::ostream &) override
Print flame protocol statistics.
Definition
flame-installer.cc:50
ns3::FlameStack::~FlameStack
~FlameStack() override
Destroy a FlameStack helper class.
Definition
flame-installer.cc:33
ns3::FlameStack::InstallStack
bool InstallStack(Ptr< MeshPointDevice > mp) override
Install a flame stack on the given MeshPointDevice.
Definition
flame-installer.cc:43
ns3::FlameStack::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition
flame-installer.cc:20
ns3::FlameStack::ResetStats
void ResetStats(const Ptr< MeshPointDevice > mp) override
Reset the statistics.
Definition
flame-installer.cc:60
ns3::FlameStack::FlameStack
FlameStack()
Construct a FlameStack helper class.
Definition
flame-installer.cc:29
ns3::MeshStack
Prototype for class, which helps to install MAC-layer routing stack to ns3::MeshPointDevice.
Definition
mesh-stack-installer.h:25
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
mpi-test-fixtures.h:37
ns3::TypeId
a unique identifier for an interface.
Definition
type-id.h:48
ns3::TypeId::SetParent
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition
type-id.cc:1001
ns3::flame::FlameProtocol
FLAME routing protocol.
Definition
flame-protocol.h:81
flame-installer.h
NS_ASSERT
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
Definition
assert.h:55
ns3::CreateObject
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
Definition
object.h:619
NS_OBJECT_ENSURE_REGISTERED
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition
object-base.h:35
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
mesh
helper
flame
flame-installer.cc
Generated on Sat Nov 2 2024 19:37:28 for ns-3 by
1.11.0