| 163 | }; |
| 164 | |
| 165 | class string_array |
| 166 | { |
| 167 | public: |
| 168 | struct holder_t |
| 169 | { |
| 170 | explicit holder_t(std::string&& d) |
| 171 | : data(std::move(d)) |
| 172 | { |
| 173 | } |
| 174 | |
| 175 | std::string data; |
| 176 | }; |
| 177 | |
| 178 | public: |
| 179 | explicit string_array(std::string&& value) |
| 180 | : value_(std::make_shared<holder_t>(std::move(value))) |
| 181 | { |
| 182 | } |
| 183 | |
| 184 | public: |
| 185 | enum dtype dtype() const |
| 186 | { |
| 187 | return dtype::string; |
| 188 | } |
| 189 | |
| 190 | std::span<const uint8_t> data() const |
| 191 | { |
| 192 | return base::span_cast<const uint8_t>(base::span_cast(std::string_view(value_->data))); |
| 193 | } |
| 194 | |
| 195 | const auto& owner() const |
| 196 | { |
| 197 | return value_; |
| 198 | } |
| 199 | |
| 200 | icm::shape shape() const |
| 201 | { |
| 202 | return icm::shape(); |
| 203 | } |
| 204 | |
| 205 | constexpr bool is_dynamic() const noexcept |
| 206 | { |
| 207 | return false; |
| 208 | } |
| 209 | |
| 210 | private: |
| 211 | std::shared_ptr<holder_t> value_; |
| 212 | }; |
| 213 | |
| 214 | } // namespace impl |
| 215 | |