<commit_before>#ifndef BEEEON_LOCATION_SERVICE_H
#define BEEEON_LOCATION_SERVICE_H

#include <Poco/Exception.h>
#include <Poco/Logger.h>
#include "dao/LocationDao.h"
#include "di/InjectorTarget.h"
#include "Debug.h"

namespace BeeeOn {

/**
 * Locations management.
 */
class LocationService : public AbstractInjectorTarget {
public:
	LocationService():
		m_dao(&NullLocationDao::instance())
	{
		injector<LocationService, LocationDao>("locationDao",
				&LocationService::setLocationDao);
	}

	void setLocationDao(LocationDao *dao)
	{
		if (dao == NULL)
			m_dao = &NullLocationDao::instance();
		else
			m_dao = dao;
	}

	bool fetch(Location &location)
	{
		TRACE_METHOD();
		return m_dao->fetch(location);
	}

private:
	LocationDao *m_dao;
};

}

#endif<commit_msg>LocationService: implement service layer<commit_after>#ifndef BEEEON_LOCATION_SERVICE_H
#define BEEEON_LOCATION_SERVICE_H

#include <Poco/Exception.h>
#include <Poco/Logger.h>
#include "dao/LocationDao.h"
#include "di/InjectorTarget.h"
#include "Debug.h"

namespace BeeeOn {

/**
 * Locations management.
 */
class LocationService : public AbstractInjectorTarget {
public:
	LocationService():
		m_dao(&NullLocationDao::instance())
	{
		injector<LocationService, LocationDao>("locationDao",
				&LocationService::setLocationDao);
	}

	void setLocationDao(LocationDao *dao)
	{
		if (dao == NULL)
			m_dao = &NullLocationDao::instance();
		else
			m_dao = dao;
	}

	void createIn(Location &location, const Place &place)
	{
		TRACE_METHOD();

		location.setPlace(place);
		m_dao->create(location);
	}

	bool fetch(Location &location)
	{
		TRACE_METHOD();
		return m_dao->fetch(location);
	}

	bool fetchFrom(Location &location, const Place &place)
	{
		TRACE_METHOD();
		return m_dao->fetchFrom(location, place);
	}

	bool update(Location &location)
	{
		TRACE_METHOD();
		return m_dao->update(location);
	}

	bool remove(const Location &location)
	{
		TRACE_METHOD();
		return m_dao->remove(location);
	}

private:
	LocationDao *m_dao;
};

}

#endif
{'fraction_non_alphanumeric': 0.1320754716981132, 'fraction_numerical': 0.0, 'mean_word_length': 5.219135802469136, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4211685', 'n_tokens_mistral': 744, 'n_tokens_neox': 747, 'n_words': 132}