<commit_before>#pragma once
//=====================================================================//
/*!	@file
	@brief	Graphics Library Core (glfw3)
	@author	平松邦仁 (<EMAIL>)
*/
//=====================================================================//
#include <string>
#include <thread>
#include <future>
#include <unistd.h>
#include "utils/singleton_policy.hpp"
#include "core/device.hpp"
#include "gl_fw/glfonts.hpp"

namespace gl {

	//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
	/*!
		@brief	Graphics Core (glfw3) Library クラス@n
				※ハードウェアー依存の操作を扱う部分を集積したクラス。
	*/
	//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
	class core : public utils::singleton_policy<core> {

		friend struct utils::singleton_policy<core>;

	public:
		static device::bitsets	bitsets_;
		static device::locator	locator_;

	private:
		std::string		current_path_;
		std::string		exec_path_;

		device			device_;

		fonts			fonts_;

		GLFWwindow*		window_;

		vtx::spos		best_size_;
		vtx::spos		limit_size_;
		vtx::spos		size_;
		vtx::srect		rect_;

		int				recv_file_id_;
		utils::strings	recv_file_path_;

		std::string		title_;

		std::future<uint32_t>	v_sync_wait_;
		uint32_t	sync_count_;

		uint32_t	frame_count_;
		double		frame_time_;
		double		machine_cycle_;
		double		cpu_ghz_;
		bool		cpu_spd_enable_;
		bool		swap_ctrl_;

		bool		exit_signal_;
		bool		full_screen_;

		bool		keyboard_jp_;

		static uint32_t wait_sync_task_(uint32_t in) {
			++in;
			usleep(16000);	// 16ms
			return in;
		}

		void start_sync_() {
			v_sync_wait_ = std::async(std::launch::async,
									  wait_sync_task_,
									  sync_count_);
		}

		void wait_sync_() { sync_count_ = v_sync_wait_.get(); }

		//-----------------------------------------------------------------//
		/*!
			@brief	コンストラクター
		*/
		//-----------------------------------------------------------------//
		core() : window_(0),
				 best_size_(0), limit_size_(0), size_(0), rect_(0),
				 recv_file_id_(0),
				 title_(),
				 sync_count_(0),
				 frame_count_(0), frame_time_(0.0),
				 machine_cycle_(0.0), cpu_ghz_(0.0),
				 cpu_spd_enable_(false), swap_ctrl_(false),
				 exit_signal_(false), full_screen_(false), keyboard_jp_(false) { }

		core(const core& rhs);
		core& operator = (const core& rhs);<commit_msg>edit comment<commit_after>#pragma once
//=====================================================================//
/*!	@file
	@brief	Graphics Library Core (glfw3)
	@author	平松邦仁 (<EMAIL>)
*/
//=====================================================================//
#include <string>
#include <thread>
#include <future>
#include <unistd.h>
#include "utils/singleton_policy.hpp"
#include "core/device.hpp"
#include "gl_fw/glfonts.hpp"

namespace gl {

	//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
	/*!
		@brief	Graphics Core (glfw3) Library クラス@n
				※ハードウェアー依存の操作を扱う部分を集積したクラス。
	*/
	//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
	class core : public utils::singleton_policy<core> {

		friend struct utils::singleton_policy<core>;

	public:
		static device::bitsets	bitsets_;
		static device::locator	locator_;

	private:
		std::string		current_path_;
		std::string		exec_path_;

		device			device_;

		fonts			fonts_;

		GLFWwindow*		window_;

		vtx::spos		best_size_;
		vtx::spos		limit_size_;
		vtx::spos		size_;
		vtx::srect		rect_;

		int				recv_file_id_;
		utils::strings	recv_file_path_;

		std::string		title_;

		std::future<uint32_t>	v_sync_wait_;
		uint32_t	sync_count_;

		uint32_t	frame_count_;
		double		frame_time_;
		double		machine_cycle_;
		double		cpu_ghz_;
		bool		cpu_spd_enable_;
		bool		swap_ctrl_;

		bool		exit_signal_;
		bool		full_screen_;

		bool		keyboard_jp_;

		static uint32_t wait_sync_task_(uint32_t in) {
			++in;
			usleep(16000);	// 16ms
			return in;
		}

		void start_sync_() {
			v_sync_wait_ = std::async(std::launch::async,
									  wait_sync_task_,
									  sync_count_);
		}

		void wait_sync_() {
			sync_count_ = v_sync_wait_.get();
		}

		//-----------------------------------------------------------------//
		/*!
			@brief	コンストラクター
		*/
		//-----------------------------------------------------------------//
		core() : window_(0),
				 best_size_(0), limit_size_(0), size_(0), rect_(0),
				 recv_file_id_(0),
				 title_(),
				 sync_count_(0),
				 frame_count_(0), frame_time_(0.0),
				 machine_cycle_(0.0), cpu_ghz_(0.0),
				 cpu_spd_enable_(false), swap_ctrl_(false),
				 exit_signal_(false), full_screen_(false), keyboard_jp_(false) { }

		core(const core& rhs);
		core& operator = (const core& rhs);
{'fraction_non_alphanumeric': 0.2863930885529158, 'fraction_numerical': 0.014254859611231102, 'mean_word_length': 3.1608265947888587, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, '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': '2625015', 'n_tokens_mistral': 1935, 'n_tokens_neox': 1601, 'n_words': 284}