A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ns3::SimpleChannel Class Reference

A simple channel, for simple things and testing. More...

#include <simple-channel.h>

+ Inheritance diagram for ns3::SimpleChannel:
+ Collaboration diagram for ns3::SimpleChannel:

Public Member Functions

 SimpleChannel ()
void Add (Ptr< SimpleNetDevice > device)
virtual Ptr< NetDeviceGetDevice (uint32_t i) const
virtual uint32_t GetNDevices (void) const
void Send (Ptr< Packet > p, uint16_t protocol, Mac48Address to, Mac48Address from, Ptr< SimpleNetDevice > sender)
- Public Member Functions inherited from ns3::Channel
 Channel ()
virtual ~Channel ()
uint32_t GetId (void) const
- Public Member Functions inherited from ns3::Object
 Object ()
virtual ~Object ()
void AggregateObject (Ptr< Object > other)
void Dispose (void)
AggregateIterator GetAggregateIterator (void) const
virtual TypeId GetInstanceTypeId (void) const
template<typename T >
Ptr< T > GetObject (void) const
template<typename T >
Ptr< T > GetObject (TypeId tid) const
void Start (void)
- Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
 SimpleRefCount ()
 SimpleRefCount (const SimpleRefCount &o)
uint32_t GetReferenceCount (void) const
SimpleRefCountoperator= (const SimpleRefCount &o)
void Ref (void) const
void Unref (void) const
- Public Member Functions inherited from ns3::ObjectBase
virtual ~ObjectBase ()
void GetAttribute (std::string name, AttributeValue &value) const
bool GetAttributeFailSafe (std::string name, AttributeValue &attribute) const
void SetAttribute (std::string name, const AttributeValue &value)
bool SetAttributeFailSafe (std::string name, const AttributeValue &value)
bool TraceConnect (std::string name, std::string context, const CallbackBase &cb)
bool TraceConnectWithoutContext (std::string name, const CallbackBase &cb)
bool TraceDisconnect (std::string name, std::string context, const CallbackBase &cb)
bool TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb)

Static Public Member Functions

static TypeId GetTypeId (void)
 This method returns the TypeId associated to ns3::SimpleChannel.

Private Attributes

std::vector< Ptr
< SimpleNetDevice > > 
m_devices

Additional Inherited Members

- Protected Member Functions inherited from ns3::Object
 Object (const Object &o)
virtual void DoDispose (void)
virtual void DoStart (void)
virtual void NotifyNewAggregate (void)

Detailed Description

A simple channel, for simple things and testing.

Definition at line 36 of file simple-channel.h.

Constructor & Destructor Documentation

ns3::SimpleChannel::SimpleChannel ( )

Definition at line 43 of file simple-channel.cc.

Member Function Documentation

void ns3::SimpleChannel::Add ( Ptr< SimpleNetDevice device)

Definition at line 66 of file simple-channel.cc.

References m_devices.

Referenced by ns3::SimpleNetDevice::SetChannel().

+ Here is the caller graph for this function:

Ptr< NetDevice > ns3::SimpleChannel::GetDevice ( uint32_t  i) const
virtual
Parameters
iindex of NetDevice to retrieve
Returns
one of the NetDevices connected to this channel.

This method must be implemented by subclasses.

Implements ns3::Channel.

Definition at line 77 of file simple-channel.cc.

References m_devices.

uint32_t ns3::SimpleChannel::GetNDevices ( void  ) const
virtual
Returns
the number of NetDevices connected to this Channel.

This method must be implemented by subclasses.

Implements ns3::Channel.

Definition at line 72 of file simple-channel.cc.

References m_devices.

TypeId ns3::SimpleChannel::GetTypeId ( void  )
static

This method returns the TypeId associated to ns3::SimpleChannel.

No Attributes defined for this type.
Attributes defined in parent class ns3::Channel:

No TraceSources defined for this type.

Reimplemented from ns3::Channel.

Definition at line 34 of file simple-channel.cc.

References ns3::TypeId::SetParent().

+ Here is the call graph for this function:

void ns3::SimpleChannel::Send ( Ptr< Packet p,
uint16_t  protocol,
Mac48Address  to,
Mac48Address  from,
Ptr< SimpleNetDevice sender 
)

Definition at line 48 of file simple-channel.cc.

References ns3::Packet::Copy(), ns3::Node::GetId(), ns3::SimpleNetDevice::GetNode(), m_devices, NS_LOG_FUNCTION, ns3::SimpleNetDevice::Receive(), ns3::Simulator::ScheduleWithContext(), and ns3::Seconds().

Referenced by ns3::SimpleNetDevice::Send(), and ns3::SimpleNetDevice::SendFrom().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

std::vector<Ptr<SimpleNetDevice> > ns3::SimpleChannel::m_devices
private

Definition at line 52 of file simple-channel.h.

Referenced by Add(), GetDevice(), GetNDevices(), and Send().


The documentation for this class was generated from the following files: