<commit_before>#include "stdafx.h"

#include "../../You-DataStore/datastore.h"
#include "../../You-DataStore/task_typedefs.h"
#include "controller/task_graph_controller.h"

#include "state.h"

namespace You {
namespace QueryEngine {
namespace Internal {

namespace {
	using DataStore = You::DataStore::DataStore;
	using Transaction = You::DataStore::Transaction;
	using KeyValuePairs = You::DataStore::KeyValuePairs;
}

const std::wstring State::MAX_ID_FIELD = L"max-id";

std::int64_t State::getMaxIDFromDataStore() {
	auto resources = DataStore::get().getAllResources();
	bool resourceFound = false;
	for (const auto& resource : resources) {
		auto it = resource.find(MAX_ID_FIELD);
		if (it != resource.end()) {
			resourceFound = true;
			auto newMaxID = boost::lexical_cast<Task::ID>(it->second);
			return newMaxID;
		}
	}
	return -1;
}

State::State()
: innerGraph(TaskGraph(TaskGraph::GraphType::DEPENDENCY)),
  innerSubtaskGraph(TaskGraph(TaskGraph::GraphType::SUBTASK)) {
	maxID = TaskGraphController::loadFromFile(innerGraph);<commit_msg>Remove one more anon namespace<commit_after>#include "stdafx.h"

#include "../../You-DataStore/datastore.h"
#include "../../You-DataStore/task_typedefs.h"
#include "controller/task_graph_controller.h"

#include "state.h"

namespace You {
namespace QueryEngine {
namespace Internal {

using You::DataStore::DataStore;
using You::DataStore::Transaction;
using You::DataStore::KeyValuePairs;

const std::wstring State::MAX_ID_FIELD = L"max-id";

std::int64_t State::getMaxIDFromDataStore() {
	auto resources = DataStore::get().getAllResources();
	bool resourceFound = false;
	for (const auto& resource : resources) {
		auto it = resource.find(MAX_ID_FIELD);
		if (it != resource.end()) {
			resourceFound = true;
			auto newMaxID = boost::lexical_cast<Task::ID>(it->second);
			return newMaxID;
		}
	}
	return -1;
}

State::State()
: innerGraph(TaskGraph(TaskGraph::GraphType::DEPENDENCY)),
  innerSubtaskGraph(TaskGraph(TaskGraph::GraphType::SUBTASK)) {
	maxID = TaskGraphController::loadFromFile(innerGraph);
{'fraction_non_alphanumeric': 0.1502918287937743, 'fraction_numerical': 0.0029182879377431907, 'mean_word_length': 6.117647058823529, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '5430110', 'n_tokens_mistral': 706, 'n_tokens_neox': 685, 'n_words': 125}