/* Blinker
   Copyright 2011-2019 Stefan Schuermans <stefan@blinkenarea.org>
   Copyleft GNU public license - http://www.gnu.org/copyleft/gpl.html
   a blinkenarea.org project */

#ifndef BLINKER_MODULEMGRCNTR_H
#define BLINKER_MODULEMGRCNTR_H

#include <string>

#include "Directory.h"
#include "File.h"
#include "Module.h"
#include "ModuleMgr.h"
#include "Sender.h"
#include "SettingFile.h"

namespace Blinker {

/// container for a module (used by module manager)
template<typename MODULE>
class ModuleMgr<MODULE>::Cntr
{
public:
  /**
   * @brief constructor
   * @param[in] mgr owning module manager
   * @param[in] name name of module
   * @param[in] dirBase base directory
   */
  Cntr(ModuleMgr &mgr, const std::string &name, const Directory &dirBase);

  /// destructor
  ~Cntr();

private:
  /// copy constructor disabled
  Cntr(const Cntr &that);

  /// assignment operator disabled
  const Cntr & operator=(const Cntr &that);

public:
  /// check for update of configuration
  void updateConfig();

protected:
  ModuleMgr   &m_mgr; ///< owning module manager
  std::string m_name; ///< name of module
  MODULE      m_mod;  ///< module
}; // class Cntr<MODULE>

} // namespace Blinker

#endif // #ifndef BLINKER_MODULEMGRCNTR_H

