File indexing completed on 2024-04-06 12:05:24
0001 #ifndef DDVector_h
0002 #define DDVector_h
0003
0004 #include "DetectorDescription/Core/interface/DDBase.h"
0005 #include "DetectorDescription/Core/interface/DDName.h"
0006 #include <memory>
0007 #include <vector>
0008 #include <iostream>
0009
0010 class DDVector;
0011
0012
0013 std::ostream& operator<<(std::ostream& o, const DDVector& cons);
0014
0015
0016
0017
0018 class DDVector : public DDBase<DDName, std::unique_ptr<std::vector<double> > > {
0019 public:
0020
0021 using size_t = std::vector<double>::size_type;
0022
0023
0024 using value_type = std::vector<double>;
0025
0026
0027 DDVector();
0028
0029
0030 DDVector(const DDName& name);
0031
0032
0033 DDVector(const DDName& name, std::unique_ptr<std::vector<double> > value);
0034
0035
0036 size_t size() const { return rep().size(); }
0037
0038
0039 const value_type& values() const { return rep(); }
0040
0041
0042 double operator[](size_t pos) const { return rep()[pos]; }
0043
0044
0045 double value() const { return rep()[0]; }
0046
0047
0048 value_type::const_iterator vectorBegin() const { return rep().begin(); }
0049
0050
0051 value_type::const_iterator vectorEnd() const { return rep().end(); }
0052
0053
0054 operator double() const { return rep()[0]; }
0055
0056
0057 operator std::vector<double>() const { return rep(); }
0058
0059
0060 operator std::vector<int>() const;
0061 };
0062 #endif