<commit_before>#include <string>
#include "stdafx.h"
#include "Types.h"
#include "DomainObject.h"

using namespace std;
using namespace Framework::Domain;

class BaseQueryObject;

class FRAMEWORK_API DomainObject::Implementation
{
public:
	enum InstantiationType { New = 1, Loaded = 2 };
	typedef const BaseQueryObject ConstQueryObject;
private:
	unique_ptr<Guid> m_systemId;			//Data non-modifiable
	ConstMapper *m_mapper;					//Data non-modifiable, pointer non-repointable
	ConstQueryObject *m_queryObject;		//Data non-modifiable, pointer non-repointable
public:
	Implementation(ConstMapper *mapper) :
		m_systemId(GenerateGuid()),
		m_mapper(mapper),
		m_queryObject(nullptr)
	{
	}
	~Implementation() {}

	const string GetGuid(const DomainObject&)
	{
		string guid;

		if (!m_systemId) return guid;

		RPC_CSTR szUuid = NULL;

		if (::UuidToStringA(m_systemId.get(), &szUuid) == RPC_S_OK)
		{
			guid = (char*)szUuid;
			::RpcStringFreeA(&szUuid);
		}

		return guid;
	}
};

DomainObject::DomainObject(ConstMapper *mapper) :
	pImpl{ make_unique<Implementation>(mapper) } { }

DomainObject::DomainObject(DomainObject&& rvalue) :
	pImpl(move(rvalue.pImpl))
{
}

DomainObject& DomainObject::operator=(DomainObject&& rvalue)
{
	pImpl = move(rvalue.pImpl);

	return *this;
}

//'default' explicityly informs compiler to generate body/func automatically
DomainObject::~DomainObject() = default;

const string DomainObject::GetGuid()<commit_msg>--amend<commit_after>#include <string>
#include "stdafx.h"
#include "Types.h"
#include "DomainObject.h"

using namespace std;
using namespace Framework::Domain;

class BaseQueryObject;

class FRAMEWORK_API DomainObject::Implementation
{
public:
	enum InstantiationType { New = 1, Loaded = 2 };
	typedef const BaseQueryObject ConstQueryObject;
private:
	unique_ptr<Guid> m_systemId;			//Data non-modifiable
	ConstMapper *m_mapper;					//Data non-modifiable, pointer non-repointable
	ConstQueryObject *m_queryObject;		//Data non-modifiable, pointer non-repointable
public:
	Implementation(ConstMapper *mapper) :
		m_systemId(GenerateGuid()),
		m_mapper(mapper),
		m_queryObject(nullptr)
	{
	}
	~Implementation() {}

	const string GetGuid(const DomainObject&)
	{
		string guid;

		if (!m_systemId) return string("");

		RPC_CSTR szUuid = NULL;

		if (::UuidToStringA(m_systemId.get(), &szUuid) == RPC_S_OK)
		{
			guid = (char*)szUuid;
			::RpcStringFreeA(&szUuid);
		}

		return string(guid);
	}
};

DomainObject::DomainObject(ConstMapper *mapper) :
	pImpl{ make_unique<Implementation>(mapper) } { }

DomainObject::DomainObject(DomainObject&& rvalue) :
	pImpl(move(rvalue.pImpl))
{
}

DomainObject& DomainObject::operator=(DomainObject&& rvalue)
{
	pImpl = move(rvalue.pImpl);

	return *this;
}

//'default' explicityly informs compiler to generate body/func automatically
DomainObject::~DomainObject() = default;

const string DomainObject::GetGuid()
{'fraction_non_alphanumeric': 0.12664359861591695, 'fraction_numerical': 0.001384083044982699, 'mean_word_length': 5.738927738927739, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '242671', 'n_tokens_mistral': 1061, 'n_tokens_neox': 993, 'n_words': 205}