Class to represent WiMAX connections. More...
#include "wimax-connection.h"
Public Types | |
typedef std::list< Ptr< const Packet > > | FragmentsQueue |
Definition of Fragments Queue data type. | |
Public Member Functions | |
WimaxConnection (Cid cid, Cid::Type type) | |
Constructor. | |
~WimaxConnection () override | |
void | ClearFragmentsQueue () |
delete all enqueued fragments | |
Ptr< Packet > | Dequeue (MacHeaderType::HeaderType packetType, uint32_t availableByte) |
dequeue a packet from the queue of the connection Dequeue the first packet in the queue if its size is lower than availableByte, the first availableByte of the first packet otherwise | |
Ptr< Packet > | Dequeue (MacHeaderType::HeaderType packetType=MacHeaderType::HEADER_TYPE_GENERIC) |
dequeue a packet from the queue of the connection | |
bool | Enqueue (Ptr< Packet > packet, const MacHeaderType &hdrType, const GenericMacHeader &hdr) |
enqueue a packet in the queue of the connection | |
void | FragmentEnqueue (Ptr< const Packet > fragment) |
enqueue a received packet (that is a fragment) into the fragments queue | |
Cid | GetCid () const |
Get CID function. | |
const FragmentsQueue | GetFragmentsQueue () const |
get a queue of received fragments | |
Ptr< WimaxMacQueue > | GetQueue () const |
uint8_t | GetSchedulingType () const |
ServiceFlow * | GetServiceFlow () const |
Cid::Type | GetType () const |
Get type function. | |
std::string | GetTypeStr () const |
Get type string. | |
bool | HasPackets () const |
bool | HasPackets (MacHeaderType::HeaderType packetType) const |
void | SetServiceFlow (ServiceFlow *serviceFlow) |
set the service flow associated to this connection | |
Public Member Functions inherited from ns3::Object | |
Object () | |
Constructor. | |
~Object () override | |
Destructor. | |
void | AggregateObject (Ptr< Object > other) |
Aggregate two Objects together. | |
void | Dispose () |
Dispose of this Object. | |
AggregateIterator | GetAggregateIterator () const |
Get an iterator to the Objects aggregated to this one. | |
TypeId | GetInstanceTypeId () const override |
Get the most derived TypeId for this Object. | |
template<typename T > | |
Ptr< T > | GetObject () const |
Get a pointer to the requested aggregated Object. | |
template<> | |
Ptr< Object > | GetObject () const |
Specialization of () for objects of type ns3::Object. | |
template<typename T > | |
Ptr< T > | GetObject (TypeId tid) const |
Get a pointer to the requested aggregated Object by TypeId. | |
template<> | |
Ptr< Object > | GetObject (TypeId tid) const |
Specialization of (TypeId tid) for objects of type ns3::Object. | |
void | Initialize () |
Invoke DoInitialize on all Objects aggregated to this one. | |
bool | IsInitialized () const |
Check if the object has been initialized. | |
void | UnidirectionalAggregateObject (Ptr< Object > other) |
Aggregate an Object to another Object. | |
Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter > | |
SimpleRefCount () | |
Default constructor. | |
SimpleRefCount (const SimpleRefCount &o) | |
Copy constructor. | |
uint32_t | GetReferenceCount () const |
Get the reference count of the object. | |
SimpleRefCount & | operator= (const SimpleRefCount &o) |
Assignment operator. | |
void | Ref () const |
Increment the reference count. | |
void | Unref () const |
Decrement the reference count. | |
Public Member Functions inherited from ns3::ObjectBase | |
virtual | ~ObjectBase () |
Virtual destructor. | |
void | GetAttribute (std::string name, AttributeValue &value, bool permissive=false) const |
Get the value of an attribute, raising fatal errors if unsuccessful. | |
bool | GetAttributeFailSafe (std::string name, AttributeValue &value) const |
Get the value of an attribute without raising errors. | |
void | SetAttribute (std::string name, const AttributeValue &value) |
Set a single attribute, raising fatal errors if unsuccessful. | |
bool | SetAttributeFailSafe (std::string name, const AttributeValue &value) |
Set a single attribute without raising errors. | |
bool | TraceConnect (std::string name, std::string context, const CallbackBase &cb) |
Connect a TraceSource to a Callback with a context. | |
bool | TraceConnectWithoutContext (std::string name, const CallbackBase &cb) |
Connect a TraceSource to a Callback without a context. | |
bool | TraceDisconnect (std::string name, std::string context, const CallbackBase &cb) |
Disconnect from a TraceSource a Callback previously connected with a context. | |
bool | TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb) |
Disconnect from a TraceSource a Callback previously connected without a context. | |
Static Public Member Functions | |
static TypeId | GetTypeId () |
Get the type ID. | |
Static Public Member Functions inherited from ns3::Object | |
static TypeId | GetTypeId () |
Register this type. | |
Static Public Member Functions inherited from ns3::ObjectBase | |
static TypeId | GetTypeId () |
Get the type ID. | |
Private Member Functions | |
void | DoDispose () override |
Destructor implementation. | |
Private Attributes | |
Cid | m_cid |
CID. | |
Cid::Type | m_cidType |
CID type. | |
FragmentsQueue | m_fragmentsQueue |
fragments queue | |
Ptr< WimaxMacQueue > | m_queue |
queue | |
ServiceFlow * | m_serviceFlow |
service flow | |
Additional Inherited Members | |
Protected Member Functions inherited from ns3::Object | |
Object (const Object &o) | |
Copy an Object. | |
virtual void | DoInitialize () |
Initialize() implementation. | |
virtual void | NotifyNewAggregate () |
Notify all Objects aggregated to this one of a new Object being aggregated. | |
Protected Member Functions inherited from ns3::ObjectBase | |
void | ConstructSelf (const AttributeConstructionList &attributes) |
Complete construction of ObjectBase; invoked by derived classes. | |
virtual void | NotifyConstructionCompleted () |
Notifier called once the ObjectBase is fully constructed. | |
Related Symbols inherited from ns3::ObjectBase | |
static TypeId | GetObjectIid () |
Ensure the TypeId for ObjectBase gets fully configured to anchor the inheritance tree properly. | |
Class to represent WiMAX connections.
Definition at line 33 of file wimax-connection.h.
typedef std::list<Ptr<const Packet> > ns3::WimaxConnection::FragmentsQueue |
Definition of Fragments Queue data type.
Definition at line 124 of file wimax-connection.h.
Constructor.
cid | connection ID |
type | CID type |
Definition at line 59 of file wimax-connection.cc.
|
override |
Definition at line 67 of file wimax-connection.cc.
void ns3::WimaxConnection::ClearFragmentsQueue | ( | ) |
delete all enqueued fragments
Definition at line 184 of file wimax-connection.cc.
References m_fragmentsQueue.
Ptr< Packet > ns3::WimaxConnection::Dequeue | ( | MacHeaderType::HeaderType | packetType, |
uint32_t | availableByte ) |
dequeue a packet from the queue of the connection Dequeue the first packet in the queue if its size is lower than availableByte, the first availableByte of the first packet otherwise
packetType | the type of the packet to dequeue |
availableByte | the number of available bytes |
Definition at line 129 of file wimax-connection.cc.
References m_queue.
Ptr< Packet > ns3::WimaxConnection::Dequeue | ( | MacHeaderType::HeaderType | packetType = MacHeaderType::HEADER_TYPE_GENERIC | ) |
dequeue a packet from the queue of the connection
packetType | the type of the packet to dequeue |
Definition at line 123 of file wimax-connection.cc.
References m_queue.
|
overrideprivatevirtual |
Destructor implementation.
This method is called by Dispose() or by the Object's destructor, whichever comes first.
Subclasses are expected to implement their real destruction code in an overridden version of this method and chain up to their parent's implementation once they are done. i.e, for simplicity, the destructor of every subclass should be empty and its content should be moved to the associated DoDispose() method.
It is safe to call GetObject() from within this method.
Reimplemented from ns3::Object.
Definition at line 72 of file wimax-connection.cc.
References m_queue.
bool ns3::WimaxConnection::Enqueue | ( | Ptr< Packet > | packet, |
const MacHeaderType & | hdrType, | ||
const GenericMacHeader & | hdr ) |
enqueue a packet in the queue of the connection
packet | the packet to be enqueued |
hdrType | the header type of the packet |
hdr | the header of the packet |
Definition at line 115 of file wimax-connection.cc.
References m_queue.
enqueue a received packet (that is a fragment) into the fragments queue
fragment | received fragment |
Definition at line 178 of file wimax-connection.cc.
References m_fragmentsQueue.
Cid ns3::WimaxConnection::GetCid | ( | ) | const |
Get CID function.
Definition at line 79 of file wimax-connection.cc.
References m_cid.
const WimaxConnection::FragmentsQueue ns3::WimaxConnection::GetFragmentsQueue | ( | ) | const |
get a queue of received fragments
Definition at line 172 of file wimax-connection.cc.
References m_fragmentsQueue.
Ptr< WimaxMacQueue > ns3::WimaxConnection::GetQueue | ( | ) | const |
Definition at line 91 of file wimax-connection.cc.
References m_queue.
Referenced by GetTypeId().
uint8_t ns3::WimaxConnection::GetSchedulingType | ( | ) | const |
Definition at line 109 of file wimax-connection.cc.
References ns3::ServiceFlow::GetSchedulingType(), and m_serviceFlow.
ServiceFlow * ns3::WimaxConnection::GetServiceFlow | ( | ) | const |
Definition at line 103 of file wimax-connection.cc.
References m_serviceFlow.
Cid::Type ns3::WimaxConnection::GetType | ( | ) | const |
Get type function.
Definition at line 85 of file wimax-connection.cc.
References m_cidType.
Referenced by GetTypeId().
|
static |
Get the type ID.
Definition at line 24 of file wimax-connection.cc.
References ns3::Cid::BASIC, ns3::Cid::BROADCAST, GetQueue(), GetType(), ns3::Cid::INITIAL_RANGING, ns3::MakeEnumAccessor(), ns3::MakeEnumChecker(), ns3::MakePointerAccessor(), ns3::MakePointerChecker(), ns3::Cid::MULTICAST, ns3::Cid::PADDING, ns3::Cid::PRIMARY, ns3::TypeId::SetParent(), and ns3::Cid::TRANSPORT.
std::string ns3::WimaxConnection::GetTypeStr | ( | ) | const |
Get type string.
Definition at line 147 of file wimax-connection.cc.
References ns3::Cid::BASIC, ns3::Cid::BROADCAST, ns3::Cid::INITIAL_RANGING, m_cidType, ns3::Cid::MULTICAST, NS_FATAL_ERROR, ns3::Cid::PRIMARY, and ns3::Cid::TRANSPORT.
bool ns3::WimaxConnection::HasPackets | ( | ) | const |
Definition at line 135 of file wimax-connection.cc.
References m_queue.
bool ns3::WimaxConnection::HasPackets | ( | MacHeaderType::HeaderType | packetType | ) | const |
packetType | type of packet to check in the queue |
Definition at line 141 of file wimax-connection.cc.
References m_queue.
void ns3::WimaxConnection::SetServiceFlow | ( | ServiceFlow * | serviceFlow | ) |
set the service flow associated to this connection
serviceFlow | The service flow to be associated to this connection |
Definition at line 97 of file wimax-connection.cc.
References m_serviceFlow.
|
private |
|
private |
CID type.
Definition at line 144 of file wimax-connection.h.
Referenced by GetType(), and GetTypeStr().
|
private |
fragments queue
Definition at line 149 of file wimax-connection.h.
Referenced by ClearFragmentsQueue(), FragmentEnqueue(), and GetFragmentsQueue().
|
private |
queue
Definition at line 145 of file wimax-connection.h.
Referenced by Dequeue(), Dequeue(), DoDispose(), Enqueue(), GetQueue(), HasPackets(), and HasPackets().
|
private |
service flow
Definition at line 146 of file wimax-connection.h.
Referenced by GetSchedulingType(), GetServiceFlow(), and SetServiceFlow().