#ifndef SEC6_TRIPLE_H_

#include <iostream>

// A class representing a generic 3-tuple.
template <class T1,class T2,class T3>
class Triple {
 public:
  Triple(T1 &x, T2 &y, T3 &z)
    : z_(z), y_(y), x_(x) { }

  // Simple member accessors.
  T1 get_x() { return x_; }
  T2 get_y() { return y_; }
  T3 get_z() { return z_; }
  void set_x(const T1 &x) { x_ = x; }
  void set_y(const T2 &y) { y_ = y; }
  void set_z(const T3 &z) { z_ = z; }

 private:
  T1 x_;
  T2 y_;
  T3 z_;
}

// Pass the tuple in the standard format "(x,y,z)" to the out ostream.
template <class T1, class T2, class T3>
std::ostream &operator<<(std::ostream &out, const Triple<T1,T2,T3> &rhs) {
  out << "(" << rhs.get_x() << "," << rhs.get_y() << "," << rhs.get_z() << ")";
  return out;
}

#endif // SEC6_TRIPLE_H_