EventHelix.com: CASE Tools; Real-time and Embedded System Design; Object Oriented Design EventStudio 2.0: System Engineering CASE ToolEventStudio 2.5
Sequence diagram based system design and modeling
Home   What's New   EventStudio 2.5   Real-time Mantra   Thought Projects   Contact Us
Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

Protocol_Layer Class Reference

#include <Protocol_Layer.h>

Inheritance diagram for Protocol_Layer:

Inheritance graph
[legend]
Collaboration diagram for Protocol_Layer:

Collaboration graph
[legend]
List of all members.

Detailed Description

Protocol Layer class serves as the foundation for the Protocol Layer design pattern.

This class defines the common interface for interactions between different layers of a protocol. This has several advantages:

Note that this transparent layered design is possible because the Protocol_Packet class directly supports addition and removal of layer specific protocol headers and trailers without allocating new buffers at every layer boundary.

See also:
Protocol Layer Design Pattern

Definition at line 32 of file Protocol_Layer.h.

Public Member Functions

 Protocol_Layer ()
 Create a protocol layer object.

virtual void Transmit (Protocol_Packet *p_Packet)=0
 Process and transmit the packet passed by higher layer.

virtual void Handle_Receive (Protocol_Packet *p_Packet)=0
 Receive and process the packets passed by a lower layer.

void Set_Upper_Layer (Protocol_Layer *p_Layer)
 Set the upper protocol layer.

void Set_Lower_Layer (Protocol_Layer *p_Layer)
 Set the lower protocol layer.

Protocol_LayerGet_Upper_Layer () const
 Get the upper protocol layer.

Protocol_LayerGet_Lower_Layer () const
 Get the lower protocol layer.


Private Attributes

Protocol_Layerm_p_Lower_Layer
 Pointer to the lower layer.

Protocol_Layerm_p_Upper_Layer
 Pointer to the lower layer.


Constructor & Destructor Documentation

Protocol_Layer::Protocol_Layer  ) [inline]
 

Create a protocol layer object.

The lower and upper protocol layers are defaulted to NULL value.

See also:
Protocol Layer Design Pattern

Definition at line 52 of file Protocol_Layer.h.

00053     {
00054         m_p_Lower_Layer = NULL;
00055         m_p_Upper_Layer = NULL;
00056     }


Member Function Documentation

virtual void Protocol_Layer::Transmit Protocol_Packetp_Packet  ) [pure virtual]
 

Process and transmit the packet passed by higher layer.

The packets are passed to the lower layer.

This is a pure virtual function. All inheriting classes must implement this method.

Parameters:
p_Packet Pointer to the packet received from the upper layer.
See also:
Protocol Layer Design Pattern

Implemented in Datalink_Layer.

virtual void Protocol_Layer::Handle_Receive Protocol_Packetp_Packet  ) [pure virtual]
 

Receive and process the packets passed by a lower layer.

After processing, the packet will be passed to the upper layer.

This is a pure virtual function. All inheriting classes must implement this method.

Parameters:
p_Packet Pointer to the packet received from the lower layer.
See also:
Protocol Layer Design Pattern

Implemented in Datalink_Layer.

void Protocol_Layer::Set_Upper_Layer Protocol_Layerp_Layer  ) [inline]
 

Set the upper protocol layer.

Messages received from the lower layer will be passed to this layer for upper layer handling.

Parameters:
p_Layer Pointer to the upper layer for this layer.
See also:
Protocol Layer Design Pattern

Definition at line 85 of file Protocol_Layer.h.

00086     {   m_p_Upper_Layer = p_Layer; }

void Protocol_Layer::Set_Lower_Layer Protocol_Layerp_Layer  ) [inline]
 

Set the lower protocol layer.

Messages received from the upper layer will be passed to this layer for lower layer handling.

Parameters:
p_Layer Pointer to the lower layer for this layer.
See also:
Protocol Layer Design Pattern

Definition at line 96 of file Protocol_Layer.h.

00097     {   m_p_Lower_Layer = p_Layer; }

Protocol_Layer* Protocol_Layer::Get_Upper_Layer  ) const [inline]
 

Get the upper protocol layer.

Messages received from the lower layer will be passed to this layer for upper layer handling.

Return values:
Protocol_Layer Pointer to the upper layer.
See also:
Protocol Layer Design Pattern

Definition at line 107 of file Protocol_Layer.h.

00108     {   return m_p_Upper_Layer; }

Protocol_Layer* Protocol_Layer::Get_Lower_Layer  ) const [inline]
 

Get the lower protocol layer.

Messages received from the upper layer will be passed to this layer for lower layer handling.

Return values:
Protocol_Layer Pointer to the lower layer.
See also:
Protocol Layer Design Pattern

Definition at line 118 of file Protocol_Layer.h.

00119     {   return m_p_Lower_Layer; }


Member Data Documentation

Protocol_Layer* Protocol_Layer::m_p_Lower_Layer [private]
 

Pointer to the lower layer.

Initialized by Set_Lower_Layer method.

This pointers can change dynamically as protocol layers are added and deleted. Thus the pointer value should always be obtained from the Layer object just before sending the message.

Definition at line 38 of file Protocol_Layer.h.

Protocol_Layer* Protocol_Layer::m_p_Upper_Layer [private]
 

Pointer to the lower layer.

Initialized by the Set_Upper_Layer method.

This pointers can change dynamically as protocol layers are added and deleted. Thus the pointer value should always be obtained from the Layer object just before sending the message.

Definition at line 44 of file Protocol_Layer.h.


The documentation for this class was generated from the following file:
Generated on Sun Feb 13 21:30:34 2005 for Object Oriented Design Examples by doxygen 1.3.4
 Home   What's New   EventStudio 2.5   Real-time Mantra   Thought Projects   Contact Us
Copyright © 2000-2005 EventHelix.com Inc. All Rights Reserved.