famouso::mw::afp::Fragmenter< AFPFC, mtu_compile_time > Class Template Reference
Splits a block of data into several pieces (fragments). More...
#include <Fragmenter.h>
Public Types | |
typedef FCP::SizeProp::elen_t | elen_t |
typedef FCP::SizeProp::flen_t | flen_t |
typedef FCP::SizeProp::fcount_t | fcount_t |
Public Member Functions | |
Fragmenter (const uint8_t *event_data, elen_t event_length) | |
Construct a new fragmenter for an event (if mtu_compile_time template parameter is set). | |
Fragmenter (const uint8_t *event_data, elen_t event_length, flen_t mtu) | |
Construct a new fragmenter for an event. | |
bool | error () |
Returns whether an error occured. | |
flen_t | get_fragment (uint8_t *fragment_data) |
Write next fragment to fragment_data buffer. | |
Protected Attributes | |
FragmenterImpl | frag |
Implementation policy (differs for FEC/non-FEC). |
Detailed Description
template<class AFPFC, unsigned int mtu_compile_time = 0>
class famouso::mw::afp::Fragmenter< AFPFC, mtu_compile_time >
Splits a block of data into several pieces (fragments).
All fragments will be of equal size, last non-redundancy fragment may be smaller. Can be used for Abstract Network Layer and Application Layer (or wherever you want ^^)
- Template Parameters:
-
AFPFC AFP Fragmenter Config mtu_compile_time Maximum length of constructed fragments (header + payload). Setting this value enables compile time checking if the MTU is to small for headers.
Member Typedef Documentation
typedef FCP::SizeProp::elen_t famouso::mw::afp::Fragmenter< AFPFC, mtu_compile_time >::elen_t |
typedef FCP::SizeProp::fcount_t famouso::mw::afp::Fragmenter< AFPFC, mtu_compile_time >::fcount_t |
typedef FCP::SizeProp::flen_t famouso::mw::afp::Fragmenter< AFPFC, mtu_compile_time >::flen_t |
Constructor & Destructor Documentation
famouso::mw::afp::Fragmenter< AFPFC, mtu_compile_time >::Fragmenter | ( | const uint8_t * | event_data, | |
elen_t | event_length | |||
) | [inline] |
Construct a new fragmenter for an event (if mtu_compile_time template parameter is set).
- Parameters:
-
[in] event_data Buffer containing the data to be fragmented [in] event_length Length of event_data buffer
References FAMOUSO_STATIC_ASSERT_ERROR, and famouso::mw::afp::Fragmenter< AFPFC, mtu_compile_time >::frag.
famouso::mw::afp::Fragmenter< AFPFC, mtu_compile_time >::Fragmenter | ( | const uint8_t * | event_data, | |
elen_t | event_length, | |||
flen_t | mtu | |||
) | [inline] |
Construct a new fragmenter for an event.
- Parameters:
-
[in] event_data Buffer containing the data to be fragmented [in] event_length Length of event_data buffer [in] mtu Maximum length of constructed fragments (header + payload)
References famouso::mw::afp::Fragmenter< AFPFC, mtu_compile_time >::frag.
Member Function Documentation
bool famouso::mw::afp::Fragmenter< AFPFC, mtu_compile_time >::error | ( | ) | [inline] |
Returns whether an error occured.
Check this after construction.
References famouso::mw::afp::Fragmenter< AFPFC, mtu_compile_time >::frag.
Referenced by famouso::mw::afp::AFPPublisherEventChannel< PEC, AFPFC, 0, EventType >::publish(), and famouso::mw::afp::AFPPublisherEventChannel< PEC, AFPFC, mtu, EventType >::publish().
flen_t famouso::mw::afp::Fragmenter< AFPFC, mtu_compile_time >::get_fragment | ( | uint8_t * | fragment_data | ) | [inline] |
Write next fragment to fragment_data buffer.
- Parameters:
-
[in] fragment_data Output buffer for fragment (at least mtu Bytes)
- Returns:
- Length of data put into fragment buffer
References famouso::mw::afp::Fragmenter< AFPFC, mtu_compile_time >::frag.
Referenced by famouso::mw::afp::AFPPublisherEventChannel< PEC, AFPFC, 0, EventType >::publish(), and famouso::mw::afp::AFPPublisherEventChannel< PEC, AFPFC, mtu, EventType >::publish().
Field Documentation
FragmenterImpl famouso::mw::afp::Fragmenter< AFPFC, mtu_compile_time >::frag [protected] |
Implementation policy (differs for FEC/non-FEC).
Referenced by famouso::mw::afp::Fragmenter< AFPFC, mtu_compile_time >::error(), famouso::mw::afp::Fragmenter< AFPFC, mtu_compile_time >::Fragmenter(), and famouso::mw::afp::Fragmenter< AFPFC, mtu_compile_time >::get_fragment().
The documentation for this class was generated from the following file:
- include/mw/afp/Fragmenter.h