#ifndef LISTND_H #define LISTND_H template class List; template class Polynom; template // ListNode class // Each node of the link list will be an object of the ListNode class // ----------------------------------------------------------------------- class ListNode { friend class List; friend class Polynom; public: ListNode(const NODETYPE &); NODETYPE getData() const; void setData(NODETYPE &info); ListNode * getnextptr(); private: NODETYPE data; ListNode *nextPtr; }; // Constructor // ------------------------------------------------------------------------- template ListNode::ListNode(const NODETYPE &info) :data(info),nextPtr(0) {} // getData function returns the data of the node // ------------------------------------------------------------------------- template NODETYPE ListNode::getData() const { return data; } // setData sets the data part of the object to the value given as a parameter // ------------------------------------------------------------------------- template void ListNode::setData(NODETYPE &info) { data=info; } // getnextptr returns the nextptr of the object // ------------------------------------------------------------------------ template ListNode * ListNode::getnextptr() { return nextPtr; } #endif