<commit_before>#ifndef PORTS_H
#define PORTS_H

typedef vector<Noodle *> Port;

class Ports
{
	friend class Graph;
	
public:
	/* add an input or output port with the given name */
	void add(const char *name);
	/* associate a named port with a noodle */
	virtual void connect(const char *name, Noodle *noodle) = 0;
	
protected:
	/* get a reference to the port with the given name */
	Port& find_port(const char *name);
	/* get a reference to the port with the given name and check connections */
	virtual Port& find_port_check(const char *name) = 0;
	
	/* friendly name -> array index mapping */
	unordered_map<const char *, int> m_names;
	/* array of ports, each possibly having multiple noodle pointers */
	vector<Port> m_ports;
};

class InputPorts : public Ports
{
public:
	/* associate a named port with a noodle */
	void connect(const char *name, Noodle *noodle);
	
	/* return the number of samples waiting in the given input port;
	 * this value is guaranteed not to decrease unless get() is called */
	size_t please(const char *name);
	
	/* get one sample from the input port queue */
	void get_one(const char *name, int *sample);
	/* get multiple samples from the input port queue;
	 * only performs one lock/unlock cycle on the queue mutex */
	void get_multi(const char *name, size_t count, int *samples);<commit_msg>Ports: add virtual function prototype for please()<commit_after>#ifndef PORTS_H
#define PORTS_H

typedef vector<Noodle *> Port;

class Ports
{
	friend class Graph;
	
public:
	/* add an input or output port with the given name */
	void add(const char *name);
	/* associate a named port with a noodle */
	virtual void connect(const char *name, Noodle *noodle) = 0;
	
	virtual size_t please(const char *name) = 0;
	
protected:
	/* get a reference to the port with the given name */
	Port& find_port(const char *name);
	/* get a reference to the port with the given name and check connections */
	virtual Port& find_port_check(const char *name) = 0;
	
	/* friendly name -> array index mapping */
	unordered_map<const char *, int> m_names;
	/* array of ports, each possibly having multiple noodle pointers */
	vector<Port> m_ports;
};

class InputPorts : public Ports
{
public:
	/* associate a named port with a noodle */
	void connect(const char *name, Noodle *noodle);
	
	/* return the number of samples waiting in the given input port;
	 * this value is guaranteed not to decrease unless get() is called */
	size_t please(const char *name);
	
	/* get one sample from the input port queue */
	void get_one(const char *name, int *sample);
	/* get multiple samples from the input port queue;
	 * only performs one lock/unlock cycle on the queue mutex */
	void get_multi(const char *name, size_t count, int *samples);
{'fraction_non_alphanumeric': 0.09134088417975886, 'fraction_numerical': 0.001826817683595177, 'mean_word_length': 3.933333333333333, 'pattern_counts': {'":': 0, '<': 9, '<?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': '7342122', 'n_tokens_mistral': 847, 'n_tokens_neox': 811, 'n_words': 369}