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
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License version 2 as
6
* published by the Free Software Foundation;
7
*
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
12
*
13
* You should have received a copy of the GNU General Public License
14
* along with this program; if not, write to the Free Software
15
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16
*
17
* Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
18
*/
19
#ifndef SOCKET_FACTORY_H
20
#define SOCKET_FACTORY_H
21
22
#include "ns3/object.h"
23
#include "ns3/ptr.h"
24
25
namespace
ns3
26
{
27
28
class
Socket;
29
30
/**
31
* \ingroup socket
32
*
33
* \brief Object to create transport layer instances that provide a
34
* socket API to applications.
35
*
36
* This base class defines the API for creating sockets.
37
* The socket factory also can hold the global variables used to
38
* initialize newly created sockets, such as values that are
39
* set through the sysctl or proc interfaces in Linux.
40
41
* If you want to write a new transport protocol accessible through
42
* sockets, you need to subclass this factory class, implement CreateSocket,
43
* instantiate the object, and aggregate it to the node.
44
*
45
* \see Udp
46
* \see UdpImpl
47
*/
48
class
SocketFactory
:
public
Object
49
{
50
public
:
51
/**
52
* \brief Get the type ID.
53
* \return the object TypeId
54
*/
55
static
TypeId
GetTypeId
();
56
57
SocketFactory
();
58
59
/**
60
* \return smart pointer to Socket
61
*
62
* Base class method for creating socket instances.
63
*/
64
virtual
Ptr<Socket>
CreateSocket
() = 0;
65
};
66
67
}
// namespace ns3
68
69
#endif
/* SOCKET_FACTORY_H */
ns3::Object
A base class which provides memory management and object aggregation.
Definition:
object.h:89
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition:
ptr.h:77
ns3::SocketFactory
Object to create transport layer instances that provide a socket API to applications.
Definition:
socket-factory.h:49
ns3::SocketFactory::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition:
socket-factory.cc:31
ns3::SocketFactory::CreateSocket
virtual Ptr< Socket > CreateSocket()=0
ns3::SocketFactory::SocketFactory
SocketFactory()
Definition:
socket-factory.cc:37
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:59
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
network
model
socket-factory.h
Generated on Tue May 28 2024 23:38:34 for ns-3 by
1.9.6