#include "coreManager.h"

using namespace std;
using namespace core;
//--------------------------------------------------------------
/* Default constructor */
CoreManager::CoreManager()
{
  init();
}
//--------------------------------------------------------------
/* Default destructor */
CoreManager::~CoreManager()
{
  release();
}
//--------------------------------------------------------------
/* Get a reference to the application bus */
dBus::Bus &CoreManager::getBus() const
{
  return *m_bus;
}
//--------------------------------------------------------------
/* Initialize the core manager (e.g., set up the bus, etc.) */
void CoreManager::init()
{
  // Initialize the application bus
  m_bus = make_unique<dBus::Bus>();

  // Initialize other subsystems (e.g., logger, etc.)
  m_logger         = make_unique<logger::Logger>(*m_bus);
  m_projectManager = make_unique<project::ProjectManager>(*m_bus);
}
//--------------------------------------------------------------
/* Release resources used by the core manager (e.g., clean up the bus, etc.) */
void CoreManager::release()
{
  // Clean up other subsystems (e.g., logger, etc.)
  m_projectManager.reset();
  m_logger.reset();

  // Clean up the application bus
  m_bus.reset();
}
//--------------------------------------------------------------
