/* $Id: gramlistsimple.h 5146 2010-03-24 23:05:57Z abehm $ Copyright (C) 2010 by The Regents of the University of California Redistribution of this file is permitted under the terms of the BSD license. Date: 04/04/2008 Author: Alexander Behm */ #ifndef _gramlistsimple_h_ #define _gramlistsimple_h_ #include "gramlist.h" template > class GramListSimple : public GramList { protected: InvList invertedList; public: GramListSimple() {}; InvList* getArray(fstream* invListsFile = NULL) { return &invertedList; } ~GramListSimple() {}; void free() { delete this; } void clear() { } }; // specialized for Array with a better reallocation policy template<> class GramListSimple > : public GramList > { protected: Array* invertedList; public: GramListSimple() : invertedList(new Array(2, 2.0f, REALLOC_MULT)) {} Array* getArray(fstream* invListsFile = NULL) { return invertedList; } ~GramListSimple() { delete invertedList; } void free() { delete this; } void clear() { } }; // specialized for Array with a better reallocation policy template<> class GramListSimple > : public GramList > { protected: Array* invertedList; public: GramListSimple() : invertedList(new Array(2, 2.0f, REALLOC_MULT)) {} Array* getArray(fstream* invListsFile = NULL) { return invertedList; } ~GramListSimple() { delete invertedList; } void free() { delete this; } void clear() { } }; #endif