00001 //-------------------------------------------------------------------------- 00002 // File and Version Information: 00003 // $Id: HTAbsValVector.h,v 1.2 2009/12/23 02:59:56 zhangy Exp $ 00004 // 00005 // Description: 00006 // This is an abstract class specifing the interface which any 00007 // vector-like class must provide if it needs to be used as the parameter 00008 // to ntuple's column() method taking arrays. 00009 // 00010 // Environment: 00011 // Software developed for the BaBar Detector at the SLAC B-Factory. 00012 // 00013 // Author List: 00014 // A.Salnikov 00015 // 00016 // Copyright Information: 00017 // Copyright (C) 1997 Saclay 00018 // 00019 // History: 00020 // Migration for BESIII MDC 00021 // 00022 //------------------------------------------------------------------------ 00023 00024 #ifndef HTAbsValVector_H 00025 #define HTAbsValVector_H 00026 00027 #include <sys/types.h> 00028 #include <stddef.h> 00029 00030 // --------------------- 00031 // -- Class Interface -- 00032 // --------------------- 00033 00034 template<class T> 00035 class HTAbsValVector { 00036 00037 public: 00038 virtual ~HTAbsValVector() {} 00039 00040 // operators 00041 virtual const T& operator()(size_t i) const = 0; 00042 virtual T& operator()(size_t i) = 0; 00043 virtual const T& operator[](size_t i) const = 0; 00044 virtual T& operator[](size_t i) = 0; 00045 00046 // methods 00047 virtual size_t length() const = 0; 00048 00049 }; 00050 00051 #endif // TEMPLATE_H