00001 #ifndef DDVector_h 00002 #define DDVector_h 00003 00004 #include "DetectorDescription/Core/interface/DDBase.h" 00005 #include "DetectorDescription/Core/interface/DDName.h" 00006 #include <vector> 00007 #include <iostream> 00008 00009 class DDVector; 00010 00012 std::ostream & operator<<(std::ostream & o, const DDVector & cons); 00013 00014 //typedef std::vector<double> dd_constant_type; 00015 00017 class DDVector : public DDBase<DDName, std::vector<double>* > 00018 { 00019 public: 00020 00022 typedef std::vector<double>::size_type size_t; 00023 00025 //typedef std::vector<double>::const_iterator const_iterator; 00026 00028 typedef std::vector<double> value_type; 00029 00031 DDVector(); 00032 00034 DDVector(const DDName & name); 00035 00037 DDVector(const DDName & name, std::vector<double>* value); 00038 00040 size_t size() const { return rep().size(); } 00041 00043 const value_type & values() const { return rep(); } 00044 00046 double operator[](size_t pos) const { return rep()[pos]; } 00047 00049 double value() const { return rep()[0]; } 00050 00052 value_type::const_iterator vectorBegin() const { return rep().begin(); } 00053 00055 value_type::const_iterator vectorEnd() const { return rep().end(); } 00056 00058 operator double() const { return rep()[0]; } 00059 00061 operator std::vector<double>() const { return rep(); } 00062 00064 operator std::vector<int>() const; 00065 }; 00066 #endif