I have a class which gives value for a corresponding time. I have a method that changes the m_time
(in hh,mm,ss)[ms] but is declared as const
at the end. So I need to change the attribute m_time
but I can't ! how could I possibly go around this?
Here is my code:
class CMeasurementValue
{
private:
double m_value;
unsigned int m_time;
public:
CMeasurementValue(double value=0,unsigned int time=0);
CMeasurementValue(double value,unsigned int hh,unsigned int mm , double ss);
double getValue() const ;
unsigned int getTime() const;
void calculateTime(unsigned int& hh , unsigned int& mm , double& ss ) const;
bool operator <(const CMeasurementValue& rop)const ;
friend ostream& operator <<( ostream& out, const CMeasurementValue& rop);
void print();
};
void CMeasurementValue::calculateTime(unsigned int& hh , unsigned int& mm , double& ss) const
{
// ??
}