A Discrete-Event Network Simulator
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
15namespace ns3
16{
17
19
21
22TypeId
24{
25 static TypeId tid = TypeId("ns3::Channel")
27 .SetGroupName("Network")
28 .AddAttribute("Id",
29 "The id (unique integer) of this Channel.",
34 return tid;
35}
36
38 : m_id(0)
39{
40 NS_LOG_FUNCTION(this);
41 m_id = ChannelList::Add(this);
42}
43
48
51{
52 NS_LOG_FUNCTION(this);
53 return m_id;
54}
55
56} // namespace ns3
uint32_t m_id
Channel id for this channel.
Definition channel.h:68
uint32_t GetId() const
Definition channel.cc:50
static TypeId GetTypeId()
Get the type ID.
Definition channel.cc:23
~Channel() override
Definition channel.cc:44
static uint32_t Add(Ptr< Channel > channel)
A base class which provides memory management and object aggregation.
Definition object.h:78
a unique identifier for an interface.
Definition type-id.h:48
@ ATTR_GET
The attribute can be read.
Definition type-id.h:53
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition type-id.cc:1001
Hold an unsigned integer type.
Definition uinteger.h:34
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition log.h:191
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#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.
Ptr< const AttributeChecker > MakeUintegerChecker()
Definition uinteger.h:85
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Definition uinteger.h:35