//=-- FilterManager.h - Maintains filter, creates and destroys filters -------=
//
//  The class is used to cache filter objects so that only one for each filter
//  exists.  This ensures that the individual filter objects can accomplish
//  their caching strategies effectively.
//
//=---------------------------------------------------------------------------=
//  This file is copyright (c) 1997-1998 Chris Lattner
//=---------------------------------------------------------------------------=

#ifndef FILTERMANAGER_H
#define FILTERMANAGER_H

#include "MSString.h"
#include "LinkedList.h"
#include "FilterHandle.h"

class Filter;
class VTExp;
class VTListExp;
template <class Key, class Value> class Table;

class MSAPI FilterManager {
public :
  // Get a filter, when you have a list of two elements, corresponding the the
  // include and exclude portions of the filter.
  //
  static FilterHandle GetFilter(VTListExp *FilterSpec);

  // Get a filter, when you have a list of parameters and a parameter name...
  //
  static FilterHandle GetFilter(Table<CSString,VTExp*> *List, 
                                const String &KeyName);

  // Get a filter, when you know the I and E portions of the filter spec 
  // explicitly...
  //
  static FilterHandle GetFilter(const String &I = "*", const String &E = "");

private :
  static LinkedList<FilterHandle> FilterList;
};

#endif
