<commit_before>/**
 * @file		driver.hpp
 * @brief		Component driver
 * @author		<NAME><<EMAIL>>
 * @date 		2015. 6. 21
 * @details	Load components with driver
 */

#ifndef _COSSB_DRIVER_HPP_
#define _COSSB_DRIVER_HPP_

#include <string>
#include "interface/icomponent.hpp"
#include "manager.hpp"

using namespace std;

namespace cossb {
namespace driver {

class component_driver {

	friend class manager::component_manager;

public:
	component_driver(const char* component_name);
	virtual ~component_driver();

	/**
	 * @brief	component validation for driving
	 */
	bool valid() { return _handle!=nullptr; }

	/**
	 * @brief	getting component pointer to access
	 */
	interface::icomponent* get_component() const { return _ptr_component; };

private:
	/**
	 * @brief	run component
	 */
	void run();

	/**
	 * @brief	stop component
	 */
	void stop();

	/**
	 * @brief	load component by name
	 */
	bool load(const char* component_name);

	/**<commit_msg>only broker and manager can access the all functions<commit_after>/**
 * @file		driver.hpp
 * @brief		Component driver
 * @author		<NAME><<EMAIL>>
 * @date 		2015. 6. 21
 * @details	Load components with driver
 */

#ifndef _COSSB_DRIVER_HPP_
#define _COSSB_DRIVER_HPP_

#include <string>
#include "interface/icomponent.hpp"
#include "manager.hpp"

using namespace std;

namespace cossb {
namespace driver {

class component_driver {

	friend class manager::component_manager;
	friend class broker::component_broker;

public:
	component_driver(const char* component_name);
	virtual ~component_driver();

	/**
	 * @brief	component validation for driving
	 */
	bool valid() { return _handle!=nullptr; }

	/**
	 * @brief	getting component pointer to access
	 */
	interface::icomponent* get_component() const { return _ptr_component; };

private:
	/**
	 * @brief	setup component
	 */
	void setup();

	/**
	 * @brief	run component
	 */
	void run();

	/**
	 * @brief	stop component
	 */
	void stop();

	/**
	 * @brief	load component by name
	 */
	bool load(const char* component_name);

	/**
{'fraction_non_alphanumeric': 0.12622789783889982, 'fraction_numerical': 0.0068762278978389, 'mean_word_length': 3.9682926829268292, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '6372915', 'n_tokens_mistral': 700, 'n_tokens_neox': 646, 'n_words': 186}