/******************************************************************************
** Copyright (c) 2008 MAK Technologies, Inc.
** All rights reserved.
******************************************************************************/

//! \file DtDriverRecord.h
//! \brief Contains makArchives::DtDriverRecord class.
//! \ingroup makArchives

#ifndef DtDriverRecord_H_
#define DtDriverRecord_H_

#include <makArchives/makArchives.h>

namespace makArchives
{
   //! \brief A record for saving out a driver instance.
   //! \ingroup makArchives
   class DT_DLL_MAKARCHIVES DtDriverRecord
   {
   public:

      //! \brief CTOR
      DtDriverRecord();

      //! \brief Copy CTOR
      DtDriverRecord(const DtDriverRecord& orig);

      //! \brief Assignment OP
      DtDriverRecord& operator=(const DtDriverRecord& orig);

      //! \brief DTOR
      ~DtDriverRecord();

      //! Get the class type of the driver.
      const std::string& classType() const;

      //! Set the class type of the driver.
      void setClassType(const std::string& type);

      //@{
      //! Get the settings map of the driver.
      std::map<std::string,std::string>& settings();
      const std::map<std::string,std::string>& settings() const;
      //@}

   protected:
      //! Serialization/Deserialization //

      friend class boost::serialization::access;

      //! When the class Archive corresponds to an output archive, the
      //! & operator is defined similar to <<.  Likewise, when the class Archive
      //! is a type of input archive the & operator is defined similar to >>.
      template<class Archive>
      void serialize(Archive & ar, const unsigned int version)
      {
         ar & BOOST_SERIALIZATION_NVP(myType);
         ar & BOOST_SERIALIZATION_NVP(mySettings);
      }


   protected:

      std::string myType;
      std::map<std::string,std::string> mySettings;
   };
}

#endif

