A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
udp-socket-factory-impl.h
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#ifndef UDP_SOCKET_FACTORY_IMPL_H
9#define UDP_SOCKET_FACTORY_IMPL_H
10
11#include "udp-socket-factory.h"
12
13#include "ns3/ptr.h"
14
15namespace ns3
16{
17
18class UdpL4Protocol;
19
20/**
21 * \ingroup socket
22 * \ingroup udp
23 *
24 * \brief Object to create UDP socket instances
25 *
26 * This class implements the API for creating UDP sockets.
27 * It is a socket factory (deriving from class SocketFactory).
28 */
30{
31 public:
33 ~UdpSocketFactoryImpl() override;
34
35 /**
36 * \brief Set the associated UDP L4 protocol.
37 * \param udp the UDP L4 protocol
38 */
39 void SetUdp(Ptr<UdpL4Protocol> udp);
40
41 /**
42 * \brief Implements a method to create a Udp-based socket and return
43 * a base class smart pointer to the socket.
44 *
45 * \return smart pointer to Socket
46 */
47 Ptr<Socket> CreateSocket() override;
48
49 protected:
50 void DoDispose() override;
51
52 private:
53 Ptr<UdpL4Protocol> m_udp; //!< the associated UDP L4 protocol
54};
55
56} // namespace ns3
57
58#endif /* UDP_SOCKET_FACTORY_IMPL_H */
Smart pointer class similar to boost::intrusive_ptr.
API to create UDP socket instances.
Object to create UDP socket instances.
void SetUdp(Ptr< UdpL4Protocol > udp)
Set the associated UDP L4 protocol.
void DoDispose() override
Destructor implementation.
Ptr< Socket > CreateSocket() override
Implements a method to create a Udp-based socket and return a base class smart pointer to the socket.
Ptr< UdpL4Protocol > m_udp
the associated UDP L4 protocol
Every class exported by the ns3 library is enclosed in the ns3 namespace.