#ifndef TRACERWITHHISTORY_H_
#define TRACERWITHHISTORY_H_

#include <iostream>
#include <string>
#include <vector>

// This is a version of Tracer which tracks the entire history of
// its values, not just the most recent one.  Its interface is
// designed to be a a drop-in replacement of Tracer, and its
// classname is deliberately terse to facilitate live coding.
class TracerH {
 public:
  // Constructors.
  TracerH();
  ~TracerH();
  TracerH(const TracerH &rhs);

  // Assignment operator.
  TracerH &operator=(const TracerH &rhs);

  // Less-than comparison operator.
  bool operator<(const TracerH &rhs) const;

  // << operator
  friend std::ostream &operator<<(std::ostream &out, const TracerH &rhs);

 private:
  // Return "id_ [history_]" as a string
  std::string Print(void) const;

  // This static (class member) tracks the next id_ to hand out.
  static int nextid_;
  
  const int id_;              // fixed id of this Tracer
  std::vector<int> history_;  // the history of ids that lead to this Tracer
};

#endif  // TRACERWITHHISTORY_H_