// CandidateLayer.h #ifndef CandidateLayer_H #define CandidateLayer_H // A candidate layer consists of references to a layer, a // propagator and a fitter. It does not handle memory management // for the corresponding objects. #include namespace trf { class Layer; class Propagator; class AddFitter; class CandidateLayer; // output stream std::ostream& operator<<(std::ostream& stream, const CandidateLayer& cnl); class CandidateLayer { private: // attributes // the layer const Layer* _player; // the propagator const Propagator* _pprop; // the fitter const AddFitter* _pfit; private: // methods // output stream void ostr(std::ostream& stream) const; public: // methods // default constructor CandidateLayer(); // constructor CandidateLayer(const Layer& layer, const Propagator& prop, const AddFitter& fit); // destructor ~CandidateLayer(); // return if the data are valid // The get routines should not be called if this returns false. bool is_valid() const; // fetch the layer const Layer& get_layer() const { return *_player; }; // fetch the propagator const Propagator& get_propagator() const { return *_pprop; }; // fetch the fitter const AddFitter& get_fitter() const { return *_pfit; }; // output stream friend std::ostream& operator<<(std::ostream& stream, const CandidateLayer& cnl); }; } // end namespace trf // equality -- compare addresses bool operator==(const trf::CandidateLayer& cnl1, const trf::CandidateLayer& cnl2); // inequality inline bool operator!=(const trf::CandidateLayer& cnl1, const trf::CandidateLayer& cnl2) { return ! ( cnl1 == cnl2 ); } // ordering for STL bool operator<(const trf::CandidateLayer& cnl1, const trf::CandidateLayer& cnl2); #endif