//-------------------------------------------------------------------------------------------------
// <copyright file="LogListenerProgramSettings.h" company="LiquidRobotics">
//  Copyright (c) Liquid Robotics Corporation, confidential and proprietary.  All rights reserved. 
// </copyright>
//
// <summary>
// 	Declaration of LogListenerProgramSettings class, a serializable entity that
//  holds the various settings for the LogListenerProgram class
// </summary>
//
// <owner>Arash Ushani</owner>
//-------------------------------------------------------------------------------------------------

#ifndef __LogListenerProgramSettings_H__
#define __LogListenerProgramSettings_H__

#include "LqrSMACSharedLib.h"
#include "LqrSMACStdOutLoggerSettings.h"
#include "LqrSMACFileSetSettings.h"
#include "EventSettings.h"
#include "EventTransceiver.h"
#include "PayloadManagerClientSettings.h"
#include <string>
#include <boost/serialization/access.hpp>
#include <boost/serialization/nvp.hpp>
#include <boost/serialization/version.hpp>

namespace LiquidRobotics {
namespace LogListener {

class SHARED_LIB_PUBLIC LogListenerProgramSettings
{
public:

	typedef LiquidRobotics::EventLib::EventSettings EventSettings;
	typedef LiquidRobotics::EventLib::EventTransceiver::Settings EventTransceiverSettings;
	typedef LiquidRobotics::EventLib::PayloadManagerClientSettings PayloadManagerClientSettings;
	typedef LiquidRobotics::SMACFramework::StdOutLoggerSettings StdOutLoggerSettings;
	//typedef LiquidRobotics::SMACFramework::FileSetSettings FileSetSettings;
	typedef std::string string;


	LogListenerProgramSettings();
	LogListenerProgramSettings(const LogListenerProgramSettings& rhs);

	const string& GetServerName() const;
	void SetServerName(const string& newValue);

	const string& GetServerKind() const;
	void SetServerKind(const string& newValue);

	const StdOutLoggerSettings& GetLoggerSettings() const;
	void SetLoggerSettings(const StdOutLoggerSettings& newValue);

	//const FileSetSettings& GetFloatLogSettings() const;
	//void SetFloatLogSettings(const FileSetSettings& newValue);

	const EventSettings& GetShutdownEvent() const;
	void SetShutdownEvent(const EventSettings& newValue);

	const EventTransceiverSettings& GetEventTransceiverSettings() const;
	void SetEventTransceiverSettings(const EventTransceiverSettings& newValue);

	const PayloadManagerClientSettings& GetPayloadManagerClientSettings() const;
	void SetPayloadManagerClientSettings(const PayloadManagerClientSettings& newValue);

	void Load(const string& fileName);
	void Save(const string& fileName) const;

private:

	friend class boost::serialization::access;

	template<class Archive>
	void serialize(Archive & ar, const unsigned int version)
	{
		ar & BOOST_SERIALIZATION_NVP(serverName);
		ar & BOOST_SERIALIZATION_NVP(serverKind);
		ar & BOOST_SERIALIZATION_NVP(loggerSettings);
		//ar & BOOST_SERIALIZATION_NVP(floatLogSettings);
		ar & BOOST_SERIALIZATION_NVP(shutdownEvent);
		ar & BOOST_SERIALIZATION_NVP(eventTransceiverSettings);
		ar & BOOST_SERIALIZATION_NVP(payloadManagerClientSettings);
	}

	string serverName;
	string serverKind;
	StdOutLoggerSettings loggerSettings;
	//FileSetSettings floatLogSettings;
	EventSettings shutdownEvent;
	EventTransceiverSettings eventTransceiverSettings;
	PayloadManagerClientSettings payloadManagerClientSettings;
};

}
}

BOOST_CLASS_VERSION(LiquidRobotics::LogListener::LogListenerProgramSettings, 1)

#endif
