#include <trace-tools/pcap/frame_descriptor.hh>
Public Types | |
typedef boost::shared_ptr < const pkthdr > | pkthdr_ptr |
typedef boost::shared_ptr < const uint8_t > | bytes_ptr |
Public Member Functions | |
frame_descriptor (const pkthdr *header, const void *bytes) | |
const pkthdr_ptr & | pcap_header () const |
const bytes_ptr & | bytes () const |
std::ostream & | print (std::ostream &) const |
Equality checks | |
bool | operator== (const frame_descriptor &) const |
bool | operator!= (const frame_descriptor &) const |
A frame descriptor holds a frame's PCAP header and bytes.
Upon construction, both the frame's PCAP header and bytes are deep-copied into the descriptor. You may therefore work with the frame descriptor after the original frame information has been invalidated.
Frame descriptors use shared pointers to store frame information. You may copy them efficiently. You may also retrieve smart pointer to both the frame's PCAP header and bytes.
typedef boost::shared_ptr<const pkthdr> pcapxx::frame_descriptor::pkthdr_ptr |
Smart pointer to a frame's PCAP header.
typedef boost::shared_ptr<const uint8_t> pcapxx::frame_descriptor::bytes_ptr |
Smart pointer to a frame's bytes.
pcapxx::frame_descriptor::frame_descriptor | ( | const pkthdr * | header, | |
const void * | bytes | |||
) | [inline] |
Build a PCAP frame descriptor from corresponding PCAP header and bytes.
The content of header
and bytes
are deep-copied into the frame descriptor at construction. The descriptor does therefore remain valid even after header
and bytes
have bee invalidated.
const frame_descriptor::pkthdr_ptr & pcapxx::frame_descriptor::pcap_header | ( | ) | const [inline] |
Get a smart pointer to the frame's PCAP header.
const frame_descriptor::bytes_ptr & pcapxx::frame_descriptor::bytes | ( | ) | const [inline] |
Get a smart pointer to the frame's data.
std::ostream & pcapxx::frame_descriptor::print | ( | std::ostream & | os | ) | const [inline] |
Dump a frame descriptor to a C++ stream.