wscout::gui::Packet Class Reference

Packet widget. More...

#include <wscout_gui_packet.hh>

List of all members.

Public Types

typedef
pcapxx::descriptor::iterator::value_type 
packet
typedef
pcapxx::descriptor::link_type 
link_type
typedef AbstractHeader *(* header_allocator )()
typedef std::map< protocol::id,
header_allocator
protocol_map

Public Slots

void setSelected (bool state=true)

Public Member Functions

 Packet (QWidget *parent=0)
void setup (const Trace &t, const packet &p)
QBoxLayout * layout ()

Static Public Member Functions

static void registerProtocol (protocol::id, header_allocator)
static protocol_mapprotocols ()


Detailed Description

Packet widget.

Each instance represent a single packet. Protocol header widgets register themselves to this class using the registerProtocol() static method.

See also:
AbstractHeader, HeaderBase

Member Typedef Documentation

typedef pcapxx::descriptor ::iterator::value_type wscout::gui::Packet::packet

PCAP packet.

typedef pcapxx::descriptor ::link_type wscout::gui::Packet::link_type

PCAP link type.

Protocol header widget allocation function.

Map from protocol identifiers to protocol header allocators.


Constructor & Destructor Documentation

wscout::gui::Packet::Packet ( QWidget *  parent = 0  )  [inline]

Default constructor.

References setSelected().


Member Function Documentation

void wscout::gui::Packet::setup ( const Trace t,
const packet p 
)

Setup the widget for a given link type, sequence number and PCAP packet.

References layout(), wscout::protocol::PCAP, protocols(), and wscout::gui::AbstractHeader::setup().

Referenced by wscout::gui::Trace::update().

QBoxLayout * wscout::gui::Packet::layout (  )  [inline]

Packet layout.

Referenced by setup().

void wscout::gui::Packet::registerProtocol ( protocol::id  id,
header_allocator  a 
) [inline, static]

Register a protocol header allocator for a given protocol.

All Packet instances share a common structure that maps protocol ids to protocol header allocators. Whenever Packet::setup() encounters a registered protocol, it calls the corresponding allocator to create a protocol header widget to embed.

This function registers protocol ids and header allocators.

See also:
AbstractHeader, header_allocator

References protocols().

Referenced by wscout::gui::HeaderBase< Exact, Proto >::registerProtocol().

Packet::protocol_map & wscout::gui::Packet::protocols (  )  [inline, static]

Get the global protocol map.

Not a static variable to avoid cross-module initialization order issues.

Referenced by registerProtocol(), and setup().

void wscout::gui::Packet::setSelected ( bool  state = true  )  [inline, slot]

Select/unselect the packet.

Referenced by Packet(), and wscout::gui::Trace::update().


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

Generated on Fri Mar 28 14:53:38 2008 for WScout by  doxygen 1.5.5