/**
 * @file
 * $Id$
 * $Revision$
 * $Author$
 * $Date$
 *
 * This file is a part of The iWear Framework.
 * In particular is this file a part of the RouteTracker application
 *
 * 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 __ROUTE_H
#define __ROUTE_H

#include <set>
#include <string>
#include <iwsens/sensor_enum.h>
using namespace std;

namespace iwear{
namespace routetracker{

enum CameraType{
    CAMERA_USB,
    CAMERA_EXTERNAL,
    num_CameraType
};

inline const char * to_string( CameraType ct )
{
    switch(ct)
    {
        case CAMERA_USB:
            return "CameraType::CAMERA_USB";
            break;
        case CAMERA_EXTERNAL:
            return "CameraType::CAMERA_EXTERNAL";
            break;
        case num_CameraType:
            return "CameraType::num_CameraType";
            break;
        default:
            return "CameraType::<invalid value>";
            break;
    }
}

inline std::ostream& operator<<(std::ostream& o, CameraType ct)
{
    o << to_string(ct);
    o << "(";
    o << (uint32_t)ct << ")";
    return o;
}

inline CameraType map_to_CameraType(const string& str){
    if(str == "CameraType::CAMERA_USB"){
	return CAMERA_USB;
    } else if(str == "CameraType::CAMERA_EXTERNAL"){
	return CAMERA_EXTERNAL;
    } else{
	return num_CameraType;
    }
}

class Route {

private:
    set<iwear::sensor::datasensor_type> data_sensors;
    string name;
    string description;
    float timediff;
    set<string> participants;
    set<string> keywords;
    CameraType camera_type;
public:
    Route( void ); 
    virtual ~Route( void );

    inline const set<iwear::sensor::datasensor_type>& get_data_sensors( void ) const{
	return data_sensors;
    }
    
    bool add_data_sensor( iwear::sensor::datasensor_type dst );

    inline const string& get_name( void ) const{
	return name;
    }

    inline void set_name( const string& name ){
	this->name = name;
    } 

    inline const string& get_description( void ) const{
	return description;
    }

    inline void set_description( const string& description ){
	this->description = description;
    } 

    inline float get_timediff( void ) const{
	return timediff;
    }

    inline void set_timediff( const float& timediff ){
	this->timediff = timediff;
    } 

    inline const set<string>& get_participants( void ) const{
	return participants;
    }

    bool add_participant( const string& participant );

    inline const set<string>& get_keywords( void ) const{
	return keywords;
    }

    bool add_keyword( const string& keyword );

    inline CameraType get_camera_type( void ) const{
	return camera_type;
    }

    inline void set_cameratype( CameraType camera_type){
	this->camera_type = camera_type;
    }
}; // class Route
} // namespace routetracker
} // namespace iwear

#endif // __ROUTE_H

