// Filter.h #ifndef Filter_H #define Filter_H // Abstract interface for a filter which processes a list of MTrack's. // A matching list of boolean flags is returned. Flags are set false // to indicate that tracks should be dropped. #include "trfbase/Algorithm.h" #include "ptr/Ptr.h" #include "ptr/NullPolicy.h" #include #include using std::list; using std::vector; namespace trf { class MTrack; class CutRecord; class Filter : public Algorithm { private: // data // Flag to protect agains infinite loop. mutable bool _loop; public: // static methods // Return the type name. static TypeName get_type_name() { return "Filter"; } // Return the creator. static ObjCreator get_creator(); // Return the type. static Type get_static_type() { return get_creator(); } public: // typedefs // Track pointer. typedef Ptr MTrackPtr; // Track array. typedef vector MTrackArray; // Cut Record Array typedef vector CutRecordArray; // Array of boolean flags. typedef vector FlagArray; public: // methods // constructor Filter(); // destructor virtual ~Filter(); // Return the generic type. // This is only needed at this level. Type get_generic_type() const { return get_static_type(); } // Process a list of tracks. virtual FlagArray process(MTrackArray& trhs) const; // Process a list of tracks with cut records. virtual FlagArray process_with_records(MTrackArray& trhs, CutRecordArray* precs) const; }; } // end namespace trf #endif