<commit_before>#ifndef SRC_PORTS_PORTS_HPP_
#define SRC_PORTS_PORTS_HPP_

#include <ports/node_aware.hpp>
#include <ports/token_tags.hpp>
#include "pure_ports.hpp"

#include <graph/graph_connectable.hpp>

namespace fc
{

// === default mixins ===

template<class port_t>
struct node_aware_mixin : graph::graph_connectable<node_aware<port_t>>
{
	using base = graph::graph_connectable<node_aware<port_t>>;

	template <class T, class ... args>
	node_aware_mixin(T* node_ptr, args&&... base_constructor_args)
		: base(node_ptr->graph_info(),
				*(node_ptr->region().get()),
				std::forward<args>(base_constructor_args)...)
	{
		assert(node_ptr);
	}
};

template<class T> struct is_active_sink<node_aware_mixin<T>> : is_active_sink<T> {};
template<class T> struct is_active_source<node_aware_mixin<T>> : is_active_source<T> {};<commit_msg>ports: add TODO to node_aware_mixin constructor<commit_after>#ifndef SRC_PORTS_PORTS_HPP_
#define SRC_PORTS_PORTS_HPP_

#include <ports/node_aware.hpp>
#include <ports/token_tags.hpp>
#include "pure_ports.hpp"

#include <graph/graph_connectable.hpp>

namespace fc
{

// === default mixins ===

template<class port_t>
struct node_aware_mixin : graph::graph_connectable<node_aware<port_t>>
{
	using base = graph::graph_connectable<node_aware<port_t>>;

	// TODO: this T should really be tree_base_node. It can't be because this
	// requires a full declaration of tree_base_node and tree_base_node
	// requires a full declaration of node_aware_mixin.
	template <class T, class ... args>
	node_aware_mixin(T* node_ptr, args&&... base_constructor_args)
		: base(node_ptr->graph_info(),
				*(node_ptr->region().get()),
				std::forward<args>(base_constructor_args)...)
	{
		assert(node_ptr);
	}
};

template<class T> struct is_active_sink<node_aware_mixin<T>> : is_active_sink<T> {};
template<class T> struct is_active_source<node_aware_mixin<T>> : is_active_source<T> {};
{'fraction_non_alphanumeric': 0.1371518654755649, 'fraction_numerical': 0.0, 'mean_word_length': 6.323076923076923, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 43, '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': '6395540', 'n_tokens_mistral': 717, 'n_tokens_neox': 691, 'n_words': 125}