// -*- C++ -*- /** * WordInfo.h * * Description: declaration of a class which preserves information about * words recognized by the speech engine. * * Copyright (c) 2001, Deborah Kaplan and Jessica Perry Hekman * See the LICENSE file. All rights not granted therein are reserved. * * @author Deborah Kaplan * @author Jessica Perry Hekman * $Revision: 1.1 $ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * */ /* * LinkedList is a class for maintaining a doubly-linked list. */ #include class LinkedList { public: // constructor LinkedList(); // destructor ~LinkedList(); LinkedList *getNext() { return (_next); } LinkedList *getPrev() { return(_prev); } void setNext(LinkedList *next) { _next = next; } void setPrev(LinkedList *prev) { _prev = prev; } void remove(); /* Adds a new item along the "next" axis: it is a newer thing */ void append(LinkedList *newList) { setNext(newList); newList->setPrev(this); } /* Remove all objects after this one along the "prev" axis */ int deleteOlderObjects(); private: LinkedList *_next; LinkedList *_prev; };