//=-- AccessLogPlugin.h - This class encapsulates the access_log file --------=
//
//   This class provides an interface for dealing with the access_log file.
//
//=---------------------------------------------------------------------------=
//  This file is copyright (c) 1997-1998 Chris Lattner
//=---------------------------------------------------------------------------=

#ifndef ACCESSLOGPLUGIN_H
#define ACCESSLOGPLUGIN_H

#include "Plugin.h"
class Serialize;

class MSAPI AccessLogPlugin : public Plugin {
public :
  AccessLogPlugin(const String &name) : Plugin(name) {
    NumAccesses = ErrorInitialize = 0;
  }

  inline static PluginType GetPluginType() { 
    return Plugin::ACCESS_LOG_PLUGIN; 
  }

  // Provide a convenient way to create AccessLogPlugin objects...
  static AccessLogPlugin *CreatePlugin(const String &Name) {
    return (AccessLogPlugin *)Plugin::CreatePlugin(GetPluginType(), Name);
  }

  virtual int ReadAccess(String &) = 0;
  virtual ~AccessLogPlugin() { }

  int GetNumAccesses() { return NumAccesses; }

  inline int ErrorOccured() { return ErrorInitialize; }

protected :
  int NumAccesses;     // Number of accesses read this time...
  int ErrorInitialize;
};

#endif
