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< DCP > | fragment_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
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.
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
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.
bool famouso::mw::afp::DefragmentationStep< AFPDC >::event_complete | ( | ) | const [inline] |
Returns whether an event is complete after fragment has been processed.
References famouso::mw::afp::DefragmentationStep< AFPDC >::event_data.
Referenced by famouso::mw::afp::DefragmentationProcessor< AFP_DefragConfig >::event_processed(), famouso::mw::anl::AbstractNetworkLayer< NL, AFP_FragConfig, AFP_DefragConfig >::fetch(), and famouso::mw::afp::DefragmentationProcessorANL< AFP_DefragConfig >::process_fragment().
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().
elen_t famouso::mw::afp::DefragmentationStep< AFPDC >::get_event_length | ( | ) | const [inline] |
Returns length of the event.
References famouso::mw::afp::DefragmentationStep< AFPDC >::event_length.
Referenced by famouso::mw::anl::AbstractNetworkLayer< NL, AFP_FragConfig, AFP_DefragConfig >::fetch().
Friends And Related Function Documentation
friend class DefragmentationProcessor< AFPDC > [friend] |
friend class DefragmentationProcessorANL< AFPDC > [friend] |
friend class DefragmentationProcessorKeepEventSupport< AFPDC > [friend] |
Field Documentation
void* famouso::mw::afp::DefragmentationStep< AFPDC >::defragmenter_handle [protected] |
Handle of defragmenter this fragment belongs to.
Referenced by famouso::mw::afp::DefragmentationProcessor< AFP_DefragConfig >::event_processed(), famouso::mw::afp::DefragmentationProcessorKeepEventSupport< AFPDC >::keep_event(), famouso::mw::afp::DefragmentationProcessorANL< AFP_DefragConfig >::process_fragment(), and famouso::mw::afp::DefragmentationProcessor< AFP_DefragConfig >::process_fragment().
uint8_t* famouso::mw::afp::DefragmentationStep< AFPDC >::event_data [protected] |
Pointer to event's data. Null if event is not complete yet.
Referenced by famouso::mw::afp::DefragmentationStep< AFPDC >::event_complete(), famouso::mw::afp::DefragmentationStep< AFPDC >::get_event_data(), famouso::mw::afp::DefragmentationProcessorKeepEventSupport< AFPDC >::keep_event(), and famouso::mw::afp::DefragmentationProcessor< AFP_DefragConfig >::process_fragment().
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().
elen_t famouso::mw::afp::DefragmentationStep< AFPDC >::event_length [protected] |
Event's data length.
Referenced by famouso::mw::afp::DefragmentationStep< AFPDC >::get_event_length(), and famouso::mw::afp::DefragmentationProcessor< AFP_DefragConfig >::process_fragment().
defrag::Headers<DCP> famouso::mw::afp::DefragmentationStep< AFPDC >::fragment_header [protected] |
Header of the fragment.
Referenced by famouso::mw::afp::DefragmentationStep< AFPDC >::error(), and famouso::mw::afp::DefragmentationProcessor< AFP_DefragConfig >::process_fragment().
const uint8_t* famouso::mw::afp::DefragmentationStep< AFPDC >::fragment_payload [protected] |
Pointer to fragment's payload.
Referenced by famouso::mw::afp::DefragmentationProcessor< AFP_DefragConfig >::process_fragment().
flen_t famouso::mw::afp::DefragmentationStep< AFPDC >::fragment_payload_length [protected] |
Length of fragment's payload.
Referenced by famouso::mw::afp::DefragmentationProcessor< AFP_DefragConfig >::process_fragment().
The documentation for this class was generated from the following file:
- include/mw/afp/Defragmentation.h