<commit_before>/**
*  Copyright (C) 2015 3D Repo Ltd
*
*  This program is free software: you can redistribute it and/or modify
*  it under the terms of the GNU Affero General Public License as
*  published by the Free Software Foundation, either version 3 of the
*  License, or (at your option) any later version.
*
*  This program is distributed in the hope that it will be useful,
*  but WITHOUT ANY WARRANTY; without even the implied warranty of
*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*  GNU Affero General Public License for more details.
*
*  You should have received a copy of the GNU Affero General Public License
*  along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

/**
* repo_bson.h
*
*  Created on: 29 Jun 2015
*      Author: Carmen
*
*  Base Bson object. Generic bson that is inherited by others.
*/

#pragma once

#if defined(_WIN32) || defined(_WIN64)
#include <WinSock2.h>
#include <Windows.h>

#define strcasecmp _stricmp
#endif

#include <mongo/bson/bson.h>
#include <unordered_map>

#include "../../../lib/repo_log.h"
#include "../../../repo_bouncer_global.h"
#include "../repo_model_global.h"
#include "../../../lib/datastructure/repo_uuid.h"
#include "repo_bson_element.h"

#define REPO_BSON_MAX_BYTE_SIZE 16770000 //max size is 16MB,but leave a bit for buffer

namespace repo {
	namespace core {
		namespace handler {
			class MongoDatabaseHandler;
		}

		namespace model {
			//TODO: Eventually we should inherit from a generic BSON object.
			//work seems to have been started in here:https://github.com/jbenet/bson-cpp
			//alternatively we can use a c++ wrapper on https://github.com/mongodb/libbson
			class REPO_API_EXPORT RepoBSON : public mongo::BSONObj
			{
				friend class RepoBSONBuilder;
				friend class repo::core::handler::MongoDatabaseHandler;
			public:<commit_msg>ISSUE #435 reverting the inheritance accesor<commit_after>/**
*  Copyright (C) 2015 3D Repo Ltd
*
*  This program is free software: you can redistribute it and/or modify
*  it under the terms of the GNU Affero General Public License as
*  published by the Free Software Foundation, either version 3 of the
*  License, or (at your option) any later version.
*
*  This program is distributed in the hope that it will be useful,
*  but WITHOUT ANY WARRANTY; without even the implied warranty of
*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*  GNU Affero General Public License for more details.
*
*  You should have received a copy of the GNU Affero General Public License
*  along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

/**
* repo_bson.h
*
*  Created on: 29 Jun 2015
*      Author: Carmen
*
*  Base Bson object. Generic bson that is inherited by others.
*/

#pragma once

#if defined(_WIN32) || defined(_WIN64)
#include <WinSock2.h>
#include <Windows.h>

#define strcasecmp _stricmp
#endif

#include <mongo/bson/bson.h>
#include <unordered_map>

#include "../../../lib/repo_log.h"
#include "../../../repo_bouncer_global.h"
#include "../repo_model_global.h"
#include "../../../lib/datastructure/repo_uuid.h"
#include "repo_bson_element.h"

#define REPO_BSON_MAX_BYTE_SIZE 16770000 //max size is 16MB,but leave a bit for buffer

namespace repo {
	namespace core {
		namespace handler {
			class MongoDatabaseHandler;
		}

		namespace model {
			//TODO: Eventually we should inherit from a generic BSON object.
			//work seems to have been started in here:https://github.com/jbenet/bson-cpp
			//alternatively we can use a c++ wrapper on https://github.com/mongodb/libbson
			class REPO_API_EXPORT RepoBSON : private mongo::BSONObj
			{
				friend class RepoBSONBuilder;
				friend class repo::core::handler::MongoDatabaseHandler;
			public:
{'fraction_non_alphanumeric': 0.10192616372391654, 'fraction_numerical': 0.015248796147672551, 'mean_word_length': 3.732911392405063, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, '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': '2756572', 'n_tokens_mistral': 1259, 'n_tokens_neox': 1160, 'n_words': 434}