A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
socket-factory.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 SOCKET_FACTORY_H
9#define SOCKET_FACTORY_H
10
11#include "ns3/object.h"
12#include "ns3/ptr.h"
13
14namespace ns3
15{
16
17class Socket;
18
19/**
20 * @ingroup socket
21 *
22 * @brief Object to create transport layer instances that provide a
23 * socket API to applications.
24 *
25 * This base class defines the API for creating sockets.
26 * The socket factory also can hold the global variables used to
27 * initialize newly created sockets, such as values that are
28 * set through the sysctl or proc interfaces in Linux.
29
30 * If you want to write a new transport protocol accessible through
31 * sockets, you need to subclass this factory class, implement CreateSocket,
32 * instantiate the object, and aggregate it to the node.
33 *
34 * @see Udp
35 * @see UdpImpl
36 */
37class SocketFactory : public Object
38{
39 public:
40 /**
41 * @brief Get the type ID.
42 * @return the object TypeId
43 */
44 static TypeId GetTypeId();
45
47
48 /**
49 * @return smart pointer to Socket
50 *
51 * Base class method for creating socket instances.
52 */
54};
55
56} // namespace ns3
57
58#endif /* SOCKET_FACTORY_H */
A base class which provides memory management and object aggregation.
Definition object.h:78
Smart pointer class similar to boost::intrusive_ptr.
Object to create transport layer instances that provide a socket API to applications.
static TypeId GetTypeId()
Get the type ID.
virtual Ptr< Socket > CreateSocket()=0
a unique identifier for an interface.
Definition type-id.h:48
Every class exported by the ns3 library is enclosed in the ns3 namespace.