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
channel.cc
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2007 University of Washington
3
*
4
* SPDX-License-Identifier: GPL-2.0-only
5
*/
6
7
#include "
channel.h
"
8
9
#include "
channel-list.h
"
10
#include "
net-device.h
"
11
12
#include "ns3/log.h"
13
#include "ns3/uinteger.h"
14
15
namespace
ns3
16
{
17
18
NS_LOG_COMPONENT_DEFINE
(
"Channel"
);
19
20
NS_OBJECT_ENSURE_REGISTERED
(Channel);
21
22
TypeId
23
Channel::GetTypeId
()
24
{
25
static
TypeId
tid =
TypeId
(
"ns3::Channel"
)
26
.
SetParent
<
Object
>()
27
.SetGroupName(
"Network"
)
28
.AddAttribute(
"Id"
,
29
"The id (unique integer) of this Channel."
,
30
TypeId::ATTR_GET
,
31
UintegerValue
(0),
32
MakeUintegerAccessor
(&
Channel::m_id
),
33
MakeUintegerChecker<uint32_t>
());
34
return
tid;
35
}
36
37
Channel::Channel
()
38
: m_id(0)
39
{
40
NS_LOG_FUNCTION
(
this
);
41
m_id
=
ChannelList::Add
(
this
);
42
}
43
44
Channel::~Channel
()
45
{
46
NS_LOG_FUNCTION
(
this
);
47
}
48
49
uint32_t
50
Channel::GetId
()
const
51
{
52
NS_LOG_FUNCTION
(
this
);
53
return
m_id
;
54
}
55
56
}
// namespace ns3
channel-list.h
channel.h
ns3::Channel::m_id
uint32_t m_id
Channel id for this channel.
Definition
channel.h:68
ns3::Channel::Channel
Channel()
Definition
channel.cc:37
ns3::Channel::GetId
uint32_t GetId() const
Definition
channel.cc:50
ns3::Channel::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition
channel.cc:23
ns3::Channel::~Channel
~Channel() override
Definition
channel.cc:44
ns3::ChannelList::Add
static uint32_t Add(Ptr< Channel > channel)
Definition
channel-list.cc:206
ns3::Object
A base class which provides memory management and object aggregation.
Definition
object.h:78
ns3::TypeId
a unique identifier for an interface.
Definition
type-id.h:48
ns3::TypeId::ATTR_GET
@ ATTR_GET
The attribute can be read.
Definition
type-id.h:53
ns3::TypeId::SetParent
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition
type-id.cc:1001
ns3::UintegerValue
Hold an unsigned integer type.
Definition
uinteger.h:34
uint32_t
ns3::MakeUintegerChecker
Ptr< const AttributeChecker > MakeUintegerChecker()
Definition
uinteger.h:85
ns3::MakeUintegerAccessor
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Definition
uinteger.h:35
NS_LOG_COMPONENT_DEFINE
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition
log.h:191
NS_LOG_FUNCTION
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
Definition
log-macros-enabled.h:229
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.
net-device.h
src
network
model
channel.cc
Generated on Fri Nov 1 2024 09:20:45 for ns-3 by
1.11.0