A Discrete-Event Network Simulator
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
14namespace ns3
15{
16using namespace flame;
18
19TypeId
21{
22 static TypeId tid = TypeId("ns3::FlameStack")
24 .SetGroupName("Mesh")
25 .AddConstructor<FlameStack>();
26 return tid;
27}
28
32
36
37void
41
42bool
48
49void
50FlameStack::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
59void
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
Helper class used to install FLAME mesh stack (actually single protocol in this stack)
void DoDispose() override
Break any reference cycles in the installer helper.
void Report(const Ptr< MeshPointDevice > mp, std::ostream &) override
Print flame protocol statistics.
~FlameStack() override
Destroy a FlameStack helper class.
bool InstallStack(Ptr< MeshPointDevice > mp) override
Install a flame stack on the given MeshPointDevice.
static TypeId GetTypeId()
Get the type ID.
void ResetStats(const Ptr< MeshPointDevice > mp) override
Reset the statistics.
FlameStack()
Construct a FlameStack helper class.
Prototype for class, which helps to install MAC-layer routing stack to ns3::MeshPointDevice.
Smart pointer class similar to boost::intrusive_ptr.
a unique identifier for an interface.
Definition type-id.h:48
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition type-id.cc:1001
FLAME routing protocol.
#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
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
Definition object.h:619
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition object-base.h:35
Every class exported by the ns3 library is enclosed in the ns3 namespace.