<commit_before>#ifndef SRC_PORTS_STREAM_SOURCES_STREAM_STATE_HPP_
#define SRC_PORTS_STREAM_SOURCES_STREAM_STATE_HPP_

// std
#include <memory>

namespace fc
{

/**
 * Simple StreamSource implementation that holds a stream_state.
 * Can be connected to any number of SinkConnections.
 * Is a SourceConnection.
 */
template<class data_t>
class stream_state
{
public:
	stream_state(data_t d_) : d(new data_t(d_)){}

	/// pull data
	data_t operator()() { return *d; }

	/// set current value
	void set(data_t d_) { *d = d_; }

private:
	std::shared_ptr<data_t> d;
};

} // namespace fc

#endif /* SRC_PORTS_STREAM_SOURCES_STREAM_STATE_HPP_ */
<commit_msg>Use of make_shared (see review)<commit_after>#ifndef SRC_PORTS_STREAM_SOURCES_STREAM_STATE_HPP_
#define SRC_PORTS_STREAM_SOURCES_STREAM_STATE_HPP_

// std
#include <memory>

namespace fc
{

/**
 * Simple StreamSource implementation that holds a stream_state.
 * Can be connected to any number of SinkConnections.
 * Is a SourceConnection.
 */
template<class data_t>
class stream_state
{
public:
	stream_state(data_t d_) : d(std::make_shared<data_t>(d_)){}

	/// pull data
	data_t operator()() { return *d; }

	/// set current value
	void set(data_t d_) { *d = d_; }

private:
	std::shared_ptr<data_t> d;
};

} // namespace fc

#endif /* SRC_PORTS_STREAM_SOURCES_STREAM_STATE_HPP_ */

{'fraction_non_alphanumeric': 0.11244377811094453, 'fraction_numerical': 0.0, 'mean_word_length': 4.804347826086956, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 10, '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': '5702497', 'n_tokens_mistral': 510, 'n_tokens_neox': 486, 'n_words': 117}