#ifndef FRAMEWORK_TMTCPACKET_PACKETMATCHER_SUBSERVICEMATCHER_H_ #define FRAMEWORK_TMTCPACKET_PACKETMATCHER_SUBSERVICEMATCHER_H_ #include #include #include class SubServiceMatcher: public SerializeableMatcherIF { public: SubServiceMatcher(uint8_t subService) : subService(subService) { } SubServiceMatcher(TmPacketMinimal* test) : subService(test->getSubService()) { } bool match(TmPacketMinimal* packet) { if (packet->getSubService() == subService) { return true; } else { return false; } } ReturnValue_t serialize(uint8_t** buffer, size_t* size, const size_t max_size, bool bigEndian) const { return SerializeAdapter::serialize(&subService, buffer, size, max_size, bigEndian); } size_t getSerializedSize() const { return SerializeAdapter::getSerializedSize(&subService); } ReturnValue_t deSerialize(const uint8_t** buffer, int32_t* size, bool bigEndian) { return SerializeAdapter::deSerialize(&subService, buffer, size, bigEndian); } private: uint8_t subService; }; #endif /* FRAMEWORK_TMTCPACKET_PACKETMATCHER_SUBSERVICEMATCHER_H_ */