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