/*
 * ConfigReader.h
 *
 *  Created on: Jan 9, 2012
 *      Author: godin
 */

#ifndef CONFIGREADER_H_
#define CONFIGREADER_H_

#include "DataReader.h"

class ConfigReader: public DataReader
{
public:
    ConfigReader( Component* owner, DataElement& element,
                  const Unit& defaultUnit );

    virtual ~ConfigReader();


    virtual bool read( const Unit& unit, unsigned char& readTo );
    virtual bool read( const Unit& unit, double& readTo );
    virtual bool read( const Unit& unit, float& readTo );
    virtual bool read( const Unit& unit, int& readTo );
    virtual bool read( bool& readTo );
    virtual bool read( Timespan& readTo );
    virtual bool read( DataValue& readTo );
    virtual bool read( Str& readTo );

    /** Set whether value has been set in a configuration file */
    void setConfigured( bool configured );

    /** Indicate whether value has been set in a configuration file */
    bool configured();

protected:

    /** Indicates whether the data value has already been configured */
    bool configured_;

};

#endif /* CONFIGREADER_H_ */
