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
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
14
namespace
ns3
15
{
16
17
class
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
*/
37
class
SocketFactory
:
public
Object
38
{
39
public
:
40
/**
41
* @brief Get the type ID.
42
* @return the object TypeId
43
*/
44
static
TypeId
GetTypeId
();
45
46
SocketFactory
();
47
48
/**
49
* @return smart pointer to Socket
50
*
51
* Base class method for creating socket instances.
52
*/
53
virtual
Ptr<Socket>
CreateSocket
() = 0;
54
};
55
56
}
// namespace ns3
57
58
#endif
/* SOCKET_FACTORY_H */
ns3::Object
A base class which provides memory management and object aggregation.
Definition
object.h:78
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
mpi-test-fixtures.h:37
ns3::SocketFactory
Object to create transport layer instances that provide a socket API to applications.
Definition
socket-factory.h:38
ns3::SocketFactory::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition
socket-factory.cc:20
ns3::SocketFactory::CreateSocket
virtual Ptr< Socket > CreateSocket()=0
ns3::SocketFactory::SocketFactory
SocketFactory()
Definition
socket-factory.cc:26
ns3::TypeId
a unique identifier for an interface.
Definition
type-id.h:48
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
network
model
socket-factory.h
Generated on Wed Dec 4 2024 09:20:48 for ns-3 by
1.11.0