//---------------------------------------------------------------------------

#ifndef SignalH
#define SignalH
   
class Node;
class Network;

class Signal {
  friend class Network;
  protected:
	Network *owner;			// owner network
	string name;			// name of the signal. Must be unique in the network
	pair<list<Node>::iterator, unsigned int> source;			// source node (driver node) and its output
	bool undefsource;		// source not defined
	list<pair<list<Node>::iterator, unsigned int> > dest;		// list of destination nodes with inputs. If node is a PI, points to NULL
	bool PI;			// is this signal a PI?
	bool PO;			// is this signal a PI?


  public:
    Signal();
	~Signal();

	bool IsPI(void) const { return PI; };
	bool IsPO(void) const { return PO; };
	bool IsConstant(void) const { return undefsource; };
	string getName(void) const { return name; };

	pair<list<Node>::iterator, unsigned int> *GetSource(void) { return &source; };
	list<pair<list<Node>::iterator, unsigned int> > *GetDest(void) { return &dest; };
};


//---------------------------------------------------------------------------
#endif
