Menu

famouso::mw::afp::DefragmentationStep< AFPDC > Class Template Reference

Contains temporary data needed for a single defragmentation step (reading fragments header, processing fragment and if event is complete returning buffer, process event, free event). More...

#include <Defragmentation.h>

Data Structures

struct  subject_caster
 Helper to cast subject to internal representation (identical in most use cases). More...
struct  subject_caster< true, ST >
 Helper to cast subject to internal representation (EmptyType in single subject config). More...

Public Member Functions

template<class ST >
 DefragmentationStep (const uint8_t *fdata, flen_t flength, const ST &subject)
 Construct object and read header.
 DefragmentationStep (const uint8_t *fdata, flen_t flength)
 Construct object and read header.
bool error () const
 Return whether an error occured while reading header.
bool event_complete () const
 Returns whether an event is complete after fragment has been processed.
uint8_t * get_event_data () const
 Returns pointer to event data or NULL if event is not complete yet.
elen_t get_event_length () const
 Returns length of the event.

Protected Attributes

defrag::Headers< DCPfragment_header
 Header of the fragment.
const uint8_t * fragment_payload
 Pointer to fragment's payload.
flen_t fragment_payload_length
 Length of fragment's payload.
DemuxKeyType event_demux_key
 Key to identify the event this fragment belongs to.
void * defragmenter_handle
 Handle of defragmenter this fragment belongs to.
uint8_t * event_data
 Pointer to event's data. Null if event is not complete yet.
elen_t event_length
 Event's data length.

Friends

class DefragmentationProcessor< AFPDC >
class DefragmentationProcessorKeepEventSupport< AFPDC >
class DefragmentationProcessorANL< AFPDC >

Detailed Description

template<class AFPDC>
class famouso::mw::afp::DefragmentationStep< AFPDC >

Contains temporary data needed for a single defragmentation step (reading fragments header, processing fragment and if event is complete returning buffer, process event, free event).

Create a new instance (on the stack) for every fragment you receive.

Template Parameters:
AFPDC AFP defragmentation config

Constructor & Destructor Documentation

template<class AFPDC>
template<class ST >
famouso::mw::afp::DefragmentationStep< AFPDC >::DefragmentationStep ( const uint8_t *  fdata,
flen_t  flength,
const ST &  subject 
) [inline]

Construct object and read header.

Use this constructor for multiple subject configurations. If you use this constructor for one subject configurations, the subject parameter will be ignored.

template<class AFPDC>
famouso::mw::afp::DefragmentationStep< AFPDC >::DefragmentationStep ( const uint8_t *  fdata,
flen_t  flength 
) [inline]

Construct object and read header.

Use this constructor for one subject configurations

References FAMOUSO_STATIC_ASSERT_ERROR.


Member Function Documentation

template<class AFPDC>
bool famouso::mw::afp::DefragmentationStep< AFPDC >::error (  )  const [inline]

Return whether an error occured while reading header.

DefragmentationProcessor::process() checks this as well. You needn't call this if you are not interested whether an error occured or not.

References famouso::mw::afp::DefragmentationStep< AFPDC >::fragment_header.

template<class AFPDC>
uint8_t* famouso::mw::afp::DefragmentationStep< AFPDC >::get_event_data (  )  const [inline]

Returns pointer to event data or NULL if event is not complete yet.

References famouso::mw::afp::DefragmentationStep< AFPDC >::event_data.

Referenced by famouso::mw::anl::AbstractNetworkLayer< NL, AFP_FragConfig, AFP_DefragConfig >::fetch().

template<class AFPDC>
elen_t famouso::mw::afp::DefragmentationStep< AFPDC >::get_event_length (  )  const [inline]

Friends And Related Function Documentation

template<class AFPDC>
friend class DefragmentationProcessor< AFPDC > [friend]
template<class AFPDC>
friend class DefragmentationProcessorANL< AFPDC > [friend]
template<class AFPDC>
friend class DefragmentationProcessorKeepEventSupport< AFPDC > [friend]

Field Documentation

template<class AFPDC>
DemuxKeyType famouso::mw::afp::DefragmentationStep< AFPDC >::event_demux_key [protected]

Key to identify the event this fragment belongs to.

Referenced by famouso::mw::afp::DefragmentationProcessor< AFP_DefragConfig >::process_fragment().

template<class AFPDC>
const uint8_t* famouso::mw::afp::DefragmentationStep< AFPDC >::fragment_payload [protected]
template<class AFPDC>
flen_t famouso::mw::afp::DefragmentationStep< AFPDC >::fragment_payload_length [protected]

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