// -*- C++ -*-=

#include "VarTable.h"

// Primary (P) holds the number of hits, the Secondary (S) hold the bw transfered.
typedef DataPair<int, int> HitBWRec;  // One record for the hashtable...

// When the hashtable is converted to a list, this is used...
typedef DataPair<String,HitBWRec> ListPair;

class PPPathBreakout : public PluginTemplate<PagePlugin,PPPathBreakout> {
public:
  inline static unsigned int GetCurrentVersion() {
    return 100;                       // Version 1.00
  } 

  inline static const char *GetPluginName() {
    return "PathBreakout";
  }

  PPPathBreakout(int &CE);

  // The full name consists of all of the data settings that alter the data that is 
  //   kept track of and stored.
  void GetFullName(VarTable &Params, 
                   String &FullName, int UpdateFreq);

  void ProcessAccess(AccessFormatPlugin &A);

  void OutputHTML(ostream &O, VarTable &Params);
  void ResetState();

  void LoadState(Serialize &I);
  void SaveState(Serialize &O);

private :
  int CalculateDepth(const String &URL);

private :
  Table<String, HitBWRec> CountTable;
  int TotalHits, TotalBW;
};
