replace typedef function ptr by std::function
start PIMap refactoring
This commit is contained in:
@@ -29,10 +29,17 @@
|
||||
#include "piiodevice.h"
|
||||
|
||||
/// TODO: написать документацию, тут ничего не понятно
|
||||
// Pass data, recHeaderPtr, received_data, recHeaderSize. Return true if packet is correct nor return false.
|
||||
typedef int (*PacketExtractorHeaderFunc)(const uchar *, const uchar *, int);
|
||||
typedef bool (*PacketExtractorPayloadFunc)(const uchar *, int);
|
||||
typedef bool (*PacketExtractorFooterFunc)(const uchar *, const uchar *, int);
|
||||
/// Pass SourceHeaderPtr, ReceivedHeaderPtr, HeaderSize.
|
||||
/// Return size of payload if packet is correct, or -1 if incorrect.
|
||||
typedef std::function<int(const uchar *, const uchar *, int)> PacketExtractorHeaderFunc;
|
||||
|
||||
/// Pass ReceivedDataPtr, DataSize.
|
||||
/// Return true if packet is correct, false otherwise.
|
||||
typedef std::function<bool(const uchar *, int)> PacketExtractorPayloadFunc;
|
||||
|
||||
/// Pass SourceFooterPtr, ReceivedFooterPtr, FooterSize.
|
||||
/// Return true if packet is correct, false otherwise.
|
||||
typedef std::function<bool(const uchar *, const uchar *, int)> PacketExtractorFooterFunc;
|
||||
|
||||
class PIP_EXPORT PIPacketExtractor: public PIIODevice
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user