2016-06-15 23:48:41 +02:00
|
|
|
#ifndef FRAMEWORK_TMTCPACKET_PACKETMATCHER_PACKETMATCHTREE_H_
|
|
|
|
#define FRAMEWORK_TMTCPACKET_PACKETMATCHER_PACKETMATCHTREE_H_
|
|
|
|
|
2020-08-13 20:53:35 +02:00
|
|
|
#include "../../container/PlacementFactory.h"
|
|
|
|
#include "../../globalfunctions/matching/MatchTree.h"
|
|
|
|
#include "../../storagemanager/LocalPool.h"
|
2021-06-14 10:19:01 +02:00
|
|
|
#include "../../tmtcpacket/pus/tm/TmPacketMinimal.h"
|
2016-06-15 23:48:41 +02:00
|
|
|
|
|
|
|
class PacketMatchTree: public MatchTree<TmPacketMinimal*>, public HasReturnvaluesIF {
|
|
|
|
public:
|
|
|
|
PacketMatchTree(Node* root);
|
|
|
|
PacketMatchTree(iterator root);
|
|
|
|
PacketMatchTree();
|
|
|
|
virtual ~PacketMatchTree();
|
|
|
|
ReturnValue_t changeMatch(bool addToMatch, uint16_t apid, uint8_t type = 0,
|
|
|
|
uint8_t subtype = 0);
|
|
|
|
ReturnValue_t addMatch(uint16_t apid, uint8_t type = 0,
|
|
|
|
uint8_t subtype = 0);
|
|
|
|
ReturnValue_t removeMatch(uint16_t apid, uint8_t type = 0,
|
|
|
|
uint8_t subtype = 0);
|
|
|
|
ReturnValue_t initialize();
|
|
|
|
protected:
|
|
|
|
ReturnValue_t cleanUpElement(iterator position);
|
|
|
|
private:
|
|
|
|
static const uint8_t N_POOLS = 4;
|
2020-10-15 13:45:47 +02:00
|
|
|
LocalPool factoryBackend;
|
2016-06-15 23:48:41 +02:00
|
|
|
PlacementFactory factory;
|
2020-10-15 13:45:47 +02:00
|
|
|
static const LocalPool::LocalPoolConfig poolConfig;
|
2016-06-15 23:48:41 +02:00
|
|
|
static const uint16_t POOL_SIZES[N_POOLS];
|
|
|
|
static const uint16_t N_ELEMENTS[N_POOLS];
|
2018-07-12 16:29:32 +02:00
|
|
|
template<typename VALUE_T, typename INSERTION_T>
|
|
|
|
ReturnValue_t findOrInsertMatch(iterator startAt, VALUE_T test, iterator* lastTest);
|
|
|
|
iterator findMatch(iterator startAt, TmPacketMinimal* test);
|
2016-06-15 23:48:41 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* FRAMEWORK_TMTCPACKET_PACKETMATCHER_PACKETMATCHTREE_H_ */
|
|
|
|
|