A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
packet-socket-factory.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2007 Emmanuelle Laprise
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
7 */
9
10#include "packet-socket.h"
11
12#include "ns3/log.h"
13#include "ns3/node.h"
14
15namespace ns3
16{
17
18NS_LOG_COMPONENT_DEFINE("PacketSocketFactory");
19
20NS_OBJECT_ENSURE_REGISTERED(PacketSocketFactory);
21
22TypeId
24{
25 static TypeId tid =
26 TypeId("ns3::PacketSocketFactory").SetParent<SocketFactory>().SetGroupName("Network");
27 return tid;
28}
29
34
37{
38 NS_LOG_FUNCTION(this);
41 socket->SetNode(node);
42 return socket;
43}
44} // namespace ns3
Ptr< T > GetObject() const
Get a pointer to the requested aggregated Object.
Definition object.h:511
Ptr< Socket > CreateSocket() override
Creates a PacketSocket and returns a pointer to it.
static TypeId GetTypeId()
Get the type ID.
Smart pointer class similar to boost::intrusive_ptr.
Object to create transport layer instances that provide a socket API to applications.
a unique identifier for an interface.
Definition type-id.h:48
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition type-id.cc:1001
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition log.h:191
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
Definition object.h:619
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition object-base.h:35
Every class exported by the ns3 library is enclosed in the ns3 namespace.