/**
 * @file
 * $Id$
 * $Revision$
 * $Author$
 * $Date$
 *
 * This file is part of The iWear Framework.
 *
 * The iWear Framework is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by the
 * Free Software Foundation as in version 2 of the License.

 * 
 * The iWear Framework is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 * more details.
 * 
 * You should have received a copy of the GNU General Public License along with
 * The iWear Framework; if not, write to the Free Software Foundation, Inc., 59
 * Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

#ifndef __IWSENS_SENSOR_ENUM_H
#define __IWSENS_SENSOR_ENUM_H

#include <ostream>
extern "C" {
#include <stdint.h>
}

namespace iwear
{
namespace sensor
{
    enum sensor_type
    {
	location_sensor,///< This means a sensor that gives back location
	data_sensor,	///< This sensor will give back a data point
	power_sensor,	///< This sensor has power resource information available
	num_sensor_type
    }; 

    enum datasensor_type
    {
	temperature,	///< Obviously, some temperature
	loudness,
	brightness,
	time_data,
	sysload_data,
	user_supplied,
	acceleration,
	proc_data,	///< Some other data from the proc
	num_datasensor_type
    };

inline const char * to_string( sensor_type st )/*{{{*/
{
    switch(st)
    {
	case location_sensor:
	    return "sensor_type::location";
	case data_sensor:
	    return "sensor_type::data_sensor";
	case power_sensor:
	    return "sensor_type::power_sensor";
	case num_sensor_type:
	    return "sensor_type::sensor_num";
	default:
	    return "sensor_type::<invalid value>";
    }
}/*}}}*/

inline std::ostream& operator<<(std::ostream& o, sensor_type st)/*{{{*/
{
    o << to_string(st);
    o << "(";
    o << (uint32_t)st << ")";
    return o;
}/*}}}*/

inline const char * to_string( datasensor_type st)/*{{{*/
{
    switch(st)
    {
	case temperature:
	    return "datasensor_type::temperature";
	case loudness:
	    return "datasensor_type::loudness";
	case brightness:
	    return "datasensor_type::brightness";
	case time_data:
	    return "datasensor_type::time_data";
	case sysload_data:
	    return "datasensor_type::sysload_data";
	case user_supplied:
	    return "datasensor_type::user_supplied";
	case acceleration:
	    return "datasensor_type::acceleration";
	case proc_data:
	    return "datasensor_type::proc_data";
	case num_datasensor_type:
	    return "datasensor_type::datasensor_num";
	default:
	    return "datasensor_type::<invalid value>";
    }
}/*}}}*/

inline std::ostream& operator<<(std::ostream& o, datasensor_type st)/*{{{*/
{
    o << to_string(st);
    o << "(";
    o << (uint32_t)st << ")";
    return o;
}/*}}}*/

}
}
#endif
