#pragma once

#include "style.h"

class Socket;
class Plug;
class PlugIterator;
class Node;

class Link SIGNATURED
{
	friend class PlugIterator;

public:
	virtual ~Link();
	Logical TestInstance() const;

	Socket *GetSocket()	{ return socket; }
	Plug *GetPlug()		{ return plug; }

protected:
	Link(Socket *socket, Plug *plug);

	void ReleaseFromPlug();

	Socket *socket;
	Plug *plug;

private:
	void AddToPlug(Plug *plug);

	Link *nextLink;
	Link *prevLink;
};