#ifndef HIT_H #define HIT_H #include "Digit.h" #include "DataSvc/Ref.h" namespace pool_tutorial { class Transformation; // A hit class with a reference to its associated digit class Hit { public: // Default constructor Hit(); // Copy constructor Hit( const Hit& rhs ); // Destructor virtual ~Hit(); // Assignment operator Hit& operator=( const Hit& rhs ); // access methods double x() const; double y() const; double z() const; double value() const; // access method of the associated digit Digit& digit(); const Digit& digit() const; // Establishes an association with a digit void setDigit( const pool::Ref< Digit >& digit ); // Sets the associated transformation object void setTransformation( Transformation* transformation ); private: // The three coordinates. double m_x; double m_y; double m_z; // The value of the hit double m_value; // Flag indicating whether the values are updated bool m_upToDate; // Pointer to the transformation object Transformation* m_transformation; // The association to the digit pool::Ref< Digit > m_digit; // Performs the data update void updateValues(); }; } #endif