/* -*- C++ -*- */ /************************************************************************* * Copyright(c) 1995~2005 Masaharu Goto (root-cint@cern.ch) * * For the licensing terms see the file COPYING * ************************************************************************/ #ifndef __CINT__ #include #ifndef __hpux #include using namespace std; #else #include #endif #endif template class ValueVector; // forward declaration of explitcit instantiation template<> class ValueVector ; template class ValueVector { public: typedef TYPE value_type ; //ValueVector(); private: TYPE val; #ifndef __CINT__ typedef ::ValueVector self_type ; typedef typename std::vector collection_type ; #else typedef ValueVector self_type ; typedef std::vector collection_type ; #endif typedef typename collection_type::reference reference ; typedef typename collection_type::const_reference const_reference ; typedef typename collection_type::pointer pointer ; typedef typename collection_type::const_pointer const_pointer ; typedef typename collection_type::const_iterator const_iterator ; collection_type _container; public: //----------------------------------------------------------------------------- // Primitive Operations //----------------------------------------------------------------------------- void clear(void) { _container.clear() ; } void assign(const self_type& rhs) { _container = rhs._container ; } bool compare(const self_type& rhs) const { return(_container == rhs._container) ; } //----------------------------------------------------------------------------- // Constructors, Destructor, and Assignment //----------------------------------------------------------------------------- ValueVector(void) : _container() { } ~ValueVector(void) { clear() ; } ValueVector(const self_type& rhs) : _container() { assign(rhs) ; } self_type& operator=(const ValueVector& rhs) { if (this != &rhs) { clear() ; assign(rhs) ; } return(*this) ; } //----------------------------------------------------------------------------- // Comparisons //----------------------------------------------------------------------------- bool operator == (const self_type& rhs) const { return( compare(rhs) ) ; } bool operator != (const self_type& rhs) const { return(!compare(rhs) ) ; } //----------------------------------------------------------------------------- void print(std::ostream& os = std::cout) const { } }; template <> class ValueVector { public: typedef double value_type ; ValueVector() { } private: double val; };