#pragma once

#include "sfeskt.h"

class SortedSocket : public SafeSocket
{
public:
	~SortedSocket();

	void AddValuePlug(Plug *plug, const void *value)	{ AddValueImplementation(plug, value); }

	Plug *FindPlug(const void *value)	{ return FindImplementation(value); }

protected:
	SortedSocket(Logical has_unique_entries = true);
	SortedSocket(Node *node, Logical has_unique_entries = true);

	Logical HasUniqueEntries()	{ return hasUniqueEntries; }

	virtual void AddValueImplementation(Plug *plug, const void *value);

	virtual Plug *FindImplementation(const void *value);

private:
	Logical hasUniqueEntries;
};

class SortedIterator : public SafeIterator
{
public:
	~SortedIterator();

	virtual Plug *FindImplementation(const void *value);

	virtual void *GetValueImplementation();

protected:
	SortedIterator(SortedSocket *sortedSocket);
};