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
udp-socket-factory-impl.cc
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2007 INRIA
3
*
4
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
7
*/
8
#include "
udp-socket-factory-impl.h
"
9
10
#include "
udp-l4-protocol.h
"
11
12
#include "ns3/assert.h"
13
#include "ns3/socket.h"
14
15
namespace
ns3
16
{
17
18
UdpSocketFactoryImpl::UdpSocketFactoryImpl
()
19
: m_udp(nullptr)
20
{
21
}
22
23
UdpSocketFactoryImpl::~UdpSocketFactoryImpl
()
24
{
25
NS_ASSERT
(!
m_udp
);
26
}
27
28
void
29
UdpSocketFactoryImpl::SetUdp
(
Ptr<UdpL4Protocol>
udp)
30
{
31
m_udp
= udp;
32
}
33
34
Ptr<Socket>
35
UdpSocketFactoryImpl::CreateSocket
()
36
{
37
return
m_udp
->
CreateSocket
();
38
}
39
40
void
41
UdpSocketFactoryImpl::DoDispose
()
42
{
43
m_udp
=
nullptr
;
44
UdpSocketFactory::DoDispose
();
45
}
46
47
}
// namespace ns3
ns3::Object::DoDispose
virtual void DoDispose()
Destructor implementation.
Definition
object.cc:433
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
mpi-test-fixtures.h:37
ns3::Socket::CreateSocket
static Ptr< Socket > CreateSocket(Ptr< Node > node, TypeId tid)
This method wraps the creation of sockets that is performed on a given node by a SocketFactory specif...
Definition
socket.cc:61
ns3::UdpSocketFactoryImpl::UdpSocketFactoryImpl
UdpSocketFactoryImpl()
Definition
udp-socket-factory-impl.cc:18
ns3::UdpSocketFactoryImpl::SetUdp
void SetUdp(Ptr< UdpL4Protocol > udp)
Set the associated UDP L4 protocol.
Definition
udp-socket-factory-impl.cc:29
ns3::UdpSocketFactoryImpl::~UdpSocketFactoryImpl
~UdpSocketFactoryImpl() override
Definition
udp-socket-factory-impl.cc:23
ns3::UdpSocketFactoryImpl::DoDispose
void DoDispose() override
Destructor implementation.
Definition
udp-socket-factory-impl.cc:41
ns3::UdpSocketFactoryImpl::CreateSocket
Ptr< Socket > CreateSocket() override
Implements a method to create a Udp-based socket and return a base class smart pointer to the socket.
Definition
udp-socket-factory-impl.cc:35
ns3::UdpSocketFactoryImpl::m_udp
Ptr< UdpL4Protocol > m_udp
the associated UDP L4 protocol
Definition
udp-socket-factory-impl.h:53
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
Every class exported by the ns3 library is enclosed in the ns3 namespace.
udp-l4-protocol.h
udp-socket-factory-impl.h
src
internet
model
udp-socket-factory-impl.cc
Generated on Fri Nov 8 2024 13:59:01 for ns-3 by
1.11.0