famouso::mw::afp::defrag::OutOfOrderEventDataReconstructor< DCP > Class Template Reference
Policy: Reconstruct event data from fragments that may arrive out of order. Does not support forward error correction. More...
#include <OutOfOrderEventDataReconstructor.h>
Public Types | |
typedef NoFECHeaderSupport< DCP > | FECHeaderPolicy |
Public Member Functions | |
OutOfOrderEventDataReconstructor (flen_t no_ext_mtu) | |
Constructor. | |
~OutOfOrderEventDataReconstructor () | |
Destructor. | |
void | put_fragment (const Headers< DCP > &header, const uint8_t *data, flen_t length) |
Process new fragment. | |
bool | is_complete () |
Returns whether the event already got reconstructed completely. | |
uint8_t * | get_data () |
Returns the defragmented data block. | |
elen_t | get_length () |
Returns the length of the event's data. | |
bool | error () |
Returns true if an error occured and event cannot be reconstructed for sure. | |
Protected Member Functions | |
void | realloc_event_data (fcount_t new_fragment_count) |
Prepending realloc (add memory in front). | |
Protected Attributes | |
uint8_t * | event_data |
Points to restored data block. | |
uint8_t * | behind_event_data |
Points behind restored data block. | |
elen_t | event_length |
Length of the currently restored data (sum of put fragment's length). | |
bool | event_fragment_count_final |
false, if first fragment did not arrive (yet) | |
fcount_t | event_fragment_count |
Count of fragments the event consists of. | |
fcount_t | arrived_fragment_count |
Count of data chunks collected. | |
flen_t | no_ext_mtu |
MTU minus extension header's length. Zero encodes error status of this object. |
Detailed Description
template<class DCP>
class famouso::mw::afp::defrag::OutOfOrderEventDataReconstructor< DCP >
Policy: Reconstruct event data from fragments that may arrive out of order. Does not support forward error correction.
Using this policy automatically selects NoFECHeaderSupport as FEC header policy.
Alternative policies: InOrderEventDataReconstructor, FECEventDataReconstructor
Member Typedef Documentation
typedef NoFECHeaderSupport<DCP> famouso::mw::afp::defrag::OutOfOrderEventDataReconstructor< DCP >::FECHeaderPolicy |
Reimplemented in famouso::mw::afp::defrag::FECEventDataReconstructor< DCP >.
Constructor & Destructor Documentation
famouso::mw::afp::defrag::OutOfOrderEventDataReconstructor< DCP >::OutOfOrderEventDataReconstructor | ( | flen_t | no_ext_mtu | ) | [inline] |
Constructor.
- Parameters:
-
no_ext_mtu MTU minus extension header's length
famouso::mw::afp::defrag::OutOfOrderEventDataReconstructor< DCP >::~OutOfOrderEventDataReconstructor | ( | ) | [inline] |
Destructor.
References famouso::mw::afp::defrag::OutOfOrderEventDataReconstructor< DCP >::arrived_fragment_count, famouso::mw::afp::defrag::OutOfOrderEventDataReconstructor< DCP >::event_data, famouso::mw::afp::defrag::OutOfOrderEventDataReconstructor< DCP >::event_fragment_count, famouso::mw::afp::defrag::Statistics< Tag >::event_incomplete(), famouso::mw::afp::defrag::Statistics< Tag >::fragments_currently_expected_sub(), and famouso::mw::afp::defrag::OutOfOrderEventDataReconstructor< DCP >::is_complete().
Member Function Documentation
bool famouso::mw::afp::defrag::OutOfOrderEventDataReconstructor< DCP >::error | ( | ) | [inline] |
Returns true if an error occured and event cannot be reconstructed for sure.
References famouso::mw::afp::defrag::OutOfOrderEventDataReconstructor< DCP >::no_ext_mtu.
Referenced by famouso::mw::afp::defrag::OutOfOrderEventDataReconstructor< DCP >::is_complete(), famouso::mw::afp::defrag::FECEventDataReconstructor< DCP >::is_complete(), and famouso::mw::afp::defrag::FECEventDataReconstructor< DCP >::put_fragment().
uint8_t* famouso::mw::afp::defrag::OutOfOrderEventDataReconstructor< DCP >::get_data | ( | ) | [inline] |
Returns the defragmented data block.
- Precondition:
- is_complete() returns true
Reimplemented in famouso::mw::afp::defrag::FECEventDataReconstructor< DCP >.
References famouso::mw::afp::defrag::OutOfOrderEventDataReconstructor< DCP >::event_data, FAMOUSO_ASSERT, and famouso::mw::afp::defrag::OutOfOrderEventDataReconstructor< DCP >::is_complete().
Referenced by famouso::mw::afp::defrag::FECEventDataReconstructor< DCP >::get_data().
elen_t famouso::mw::afp::defrag::OutOfOrderEventDataReconstructor< DCP >::get_length | ( | ) | [inline] |
Returns the length of the event's data.
- Precondition:
- is_complete() returns true
Reimplemented in famouso::mw::afp::defrag::FECEventDataReconstructor< DCP >.
References famouso::mw::afp::defrag::OutOfOrderEventDataReconstructor< DCP >::event_length, FAMOUSO_ASSERT, and famouso::mw::afp::defrag::OutOfOrderEventDataReconstructor< DCP >::is_complete().
bool famouso::mw::afp::defrag::OutOfOrderEventDataReconstructor< DCP >::is_complete | ( | ) | [inline] |
Returns whether the event already got reconstructed completely.
Reimplemented in famouso::mw::afp::defrag::FECEventDataReconstructor< DCP >.
References famouso::mw::afp::defrag::OutOfOrderEventDataReconstructor< DCP >::arrived_fragment_count, famouso::mw::afp::defrag::OutOfOrderEventDataReconstructor< DCP >::error(), famouso::mw::afp::defrag::OutOfOrderEventDataReconstructor< DCP >::event_fragment_count, and famouso::mw::afp::defrag::OutOfOrderEventDataReconstructor< DCP >::event_fragment_count_final.
Referenced by famouso::mw::afp::defrag::OutOfOrderEventDataReconstructor< DCP >::get_data(), famouso::mw::afp::defrag::OutOfOrderEventDataReconstructor< DCP >::get_length(), famouso::mw::afp::defrag::FECEventDataReconstructor< DCP >::is_complete(), famouso::mw::afp::defrag::OutOfOrderEventDataReconstructor< DCP >::put_fragment(), and famouso::mw::afp::defrag::OutOfOrderEventDataReconstructor< DCP >::~OutOfOrderEventDataReconstructor().
void famouso::mw::afp::defrag::OutOfOrderEventDataReconstructor< DCP >::put_fragment | ( | const Headers< DCP > & | header, | |
const uint8_t * | data, | |||
flen_t | length | |||
) | [inline] |
Process new fragment.
- Parameters:
-
header AFP header of the fragment data Payload data of the fragment length Payload data length of the fragment
Reimplemented in famouso::mw::afp::defrag::FECEventDataReconstructor< DCP >.
References famouso::mw::afp::defrag::OutOfOrderEventDataReconstructor< DCP >::arrived_fragment_count, famouso::mw::afp::defrag::OutOfOrderEventDataReconstructor< DCP >::behind_event_data, famouso::mw::afp::defrag::Statistics< Tag >::event_complete(), famouso::mw::afp::defrag::OutOfOrderEventDataReconstructor< DCP >::event_data, famouso::mw::afp::defrag::OutOfOrderEventDataReconstructor< DCP >::event_fragment_count, famouso::mw::afp::defrag::OutOfOrderEventDataReconstructor< DCP >::event_fragment_count_final, famouso::mw::afp::defrag::OutOfOrderEventDataReconstructor< DCP >::event_length, FAMOUSO_ASSERT, famouso::mw::afp::defrag::Headers< DCP >::fec, famouso::mw::afp::defrag::Headers< DCP >::first_fragment, FOR_FAMOUSO_ASSERT_ONLY, famouso::mw::afp::defrag::Statistics< Tag >::fragment_used(), famouso::mw::afp::defrag::Statistics< Tag >::fragments_currently_expected_add(), famouso::mw::afp::defrag::Statistics< Tag >::fragments_currently_expected_sub(), famouso::mw::afp::defrag::Statistics< Tag >::fragments_expected(), famouso::mw::afp::defrag::Headers< DCP >::fseq, famouso::mw::afp::defrag::detail::VarHeaderLength< DCP >::get_basic_header_len(), famouso::mw::afp::defrag::detail::VarHeaderLength< DCP >::get_payload(), famouso::mw::afp::defrag::OutOfOrderEventDataReconstructor< DCP >::is_complete(), famouso::mw::afp::defrag::OutOfOrderEventDataReconstructor< DCP >::no_ext_mtu, and famouso::mw::afp::defrag::OutOfOrderEventDataReconstructor< DCP >::realloc_event_data().
Referenced by famouso::mw::afp::defrag::FECEventDataReconstructor< DCP >::put_fragment().
void famouso::mw::afp::defrag::OutOfOrderEventDataReconstructor< DCP >::realloc_event_data | ( | fcount_t | new_fragment_count | ) | [inline, protected] |
Prepending realloc (add memory in front).
- Parameters:
-
new_fragment_count New number of fragments event_data must be able to store
References famouso::mw::afp::defrag::OutOfOrderEventDataReconstructor< DCP >::behind_event_data, famouso::mw::afp::defrag::OutOfOrderEventDataReconstructor< DCP >::event_data, famouso::mw::afp::defrag::OutOfOrderEventDataReconstructor< DCP >::event_fragment_count, famouso::mw::afp::defrag::detail::VarHeaderLength< DCP >::get_payload(), and famouso::mw::afp::defrag::OutOfOrderEventDataReconstructor< DCP >::no_ext_mtu.
Referenced by famouso::mw::afp::defrag::OutOfOrderEventDataReconstructor< DCP >::put_fragment().
Field Documentation
fcount_t famouso::mw::afp::defrag::OutOfOrderEventDataReconstructor< DCP >::arrived_fragment_count [protected] |
Count of data chunks collected.
Referenced by famouso::mw::afp::defrag::OutOfOrderEventDataReconstructor< DCP >::is_complete(), famouso::mw::afp::defrag::FECEventDataReconstructor< DCP >::is_complete(), famouso::mw::afp::defrag::OutOfOrderEventDataReconstructor< DCP >::put_fragment(), famouso::mw::afp::defrag::FECEventDataReconstructor< DCP >::put_fragment(), famouso::mw::afp::defrag::FECEventDataReconstructor< DCP >::~FECEventDataReconstructor(), and famouso::mw::afp::defrag::OutOfOrderEventDataReconstructor< DCP >::~OutOfOrderEventDataReconstructor().
uint8_t* famouso::mw::afp::defrag::OutOfOrderEventDataReconstructor< DCP >::behind_event_data [protected] |
Points behind restored data block.
Referenced by famouso::mw::afp::defrag::OutOfOrderEventDataReconstructor< DCP >::put_fragment(), and famouso::mw::afp::defrag::OutOfOrderEventDataReconstructor< DCP >::realloc_event_data().
uint8_t* famouso::mw::afp::defrag::OutOfOrderEventDataReconstructor< DCP >::event_data [protected] |
Points to restored data block.
Referenced by famouso::mw::afp::defrag::OutOfOrderEventDataReconstructor< DCP >::get_data(), famouso::mw::afp::defrag::FECEventDataReconstructor< DCP >::get_data(), famouso::mw::afp::defrag::OutOfOrderEventDataReconstructor< DCP >::put_fragment(), famouso::mw::afp::defrag::OutOfOrderEventDataReconstructor< DCP >::realloc_event_data(), famouso::mw::afp::defrag::FECEventDataReconstructor< DCP >::~FECEventDataReconstructor(), and famouso::mw::afp::defrag::OutOfOrderEventDataReconstructor< DCP >::~OutOfOrderEventDataReconstructor().
fcount_t famouso::mw::afp::defrag::OutOfOrderEventDataReconstructor< DCP >::event_fragment_count [protected] |
Count of fragments the event consists of.
Referenced by famouso::mw::afp::defrag::FECEventDataReconstructor< DCP >::get_data(), famouso::mw::afp::defrag::OutOfOrderEventDataReconstructor< DCP >::is_complete(), famouso::mw::afp::defrag::OutOfOrderEventDataReconstructor< DCP >::put_fragment(), famouso::mw::afp::defrag::FECEventDataReconstructor< DCP >::put_fragment(), famouso::mw::afp::defrag::OutOfOrderEventDataReconstructor< DCP >::realloc_event_data(), famouso::mw::afp::defrag::FECEventDataReconstructor< DCP >::~FECEventDataReconstructor(), and famouso::mw::afp::defrag::OutOfOrderEventDataReconstructor< DCP >::~OutOfOrderEventDataReconstructor().
bool famouso::mw::afp::defrag::OutOfOrderEventDataReconstructor< DCP >::event_fragment_count_final [protected] |
false, if first fragment did not arrive (yet)
Referenced by famouso::mw::afp::defrag::OutOfOrderEventDataReconstructor< DCP >::is_complete(), and famouso::mw::afp::defrag::OutOfOrderEventDataReconstructor< DCP >::put_fragment().
elen_t famouso::mw::afp::defrag::OutOfOrderEventDataReconstructor< DCP >::event_length [protected] |
Length of the currently restored data (sum of put fragment's length).
Referenced by famouso::mw::afp::defrag::FECEventDataReconstructor< DCP >::get_data(), famouso::mw::afp::defrag::OutOfOrderEventDataReconstructor< DCP >::get_length(), famouso::mw::afp::defrag::FECEventDataReconstructor< DCP >::get_length(), famouso::mw::afp::defrag::OutOfOrderEventDataReconstructor< DCP >::put_fragment(), and famouso::mw::afp::defrag::FECEventDataReconstructor< DCP >::put_fragment().
flen_t famouso::mw::afp::defrag::OutOfOrderEventDataReconstructor< DCP >::no_ext_mtu [protected] |
MTU minus extension header's length. Zero encodes error status of this object.
Referenced by famouso::mw::afp::defrag::OutOfOrderEventDataReconstructor< DCP >::error(), famouso::mw::afp::defrag::FECEventDataReconstructor< DCP >::get_data(), famouso::mw::afp::defrag::OutOfOrderEventDataReconstructor< DCP >::put_fragment(), famouso::mw::afp::defrag::FECEventDataReconstructor< DCP >::put_fragment(), and famouso::mw::afp::defrag::OutOfOrderEventDataReconstructor< DCP >::realloc_event_data().
The documentation for this class was generated from the following file:
- include/mw/afp/defrag/OutOfOrderEventDataReconstructor.h