//-------------------------------------------------------------------------------------------------
// <copyright file="PayloadManagerSettings.h" company="LiquidRobotics">
//  Copyright (c) Liquid Robotics Corporation, confidential and proprietary.  All rights reserved. 
// </copyright>
//
// <summary>
// 	Declarations for PayloadManagerSettings, a serializable entity that contains
//  customization variables for PayloadManager
// </summary>
//
// <owner>Mike Cookson</owner>
//-------------------------------------------------------------------------------------------------

#ifndef __PAYLOADMANAGERSETTINGS_H__
#define __PAYLOADMANAGERSETTINGS_H__

#include "LqrSMACByteArray.h"
#include "EventTransceiver.h"
#include <boost/serialization/access.hpp>
#include <boost/serialization/nvp.hpp>
#include <string>
#include "LqrSMACStdOutLoggerSettings.h"

class PayloadManagerSettings
{
public:

	typedef LiquidRobotics::EventLib::EventTransceiver::Settings EventTransceiverSettings;
	typedef LiquidRobotics::SMACFramework::ByteArray::byte byte;
	typedef LiquidRobotics::SMACFramework::StdOutLoggerSettings StdOutLoggerSettings;
	typedef std::string string;

	PayloadManagerSettings();
	PayloadManagerSettings(const PayloadManagerSettings& other);

	PayloadManagerSettings& operator=(const PayloadManagerSettings& other);
	bool operator==(const PayloadManagerSettings& other) const;

	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);

	byte GetDefaultBoardID() const;
	void SetDefaultBoardID(byte newValue);

	const string& GetDeviceAddedEventName() const;
	void SetDeviceAddedEventName(const string& newValue);

	const string& GetDeviceChangedEventName() const;
	void SetDeviceChangedEventName(const string& newValue);

	const string& GetDeviceRemovedEventName() const;
	void SetDeviceRemovedEventName(const string& newValue);

	const string& GetCommonEventType() const;
	void SetCommonEventType(const string& newValue);

	const string& GetCommonEventDomain() const;
	void SetCommonEventDomain(const string& newValue);

	const EventTransceiverSettings& GetEventTransceiverSettings() const;
	void SetEventTransceiverSettings(const EventTransceiverSettings& 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(defaultBoardID);
		ar & BOOST_SERIALIZATION_NVP(deviceAddedEventName);
		ar & BOOST_SERIALIZATION_NVP(deviceChangedEventName);
		ar & BOOST_SERIALIZATION_NVP(deviceRemovedEventName);
		ar & BOOST_SERIALIZATION_NVP(commonEventType);
		ar & BOOST_SERIALIZATION_NVP(commonEventDomain);
		ar & BOOST_SERIALIZATION_NVP(eventTransceiverSettings);
	}

	string serverName;
	string serverKind;
	byte defaultBoardID;
	string deviceAddedEventName;
	string deviceChangedEventName;
	string deviceRemovedEventName;
	string commonEventType;
	string commonEventDomain;
	EventTransceiverSettings eventTransceiverSettings;
	StdOutLoggerSettings loggerSettings;
};

#endif
