#ifndef pattdata_hh #define pattdata_hh #include #include #include #include namespace Patt { // Maximum frames in interval between 1Hz markers (fixed/AC) // 1Hz fixed markers are exactly 910000 // which is like 60*0.91/(1300/1400) or 58.8 Hz static const unsigned MAX_FRAMES = 910000; static const unsigned MAX_DEST = 16; static const unsigned MAX_CTRL = 18; static const uint8_t NO_DEST = 0xff; // maps of bucket to ... // typedef std::map DestPatternType; // destination // typedef std::map SeqPatternType; // sequence bitmask // vector access should be faster for worst case // vector size is MAX_FRAMES typedef std::vector DestPatternType; typedef std::vector SeqPatternType; typedef std::vector BeamClassType; class PatternStat { public: PatternStat() : first(0), last(0), min(0), max(0), sum(0) {} public: int first; int last; int min; int max; unsigned sum; }; class DestPatternSet { public: DestPatternSet(std::string); public: const DestPatternType& pattern(const BeamClassType&); private: unsigned _ndest; std::map _patterns; }; class DestPatternStatSet { public: DestPatternStatSet(std::string); public: const PatternStat& stat(const BeamClassType, unsigned dest); private: unsigned _ndest; std::map< BeamClassType, std::vector > _stats; }; class SeqPatternSet { public: SeqPatternSet(std::string); public: unsigned nengines() const { return _neng; } const SeqPatternType& seq(unsigned eng); private: unsigned _neng; std::map _seqs; }; class SeqPatternStatSet { public: SeqPatternStatSet(std::string); public: unsigned nengines() const { return _neng; } const PatternStat& stat(unsigned eng, unsigned bit); private: unsigned _neng; std::map > _stats; }; }; #endif